Package org.apache.axis2.phaseresolver

Examples of org.apache.axis2.phaseresolver.PhaseException


            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;
            }
            phasefirstset = true;
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;
            }
            phaselastset = true;
View Full Code Here

     * @param handler
     * @throws PhaseException
     */
    public void addHandler(HandlerDescription handler) throws PhaseException {
        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

                reolve.engageModuleToService(service, moduledecs);
            }
        } catch (PhaseException e) {
            throw e;
        } catch (AxisFault axisFault) {
            throw new PhaseException(axisFault);
        }
    }
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

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.