use of com.tvd12.ezyfoxserver.setting.EzyPluginSetting in project ezyfox-server-example by tvd12.
the class PluginEntry method setupBeanContext.
@Override
protected void setupBeanContext(EzyPluginContext context, EzyBeanContextBuilder builder) {
EzyPluginSetting setting = context.getPlugin().getSetting();
String pluginConfigFile = getConfigFile(setting);
PluginConfig pluginConfig = readPluginConfig(pluginConfigFile);
logger.info("simple-chat plugin config: {}", pluginConfig);
}
use of com.tvd12.ezyfoxserver.setting.EzyPluginSetting in project ezyfox-server by youngmonkeys.
the class EzyPluginInfoController method handle.
@Override
public void handle(EzyServerContext ctx, EzyPluginInfoRequest request) {
EzyUser user = request.getUser();
EzySession session = request.getSession();
EzyPluginInfoParams params = request.getParams();
EzyZoneContext zoneCtx = ctx.getZoneContext(user.getZoneId());
EzyPluginContext pluginCtx = zoneCtx.getPluginContext(params.getPluginName());
if (pluginCtx != null) {
EzyPluginSetting setting = pluginCtx.getPlugin().getSetting();
EzyResponse response = newPluginInfoResponse(setting);
ctx.send(response, session, false);
}
}
use of com.tvd12.ezyfoxserver.setting.EzyPluginSetting in project ezyfox-server by youngmonkeys.
the class EzyBroadcastPluginsEventImpl method getPluginContextMaps.
private EzyMapSet<EzyConstant, EzyPluginContext> getPluginContextMaps() {
Collection<EzyPluginContext> pluginContexts = context.getPluginContexts();
EzyMapSet<EzyConstant, EzyPluginContext> pluginContextMaps = new EzyHashMapSet<>();
for (EzyPluginContext pluginContext : pluginContexts) {
EzyPluginSetting pluginSetting = pluginContext.getPlugin().getSetting();
Set<EzyConstant> listenEvents = pluginSetting.getListenEvents().getEvents();
for (EzyConstant listenEvent : listenEvents) {
pluginContextMaps.addItem(listenEvent, pluginContext);
}
}
return pluginContextMaps;
}
use of com.tvd12.ezyfoxserver.setting.EzyPluginSetting 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.setting.EzyPluginSetting in project ezyfox-server by youngmonkeys.
the class EzyPluginSendResponseImpl method newResponse.
protected EzyResponse newResponse(EzyData data) {
EzyPluginSetting setting = context.getPlugin().getSetting();
EzyRequestPluginResponseParams params = newResponseParams();
params.setPluginId(setting.getId());
params.setData(data);
return new EzyRequestPluginResponse(params);
}
Aggregations