|
@@ -1,44 +1,44 @@ |
1 |
|
- |
// This Source Code is in the Public Domain per: http://unlicense.org |
2 |
|
- |
package org.litesoft.GWT.eventbus.server; |
3 |
|
- |
|
4 |
|
- |
import org.litesoft.GWT.eventbus.client.*; |
5 |
|
- |
import org.litesoft.delayed.*; |
6 |
|
- |
|
7 |
|
- |
/** |
8 |
|
- |
* A simple, non-distributed Server implementation of an event bus. |
9 |
|
- |
*/ |
10 |
|
- |
public class SimpleServerEventBus extends AbstractSimpleEventBus implements IServerEventBus { |
11 |
|
- |
public Type getType() { |
12 |
|
- |
return Type.Simple; |
13 |
|
- |
} |
14 |
|
- |
|
15 |
|
- |
public SimpleServerEventBus() { |
16 |
|
- |
super( TimedRunnableManager.INSTANCE, LoggingUnexpectedEventPackageHandler.INSTANCE ); |
17 |
|
- |
} |
18 |
|
- |
|
19 |
|
- |
public void apply( ServerEventBusSubscriptionCollector pCollector ) { |
20 |
|
- |
if ( pCollector != null ) { |
21 |
|
- |
for ( ServerEventBusDisposeListener zListener : pCollector.getListeners() ) { |
22 |
|
- |
addListener( zListener ); |
23 |
|
- |
} |
24 |
|
- |
subscribe( pCollector ); |
25 |
|
- |
} |
26 |
|
- |
} |
27 |
|
- |
|
28 |
|
- |
public void addListener( ServerEventBusDisposeListener pServerEventBusDisposeListener ) { |
29 |
|
- |
throw noListenerSupport(); |
30 |
|
- |
} |
31 |
|
- |
|
32 |
|
- |
public void removeListener( ServerEventBusDisposeListener pServerEventBusDisposeListener ) { |
33 |
|
- |
throw noListenerSupport(); |
34 |
|
- |
} |
35 |
|
- |
|
36 |
|
- |
public ServerEventBusDisposeListener[] getServerEventBusDisposeListeners() { |
37 |
|
- |
throw noListenerSupport(); |
38 |
|
- |
} |
39 |
|
- |
|
40 |
|
- |
private UnsupportedOperationException noListenerSupport() { |
41 |
|
- |
return new UnsupportedOperationException( |
42 |
|
- |
"ServerEventBusDisposeListener(s) not supported on SimpleServerEventBus" ); |
43 |
|
- |
} |
44 |
|
- |
} |
|
1 |
+ |
// This Source Code is in the Public Domain per: http://unlicense.org |
|
2 |
+ |
package org.litesoft.GWT.eventbus.server; |
|
3 |
+ |
|
|
4 |
+ |
import org.litesoft.GWT.eventbus.client.*; |
|
5 |
+ |
import org.litesoft.delayed.*; |
|
6 |
+ |
|
|
7 |
+ |
/** |
|
8 |
+ |
* A simple, non-distributed Server implementation of an event bus. |
|
9 |
+ |
*/ |
|
10 |
+ |
public class SimpleServerEventBus extends AbstractSimpleEventBus implements IServerEventBus { |
|
11 |
+ |
public Type getType() { |
|
12 |
+ |
return Type.Simple; |
|
13 |
+ |
} |
|
14 |
+ |
|
|
15 |
+ |
public SimpleServerEventBus() { |
|
16 |
+ |
super( TimedRunnableManager.INSTANCE, LoggingUnexpectedEventPackageHandler.INSTANCE ); |
|
17 |
+ |
} |
|
18 |
+ |
|
|
19 |
+ |
public void apply( ServerEventBusSubscriptionCollector pCollector ) { |
|
20 |
+ |
if ( pCollector != null ) { |
|
21 |
+ |
for ( ServerEventBusDisposeListener zListener : pCollector.getListeners() ) { |
|
22 |
+ |
addListener( zListener ); |
|
23 |
+ |
} |
|
24 |
+ |
subscribe( pCollector ); |
|
25 |
+ |
} |
|
26 |
+ |
} |
|
27 |
+ |
|
|
28 |
+ |
public void addListener( ServerEventBusDisposeListener pServerEventBusDisposeListener ) { |
|
29 |
+ |
throw noListenerSupport(); |
|
30 |
+ |
} |
|
31 |
+ |
|
|
32 |
+ |
public void removeListener( ServerEventBusDisposeListener pServerEventBusDisposeListener ) { |
|
33 |
+ |
throw noListenerSupport(); |
|
34 |
+ |
} |
|
35 |
+ |
|
|
36 |
+ |
public ServerEventBusDisposeListener[] getServerEventBusDisposeListeners() { |
|
37 |
+ |
throw noListenerSupport(); |
|
38 |
+ |
} |
|
39 |
+ |
|
|
40 |
+ |
private UnsupportedOperationException noListenerSupport() { |
|
41 |
+ |
return new UnsupportedOperationException( |
|
42 |
+ |
"ServerEventBusDisposeListener(s) not supported on SimpleServerEventBus" ); |
|
43 |
+ |
} |
|
44 |
+ |
} |