Package lv.odylab.evemanage.client.rpc.action

Examples of lv.odylab.evemanage.client.rpc.action.ActionRunner


    @Override
    public <T extends Response> T execute(Action<T> action) throws Exception {
        RunnedBy runnedBy = action.getClass().getAnnotation(RunnedBy.class);
        Class<? extends ActionRunner> clazz = runnedBy.value();
        ActionRunner actionRunner = injector.getInstance(clazz);

        User user = appEngineServices.getUserService().getCurrentUser();
        String userNickname = "anonymous";
        if (user != null) {
            userNickname = user.getNickname();
        }
        String ipAddress = getThreadLocalRequest().getRemoteAddr();
        String className = action.getClass().getSimpleName();
        logger.info("User {} (ip: {}) executing action: {}", new Object[]{userNickname, ipAddress, className});

        try {
            return (T) actionRunner.execute(action);
        } catch (Exception e) {
            logger.error("Caught Exception", e);
            throw new RpcException(e.getMessage());
        }
    }
View Full Code Here

TOP

Related Classes of lv.odylab.evemanage.client.rpc.action.ActionRunner

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.