use of com.tvd12.ezyfoxserver.embedded.EzyEmbeddedServer 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.embedded.EzyEmbeddedServer 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.embedded.EzyEmbeddedServer 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.embedded.EzyEmbeddedServer in project ezyfox-server by youngmonkeys.
the class EzyEmbeddedServerTest method test.
@Test
public void test() throws Exception {
EzyPluginSettingBuilder pluginSettingBuilder = new EzyPluginSettingBuilder().name("test").entryLoader(TestPluginEntryLoader.class);
EzyAppSettingBuilder appSettingBuilder = new EzyAppSettingBuilder().name("test").entryLoader(TestAppEntryLoader.class);
EzyZoneSettingBuilder zoneSettingBuilder = new EzyZoneSettingBuilder().name("test").application(appSettingBuilder.build()).plugin(pluginSettingBuilder.build());
EzySimpleUdpSetting udpSetting = new EzyUdpSettingBuilder().active(true).build();
EzySimpleSettings settings = new EzySettingsBuilder().zone(zoneSettingBuilder.build()).udp(udpSetting).build();
EzyEmbeddedServer server = EzyEmbeddedServer.builder().settings(settings).config(EzySimpleConfig.defaultConfig()).configFile("test-config/config.properties").build();
EzyServerContext serverContext = server.start();
Asserts.assertEquals(serverContext.getServer().getSettings(), settings);
Thread.sleep(2000);
server.stop();
}
use of com.tvd12.ezyfoxserver.embedded.EzyEmbeddedServer in project ezyfox-server by youngmonkeys.
the class EzyEmbeddedServerTest method startWithConfigFile.
@Test
public void startWithConfigFile() throws Exception {
EzyPluginSettingBuilder pluginSettingBuilder = new EzyPluginSettingBuilder().name("test").entryLoader(TestPluginEntryLoader.class);
EzyAppSettingBuilder appSettingBuilder = new EzyAppSettingBuilder().name("test").entryLoader(TestAppEntryLoader.class);
EzyZoneSettingBuilder zoneSettingBuilder = new EzyZoneSettingBuilder().name("test").application(appSettingBuilder.build()).plugin(pluginSettingBuilder.build());
EzySimpleSocketSetting socketSetting = new EzySocketSettingBuilder().active(// active or not, default true
false).build();
EzySimpleWebSocketSetting webSocketSetting = new EzyWebSocketSettingBuilder().active(// active or not, default true
false).build();
EzySimpleSettings settings = new EzySettingsBuilder().socket(socketSetting).websocket(webSocketSetting).zone(zoneSettingBuilder.build()).build();
EzyEmbeddedServer server = EzyEmbeddedServer.builder().settings(settings).configFile("test-config/config.properties").build();
server.start();
Thread.sleep(1000);
server.stop();
}
Aggregations