Search in sources :

Example 1 with EzyCommandsAware

use of com.tvd12.ezyfoxserver.support.controller.EzyCommandsAware in project ezyfox-server by youngmonkeys.

the class EzySimplePluginEntry method setPluginRequestController.

private void setPluginRequestController(EzyPluginContext pluginContext, EzyBeanContext beanContext) {
    if (!allowRequest() || getClass().isAnnotationPresent(EzyDisallowRequest.class)) {
        return;
    }
    EzyPluginSetup setup = pluginContext.get(EzyPluginSetup.class);
    EzyPluginRequestController controller = newUserRequestController(beanContext);
    setup.setRequestController(controller);
    Set<String> commands = ((EzyCommandsAware) controller).getCommands();
    pluginContext.setProperty(COMMANDS, commands);
}
Also used : EzyPluginSetup(com.tvd12.ezyfoxserver.command.EzyPluginSetup) EzyCommandsAware(com.tvd12.ezyfoxserver.support.controller.EzyCommandsAware) EzyPluginRequestController(com.tvd12.ezyfoxserver.plugin.EzyPluginRequestController) EzyDisallowRequest(com.tvd12.ezyfoxserver.support.annotation.EzyDisallowRequest)

Example 2 with EzyCommandsAware

use of com.tvd12.ezyfoxserver.support.controller.EzyCommandsAware in project ezyfox-server by youngmonkeys.

the class EzySimpleAppEntry method setAppRequestController.

private void setAppRequestController(EzyAppContext appContext, EzyBeanContext beanContext) {
    EzyAppSetup setup = appContext.get(EzyAppSetup.class);
    EzyAppRequestController controller = newUserRequestController(beanContext);
    setup.setRequestController(controller);
    Set<String> commands = ((EzyCommandsAware) controller).getCommands();
    appContext.setProperty(COMMANDS, commands);
}
Also used : EzyCommandsAware(com.tvd12.ezyfoxserver.support.controller.EzyCommandsAware) EzyAppSetup(com.tvd12.ezyfoxserver.command.EzyAppSetup) EzyAppRequestController(com.tvd12.ezyfoxserver.app.EzyAppRequestController)

Aggregations

EzyCommandsAware (com.tvd12.ezyfoxserver.support.controller.EzyCommandsAware)2 EzyAppRequestController (com.tvd12.ezyfoxserver.app.EzyAppRequestController)1 EzyAppSetup (com.tvd12.ezyfoxserver.command.EzyAppSetup)1 EzyPluginSetup (com.tvd12.ezyfoxserver.command.EzyPluginSetup)1 EzyPluginRequestController (com.tvd12.ezyfoxserver.plugin.EzyPluginRequestController)1 EzyDisallowRequest (com.tvd12.ezyfoxserver.support.annotation.EzyDisallowRequest)1