use of com.tvd12.ezyfoxserver.ext.EzyAppEntryLoader in project ezyfox-server by youngmonkeys.
the class EzyAppsStarter method newAppEntryLoader.
protected EzyAppEntryLoader newAppEntryLoader(String appName) throws Exception {
Class<EzyAppEntryLoader> entryLoaderClass = getAppEntryLoaderClass(appName);
EzyAppSetting appSetting = getAppByName(appName);
if (appSetting.getEntryLoaderArgs() == null) {
return entryLoaderClass.newInstance();
}
return (EzyAppEntryLoader) entryLoaderClass.getConstructors()[0].newInstance(appSetting.getEntryLoaderArgs());
}
use of com.tvd12.ezyfoxserver.ext.EzyAppEntryLoader in project ezyfox-server by youngmonkeys.
the class EzyAppsStarter method startApp.
protected EzyAppEntry startApp(String appName, EzyAppEntryLoader loader) throws Exception {
EzyAppEntry entry = loader.load();
entry.config(getAppContext(appName));
entry.start();
return entry;
}
use of com.tvd12.ezyfoxserver.ext.EzyAppEntryLoader in project ezyfox-server by youngmonkeys.
the class EzyAppsStarterTest method test1.
@Test
public void test1() {
Map<String, ClassLoader> loaders = new ConcurrentHashMap<>();
EzyAppsStarter starter = new EzyAppsStarter.Builder() {
@Override
public EzyAppsStarter build() {
return new EzyAppsStarter(this) {
public EzyAppEntryLoader newAppEntryLoader(String appName) {
throw new RuntimeException();
}
public java.util.Set<String> getAppNames() {
return Sets.newHashSet("test");
}
};
}
}.zoneContext(EzyZoneContextsTest.newDefaultZoneContext()).appClassLoaders(loaders).build();
starter.start();
}
Aggregations