use of com.tvd12.ezyfoxserver.setting.EzySimpleSettings in project ezyfox-server-example by tvd12.
the class PushMessageServerStartup method main.
public static void main(String[] args) throws Exception {
EzyPluginSettingBuilder pluginSettingBuilder = new EzyPluginSettingBuilder().name(PLUGIN_NAME).addListenEvent(EzyEventType.USER_LOGIN).entryLoader(PluginEntryLoader.class);
EzyAppSettingBuilder appSettingBuilder = new EzyAppSettingBuilder().name(APP_NAME).entryLoader(AppEntryLoader.class);
EzyZoneSettingBuilder zoneSettingBuilder = new EzyZoneSettingBuilder().name(ZONE_NAME).application(appSettingBuilder.build()).plugin(pluginSettingBuilder.build());
EzySimpleSettings settings = new EzySettingsBuilder().zone(zoneSettingBuilder.build()).build();
EzyEmbeddedServer server = EzyEmbeddedServer.builder().settings(settings).build();
server.start();
}
use of com.tvd12.ezyfoxserver.setting.EzySimpleSettings in project ezyfox-server-example by tvd12.
the class SimpleChatStartup method main.
public static void main(String[] args) throws Exception {
EzyPluginSettingBuilder pluginSettingBuilder = new EzyPluginSettingBuilder().name("simple-chat").addListenEvent(EzyEventType.USER_LOGIN).entryLoader(DecoratedPluginEntryLoader.class);
EzyAppSettingBuilder appSettingBuilder = new EzyAppSettingBuilder().name("simple-chat").entryLoader(DecoratedAppEntryLoader.class);
EzyZoneSettingBuilder zoneSettingBuilder = new EzyZoneSettingBuilder().name("example").application(appSettingBuilder.build()).plugin(pluginSettingBuilder.build());
EzySimpleSettings settings = new EzySettingsBuilder().zone(zoneSettingBuilder.build()).build();
EzyEmbeddedServer server = EzyEmbeddedServer.builder().settings(settings).build();
server.start();
}
use of com.tvd12.ezyfoxserver.setting.EzySimpleSettings in project ezyfox-server-example by tvd12.
the class ServerStartup method main.
public static void main(String[] args) throws Exception {
EzyPluginSettingBuilder pluginSettingBuilder = new EzyPluginSettingBuilder().name(PLUGIN_NAME).addListenEvent(EzyEventType.USER_LOGIN).entryLoader(PluginEntryLoader.class);
EzyZoneSettingBuilder zoneSettingBuilder = new EzyZoneSettingBuilder().name(ZONE_NAME).plugin(pluginSettingBuilder.build());
EzySimpleSettings settings = new EzySettingsBuilder().zone(zoneSettingBuilder.build()).build();
EzyEmbeddedServer server = EzyEmbeddedServer.builder().settings(settings).build();
server.start();
}
use of com.tvd12.ezyfoxserver.setting.EzySimpleSettings in project ezyfox-server by youngmonkeys.
the class EzyServerBootstrapTest method test.
@SuppressWarnings("rawtypes")
@Test
public void test() throws Exception {
EzyServerBootstrap bt = new MyTestServerBootstrapBuilder().server(newServer()).build();
bt.destroy();
assert MethodInvoker.create().object(bt).method("getServer").invoke() != null;
assert MethodInvoker.create().object(bt).method("getServerSettings").invoke() != null;
assert MethodInvoker.create().object(bt).method("getHttpSetting").invoke() != null;
assert MethodInvoker.create().object(bt).method("getSocketSetting").invoke() != null;
assert MethodInvoker.create().object(bt).method("getWebSocketSetting").invoke() != null;
EzyServerBootstrap bootstrap = new EzyServerBootstrap() {
@Override
protected void startOtherBootstraps(Runnable callback) {
callback.run();
}
};
EzyServerContext serverContext = mock(EzyServerContext.class);
EzySimpleServer server = new EzySimpleServer();
EzySimpleConfig config = new EzySimpleConfig();
server.setConfig(config);
when(serverContext.getServer()).thenReturn(server);
EzySimpleSettings settings = new EzySimpleSettings();
server.setSettings(settings);
EzySessionManager sessionManager = new ExEzySimpleSessionManager.Builder().objectFactory(() -> spy(EzyAbstractSession.class)).build();
server.setSessionManager(sessionManager);
EzyBootstrap localBootstrap = EzyBootstrap.builder().context(serverContext).build();
bootstrap.setContext(serverContext);
bootstrap.setLocalBootstrap(localBootstrap);
bootstrap.start();
}
use of com.tvd12.ezyfoxserver.setting.EzySimpleSettings in project ezyfox-server by youngmonkeys.
the class EzySettingsReaderTest method test.
@Test
public void test() throws Exception {
JAXBContext jaxbContext = JAXBContext.newInstance("com.tvd12.ezyfoxserver", getClass().getClassLoader());
Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
EzySimpleSettings settings = jaxbUnmarshaller.unmarshal(new StreamSource(inputStream()), EzySimpleSettings.class).getValue();
System.out.println(settings);
}
Aggregations