Package org.apache.axis2.phaseresolver

Examples of org.apache.axis2.phaseresolver.PhaseException


        for (int i = 0; i < handlers.size(); i++) {
            Handler temphandler = (Handler) handlers.get(i);

            if (temphandler.getName().equals(afterName)) {
                if (phaselastset && (i == handlers.size() - 1)) {
                    throw new PhaseException("Can't insert handler after handler '"
                            + temphandler.getName()
                            + "', which is marked phaseLast");
                }

                handlers.add(i + 1, handler);
View Full Code Here


            Handler temphandler = (Handler) handlers.get(i);

            if (temphandler.getName().equals(beforename)) {
                if (i == 0) {
                    if (phasefirstset) {
                        throw new PhaseException("Can't insert handler before handler '"
                                + temphandler.getName()
                                + "', which is marked phaseFirst");
                    }
                }
                beforeHandlerIndex = i;
View Full Code Here

        // no point of continue since both the before and after index has found
        if (after > before) {

            // TODO fix me Deepal , (have to check this)
            throw new PhaseException("incorrect handler order for "
                    + handler.getHandlerDesc().getName());
        }

        if ((before == -1) && (after == -1)) {
            addHandler(handler);

            return;
        }

        if (before == -1) {
            addHandler(handler);

            return;
        }

        if (after == -1) {
            if (phasefirstset && (before == 0)) {
                throw new PhaseException("Can't insert handler before handler '"
                        + ((Handler) handlers.get(0)).getName()
                        + "', which is marked phaseFirst");
            }
        }
View Full Code Here

        String afterRules = rules.getAfter();
        if ((!"".equals(beforeRules))
                && (!"".equals(afterRules))) {
            if (beforeRules.equals(
                    afterRules)) {
                throw new PhaseException(
                        "Both before and after cannot be the same for this handler"
                                + handler.getName());
            }

            return BOTH_BEFORE_AFTER;
View Full Code Here

     * @param phaseFirst
     * @throws PhaseException
     */
    public void setPhaseFirst(Handler phaseFirst) throws PhaseException {
        if (phasefirstset) {
            throw new PhaseException("PhaseFirst has been set already, cannot have two"
                    + " phaseFirst Handler for same phase " + this.getPhaseName());
        } else {
            handlers.add(0, phaseFirst);
            phasefirstset = true;

            // TODO: move this error check to where we read the rules
            if (getBeforeAfter(phaseFirst) != ANYWHERE) {
                throw new PhaseException("Handler with PhaseFirst can not have "
                        + "any before or after proprty error in "
                        + phaseFirst.getName());
            }
        }
    }
View Full Code Here

     * @param phaseLast
     * @throws PhaseException
     */
    public void setPhaseLast(Handler phaseLast) throws PhaseException {
        if (phaselastset) {
            throw new PhaseException("PhaseLast already has been set,"
                    + " cannot have two PhaseLast Handler for same phase "
                    + this.getPhaseName());
        }

        if (handlers.size() == 0) {
            handlers.add(phaseLast);
        } else {
            handlers.add(handlers.size() - 1, phaseLast);
        }

        phaselastset = true;

        // TODO: Move this check to where we read the rules
        if (getBeforeAfter(phaseLast) != ANYWHERE) {
            throw new PhaseException("Handler with PhaseLast property "
                    + "can not have any before or after property error in "
                    + phaseLast.getName());
        }
    }
View Full Code Here

                return;
            }
        }

        if (isOneHandler) {
            throw new PhaseException("Phase '" + this.getPhaseName()
                    + "' can only have one handler, since there is a "
                    + "handler with both phaseFirst and phaseLast true ");
        }

        if (handlerDesc.getRules().isPhaseFirst() && handlerDesc.getRules().isPhaseLast()) {
            if (!handlers.isEmpty()) {
                throw new PhaseException(this.getPhaseName()
                        + " already contains Handlers, and "
                        + handlerDesc.getName()
                        + " cannot therefore be both phaseFirst and phaseLast.");
            } else {
                handlers.add(handlerDesc.getHandler());
View Full Code Here

                }
            }
        }

        if ((beforeIndex > -1) && (afterIndex >= beforeIndex)) {
            throw new PhaseException("Can't insert handler because " + beforeName + " is before " +
                    afterName + " in Phase '" + phaseName + "'");
        }

        if (phaseFirstSet && beforeIndex == 0) {
            throw new PhaseException("Can't insert handler before handler '"
                    + beforeName
                    + "', which is marked phaseFirst");
        }

        if (phaseLastSet && afterIndex == (handlers.size() - 1)) {
            throw new PhaseException("Can't insert handler after handler '"
                    + afterName
                    + "', which is marked phaseLast");
        }

        if (beforeIndex > -1) {
View Full Code Here

     * @param handler the Handler to add
     * @throws PhaseException if another Handler is already set as phaseFirst
     */
    public void setPhaseFirst(Handler handler) throws PhaseException {
        if (phaseFirstSet) {
            throw new PhaseException("PhaseFirst has been set already, cannot have two"
                    + " phaseFirst Handlers for Phase '" + this.getPhaseName() + "'");
        }
        handlers.add(0, handler);
        phaseFirstSet = true;
    }
View Full Code Here

     * @param handler the Handler to add
     * @throws PhaseException if another Handler is already set as phaseLast
     */
    public void setPhaseLast(Handler handler) throws PhaseException {
        if (phaseLastSet) {
            throw new PhaseException("PhaseLast already has been set,"
                    + " cannot have two PhaseLast Handler for same phase "
                    + this.getPhaseName());
        }

        handlers.add(handler);
View Full Code Here

TOP

Related Classes of org.apache.axis2.phaseresolver.PhaseException

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.