Package org.apache.axis2.phaseresolver

Examples of org.apache.axis2.phaseresolver.PhaseException


     * @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

            if (handler
                    .getHandlerDesc()
                    .getRules()
                    .getBefore()
                    .equals(handler.getHandlerDesc().getRules().getAfter())) {
                throw new PhaseException("Both before and after cannot be the same for this handler"
                        + handler.getName());
            }
            return BOTH_BEFORE_AFTER;
        } else if (!handler.getHandlerDesc().getRules().getBefore().equals("")) {
            return BEFORE;
View Full Code Here

     * @param phaseFirst
     * @throws PhaseException
     */
    public void setPhaseFirst(Handler phaseFirst) throws PhaseException {
        if (phasefirstset) {
            throw new PhaseException("PhaseFirst alredy has been set, cannot have two" +
                    " phaseFirst Handler for same phase "
                    + this.getPhaseName());
        } else {
            if (getBeforeAfter(phaseFirst) != ANYWHERE) {
                throw new PhaseException("Handler with PhaseFirst can not have " +
                        "any before or after proprty error in "
                        + phaseFirst.getName());
            } else {
                this.phaseFirst = phaseFirst;
            }
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());
        } else {
            if (getBeforeAfter(phaseLast) != ANYWHERE) {
                throw new PhaseException("Handler with PhaseLast property " +
                        "can not have any before or after property error in "
                        + phaseLast.getName());
            } else {
                this.phaseLast = phaseLast;
            }
View Full Code Here

                //to add hndlers into gloal chain
                return;
            }
        }
        if (isOneHanlder) {
            throw new PhaseException(
                    this.getPhaseName()
                            + "can only have one handler, since there is a "
                            + "handler with both phaseFirst and PhaseLast true ");
        } else {
            if (handler.getRules().isPhaseFirst() &&
                    handler.getRules().isPhaseLast()) {
                if (handlers.size() > 0) {
                    throw new PhaseException(
                            this.getPhaseName()
                                    + " can not have more than one handler "
                                    + handler.getName()
                                    + " is invalid or incorrect phase rules");
                } else {
View Full Code Here

        if (phaseFirst != null) {
            String phasFirstname = phaseFirst.getHandlerDesc().getName()
                    .getLocalPart();
            if (handler.getHandlerDesc().getRules().getBefore().equals(
                    phasFirstname)) {
                throw new PhaseException("Trying to insert  a Handler "
                        + handler.getName()
                        + " before phaseFirst "
                        + phasFirstname);
            }
        }
View Full Code Here

    private void validateafter(Handler handler) throws PhaseException {
        if (phaseLast != null) {
            String phaseLastName = phaseLast.getHandlerDesc().getName()
                    .getLocalPart();
            if (handler.getName().equals(phaseLastName)) {
                throw new PhaseException("Try to insert a Handler "
                        + handler.getName()
                        + " after phaseLast "
                        + phaseLastName);
            }
        }
View Full Code Here

            }
            if ((after >= 0) && (before >= 0)) {
                // 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());
                } else {
                    if (after + 1 <= handlers.size()) {
                        handlers.add(after + 1, handler);
View Full Code Here

                return;
            }
        }
        if (isOneHandler) {
            // TODO : should we allow both phaseFirst and phaseLast to be true for one Handler??
            throw new PhaseException(this.getPhaseName()
                    + "can only have one handler, since there is a "
                    + "handler with both phaseFirst and PhaseLast true ");
        }

        if (handler.getRules().isPhaseFirst() && handler.getRules().isPhaseLast()) {
            if (handlers.size() > 0) {
                throw new PhaseException(this.getPhaseName()
                        + " can not have more than one handler "
                        + handler.getName()
                        + " is invalid or incorrect phase rules");
            } else {
                handlers.add(handler.getHandler());
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.