use of com.tvd12.ezyfoxserver.ext.EzyPluginEntryLoader in project ezyfox-server by youngmonkeys.
the class EzyPluginsStarter method startPlugin.
protected EzyPluginEntry startPlugin(String pluginName, EzyPluginEntryLoader loader) throws Exception {
EzyPluginEntry entry = loader.load();
entry.config(getPluginContext(pluginName));
entry.start();
return entry;
}
use of com.tvd12.ezyfoxserver.ext.EzyPluginEntryLoader in project ezyfox-server by youngmonkeys.
the class EzyPluginsStarter method newPluginEntryLoader.
protected EzyPluginEntryLoader newPluginEntryLoader(String pluginName) throws Exception {
Class<EzyPluginEntryLoader> pluginLoaderClass = getPluginEntryLoaderClass(pluginName);
EzyPluginSetting pluginSetting = getPluginByName(pluginName);
if (pluginSetting.getEntryLoaderArgs() == null) {
return pluginLoaderClass.newInstance();
}
return (EzyPluginEntryLoader) pluginLoaderClass.getConstructors()[0].newInstance(pluginSetting.getEntryLoaderArgs());
}
use of com.tvd12.ezyfoxserver.ext.EzyPluginEntryLoader in project ezyfox-server by youngmonkeys.
the class EzyPluginsStarterTest method test1.
@Test
public void test1() {
EzyPluginsStarter starter = new EzyPluginsStarter.Builder() {
@Override
public EzyPluginsStarter build() {
return new EzyPluginsStarter(this) {
public java.util.Set<String> getPluginNames() {
return Sets.newHashSet("test");
}
public EzyPluginEntryLoader newPluginEntryLoader(String pluginName) throws Exception {
throw new Exception();
}
};
}
}.zoneContext(EzyZoneContextsTest.newDefaultZoneContext()).build();
starter.start();
}
Aggregations