use of com.tvd12.ezyfoxserver.event.EzyServerInitializingEvent in project ezyfox-server by youngmonkeys.
the class EzyZonesStarter method notifyServerInitializing.
protected void notifyServerInitializing(EzyZoneContext zoneContext) {
EzyServerInitializingEvent event = new EzySimpleServerInitializingEvent();
zoneContext.handleEvent(EzyEventType.SERVER_INITIALIZING, event);
}
use of com.tvd12.ezyfoxserver.event.EzyServerInitializingEvent in project ezyfox-server by youngmonkeys.
the class EzyBootstrap method notifyServerInitializing.
protected void notifyServerInitializing() {
EzyServerInitializingEvent event = new EzySimpleServerInitializingEvent();
context.handleEvent(EzyEventType.SERVER_INITIALIZING, event);
}
use of com.tvd12.ezyfoxserver.event.EzyServerInitializingEvent in project ezyfox-server by youngmonkeys.
the class EzyBroadcastEventImplTest method test.
@Test
public void test() {
EzyServerContext serverContext = mock(EzyServerContext.class);
EzyZoneContext zoneContext1 = mock(EzyZoneContext.class);
EzyZoneContext zoneContext2 = mock(EzyZoneContext.class);
doThrow(new IllegalStateException()).when(zoneContext2).handleEvent(any(), any());
when(serverContext.getZoneContexts()).thenReturn(Lists.newArrayList(zoneContext1, zoneContext2));
EzyBroadcastEventImpl cmd = new EzyBroadcastEventImpl(serverContext);
EzyServerInitializingEvent event = new EzySimpleServerInitializingEvent();
cmd.fire(EzyEventType.SERVER_INITIALIZING, event, true);
try {
cmd.fire(EzyEventType.SERVER_INITIALIZING, event, false);
} catch (Exception e) {
assert e instanceof IllegalStateException;
}
}
Aggregations