Package com.gwtplatform.dispatch.server.actionhandlervalidator

Examples of com.gwtplatform.dispatch.server.actionhandlervalidator.ActionHandlerValidatorInstance


        }
    }

    private <A extends Action<R>, R extends Result> ActionValidator findActionValidator(A action) throws
            UnsupportedActionException {
        ActionHandlerValidatorInstance handlerValidator =
                actionHandlerValidatorRegistry.findActionHandlerValidator(action);
        if (handlerValidator == null) {
            throw new UnsupportedActionException(action);
        }

        return handlerValidator.getActionValidator();
    }
View Full Code Here


    }

    @SuppressWarnings("unchecked")
    private <A extends Action<R>, R extends Result> ActionHandler<A, R> findHandler(A action)
            throws UnsupportedActionException {
        ActionHandlerValidatorInstance handlerValidator =
                actionHandlerValidatorRegistry.findActionHandlerValidator(action);

        if (handlerValidator == null) {
            throw new UnsupportedActionException(action);
        }

        return (ActionHandler<A, R>) handlerValidator.getActionHandler();
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    @Override
    public <A extends Action<R>, R extends Result> ActionHandlerValidatorInstance findActionHandlerValidator(
            A action) {

        ActionHandlerValidatorInstance actionHandlerValidatorInstance = actionHandlerValidatorInstances.get(action
                .getClass());

        if (actionHandlerValidatorInstance == null) {
            ActionHandlerValidatorClass<? extends Action<?>, ? extends Result> actionHandlerValidatorClass =
                    actionHandlerValidatorClasses.get(action.getClass());
View Full Code Here

        ActionHandlerValidatorClass<?, ?> oldActionHandlerValidatorClass = actionHandlerValidatorClasses.get(
                actionClass);

        if (oldActionHandlerValidatorClass == actionHandlerValidatorClass) {
            actionHandlerValidatorClasses.remove(actionClass);
            ActionHandlerValidatorInstance instance = actionHandlerValidatorInstances.remove(actionClass);

            if (!containValidator(instance.getActionValidator())) {
                validators.remove(instance.getActionValidator().getClass());
            }
        }
    }
View Full Code Here

    }

    private ActionHandlerValidatorInstance createInstance(
            ActionHandlerValidatorClass<? extends Action<?>, ? extends Result> actionHandlerValidatorClass) {

        ActionHandlerValidatorInstance actionHandlerValidatorInstance = null;
        ActionValidator actionValidator = findActionValidator(actionHandlerValidatorClass.getActionValidatorClass());

        if (actionValidator == null) {
            actionValidator = injector.getInstance(actionHandlerValidatorClass.getActionValidatorClass());

            actionHandlerValidatorInstance = new ActionHandlerValidatorInstance(
                    actionValidator,
                    injector.getInstance(actionHandlerValidatorClass.getActionHandlerClass()));

            validators.put(actionValidator.getClass(), actionValidator);
        } else {
            actionHandlerValidatorInstance = new ActionHandlerValidatorInstance(
                    actionValidator,
                    injector.getInstance(actionHandlerValidatorClass.getActionHandlerClass()));
        }

        if (actionHandlerValidatorInstance.getActionHandler() == null
                || actionHandlerValidatorInstance.getActionValidator() == null) {
            return null;
        }

        return actionHandlerValidatorInstance;
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    @Override
    public <A extends Action<R>, R extends Result> ActionHandlerValidatorInstance findActionHandlerValidator(A action) {

        ActionHandlerValidatorInstance actionHandlerValidatorInstance = actionHandlerValidatorInstances.get(action
                .getClass());

        if (actionHandlerValidatorInstance == null) {
            ActionHandlerValidatorClass<? extends Action<?>, ? extends Result> actionHandlerValidatorClass =
                    actionHandlerValidatorClasses.get(action
View Full Code Here

        ActionHandlerValidatorClass<?, ?> oldActionHandlerValidatorClass = actionHandlerValidatorClasses.get(
                actionClass);

        if (oldActionHandlerValidatorClass == actionHandlerValidatorClass) {
            actionHandlerValidatorClasses.remove(actionClass);
            ActionHandlerValidatorInstance instance = actionHandlerValidatorInstances.remove(actionClass);

            if (!containValidator(instance.getActionValidator())) {
                validators.remove(instance.getActionValidator().getClass());
            }
        }
    }
View Full Code Here

    }

    private ActionHandlerValidatorInstance createInstance(ActionHandlerValidatorClass<? extends Action<?>,
            ? extends Result> actionHandlerValidatorClass) {

        ActionHandlerValidatorInstance actionHandlerValidatorInstance = null;
        ActionValidator actionValidator = findActionValidator(actionHandlerValidatorClass.getActionValidatorClass());

        ActionHandler<?, ?> actionHandler = SpringUtils.getInstance(applicationContext,
                actionHandlerValidatorClass.getActionHandlerClass());

        if (actionValidator == null) {
            actionValidator = SpringUtils.getInstance(applicationContext,
                    actionHandlerValidatorClass.getActionValidatorClass());
            actionHandlerValidatorInstance = new ActionHandlerValidatorInstance(actionValidator, actionHandler);

            validators.put(actionValidator.getClass(), actionValidator);
        } else {
            actionHandlerValidatorInstance = new ActionHandlerValidatorInstance(actionValidator, actionHandler);
        }

        if (actionHandlerValidatorInstance.getActionHandler() == null
                || actionHandlerValidatorInstance.getActionValidator() == null) {
            return null;
        }

        return actionHandlerValidatorInstance;
    }
View Full Code Here

TOP

Related Classes of com.gwtplatform.dispatch.server.actionhandlervalidator.ActionHandlerValidatorInstance

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.