Package org.apache.axis2.engine

Examples of org.apache.axis2.engine.Handler


  public static String getExecutionChainString(ArrayList executionChain) {
    Iterator iter = executionChain.iterator();

    String executionChainStr = "";
    while (iter.hasNext()) {
      Handler handler = (Handler) iter.next();
      QName name = handler.getName();
      String handlerStr = SandeshaUtil.getStringFromQName(name);
      executionChainStr = executionChainStr + Sandesha2Constants.EXECUTIN_CHAIN_SEPERATOR + handlerStr;
    }

    return executionChainStr;
View Full Code Here


  public static String getExecutionChainString(ArrayList<Handler> executionChain) {
    Iterator<Handler> iter = executionChain.iterator();

    String executionChainStr = "";
    while (iter.hasNext()) {
      Handler handler = (Handler) iter.next();
      String name = handler.getName();
      executionChainStr = executionChainStr + Sandesha2Constants.EXECUTIN_CHAIN_SEPERATOR + name;
    }

    return executionChainStr;
  }
View Full Code Here

    List<Handler> executionChain = message.getExecutionChain();
    ArrayList<Handler> retransmittablePhases = new ArrayList<Handler>();
   
    int executionChainLength = executionChain.size();
    for(int i=0;i<executionChainLength;i++){
      Handler handler = executionChain.get(i);
      if("Security".equals(handler.getName())){
        retransmittablePhases.add(handler);
      }
    }
    executionChain.removeAll(retransmittablePhases);
       
View Full Code Here

      if (p.getName().equalsIgnoreCase("Addressing")) {

        List<Handler> handlers = p.getHandlers();

        for (Iterator<Handler> ite = handlers.iterator(); ite.hasNext();) {
          Handler h = ite.next();
          if (h.getClass()
              .isAssignableFrom(StoreMessageHandler.class)) {
            p.removeHandler(h.getHandlerDesc());
            break;
          }
        }

        p.addHandler(new StoreMessageHandler(), 0);
View Full Code Here

        PhaseData phaseData = new PhaseData(phase.getPhaseName());
        phaseData.setIsGlobalPhase(isGlobalPhase);
        HandlerData[] handlers = new HandlerData[phase.getHandlerCount()];

        // populate the phase handlers
        Handler handler;
        if (invert) {
            for (int i = phase.getHandlers().size() - 1, j = 0; i >= 0; i--, j++) {
                handler = phase.getHandlers().get(i);
                handlers[j] = getHandlerData(handler);
            }
View Full Code Here

                        handlers = new String[phase.getHandlerCount()];

                        List hands = phase.getHandlers();

                        for (int j = 0; j < hands.size(); j++) {
                            Handler handler = (Handler) hands.get(j);
                            handlers[j] = handler.getName();
                        }
                    }
                }

                break;
            }

            case PhaseMetadata.OUT_FLOW: {
                ArrayList inflow = op.getPhasesOutFlow();

                for (Object anInflow : inflow) {
                    Phase phase = (Phase) anInflow;

                    if (phase.getPhaseName().equals(phaseName)) {
                        handlers = new String[phase.getHandlerCount()];

                        List hands = phase.getHandlers();

                        for (int j = 0; j < hands.size(); j++) {
                            Handler handler = (Handler) hands.get(j);
                            handlers[j] = handler.getName();
                        }
                    }
                }

                break;
            }

            case PhaseMetadata.FAULT_IN_FLOW: {
                ArrayList inflow = op.getPhasesInFaultFlow();

                for (Object anInflow : inflow) {
                    Phase phase = (Phase) anInflow;

                    if (phase.getPhaseName().equals(phaseName)) {
                        handlers = new String[phase.getHandlerCount()];

                        List hands = phase.getHandlers();

                        for (int j = 0; j < hands.size(); j++) {
                            Handler handler = (Handler) hands.get(j);
                            handlers[j] = handler.getName();
                        }
                    }
                }

                break;
            }

            case PhaseMetadata.FAULT_OUT_FLOW: {
                ArrayList inflow = op.getPhasesOutFaultFlow();

                for (Object anInflow : inflow) {
                    Phase phase = (Phase) anInflow;

                    if (phase.getPhaseName().equals(phaseName)) {
                        handlers = new String[phase.getHandlerCount()];

                        List hands = phase.getHandlers();

                        for (int j = 0; j < hands.size(); j++) {
                            Handler handler = (Handler) hands.get(j);
                            handlers[j] = handler.getName();
                        }
                    }
                }

                break;
View Full Code Here

            map = new LinkedHashMap<String, Handler>();
        }

        Iterator<Handler> it = list.iterator();
        while (it.hasNext()) {
            Handler handler = (Handler) it.next();

            String key = null;
            if (handler != null) {
                key = handler.getClass().getName() + "@" + handler.hashCode();
            }

            if (handler instanceof Phase) {
                // add its handlers to the list
                flattenHandlerList(((Phase) handler).getHandlers(), map);
            } else {
                // if the same object is already in the list,
                // then it won't be in the list multiple times
                map.put(key, handler);
            }
        }

        if (DEBUG_ENABLED && log.isTraceEnabled()) {
            Iterator<String> it2 = map.keySet().iterator();
            while (it2.hasNext()) {
                Object key = it2.next();
                Handler value = (Handler) map.get(key);
                String name = value.getName();
                log.trace(getLogIDString() + ":flattenPhaseListToHandlers():  key [" + key +
                        "]    handler name [" + name + "]");
            }
        }
View Full Code Here

            map = new LinkedHashMap<String, Handler>();
        }

        Iterator<Handler> it = list.iterator();
        while (it.hasNext()) {
            Handler handler = (Handler) it.next();

            String key = null;
            if (handler != null) {
                key = handler.getClass().getName() + "@" + handler.hashCode();
            }

            if (handler instanceof Phase) {
                // put the phase in the list
                map.put(key, handler);
View Full Code Here

        ArrayList<SelfManagedDataHolder> selfManagedDataHolderList = new ArrayList<SelfManagedDataHolder>();
        Iterator<Handler> it = handlers.iterator();

        try {
            while (it.hasNext()) {
                Handler handler = (Handler) it.next();

                //if (handler instanceof Phase)
                //{
                //    selfManagedDataHolderList = serializeSelfManagedDataHelper(((Phase)handler).getHandlers().iterator(), selfManagedDataHolderList);
                //}
                //else if (SelfManagedDataManager.class.isAssignableFrom(handler.getClass()))
                if (SelfManagedDataManager.class.isAssignableFrom(handler.getClass())) {
                    // only call the handler's serializeSelfManagedData if it implements SelfManagedDataManager

                    if (DEBUG_ENABLED && log.isTraceEnabled()) {
                        log.trace(
                                "MessageContext:serializeSelfManagedDataHelper(): calling handler  [" +
                                        handler.getClass().getName() + "]  name [" +
                                        handler.getName() + "]   serializeSelfManagedData method");
                    }

                    ByteArrayOutputStream baos_fromHandler =
                            ((SelfManagedDataManager) handler).serializeSelfManagedData(this);

                    if (baos_fromHandler != null) {
                        baos_fromHandler.close();

                        try {
                            SelfManagedDataHolder selfManagedDataHolder = new SelfManagedDataHolder(
                                    handler.getClass().getName(), handler.getName(),
                                    baos_fromHandler.toByteArray());
                            selfManagedDataHolderList.add(selfManagedDataHolder);
                            selfManagedDataHandlerCount++;
                        }
                        catch (Exception exc) {
                            if (DEBUG_ENABLED && log.isTraceEnabled()) {
                                log.trace("MessageContext:serializeSelfManagedData(): exception [" +
                                    exc.getClass().getName() + "][" + exc.getMessage() +
                                    "]  in setting up SelfManagedDataHolder object for [" +
                                    handler.getClass().getName() + " / " + handler.getName() + "] ",
                                      exc);
                            }
                        }
                    }
                }
View Full Code Here

                                                                            String qNameAsString) {
        SelfManagedDataManager handler_toreturn = null;

        try {
            while ((it.hasNext()) && (handler_toreturn == null)) {
                Handler handler = (Handler) it.next();

                if (handler instanceof Phase) {
                    handler_toreturn = deserialize_getHandlerFromExecutionChain(
                            ((Phase) handler).getHandlers().iterator(), classname, qNameAsString);
                } else if ((handler.getClass().getName().equals(classname))
                        && (handler.getName().equals(qNameAsString))) {
                    handler_toreturn = (SelfManagedDataManager) handler;
                }
            }
            return handler_toreturn;
        }
View Full Code Here

TOP

Related Classes of org.apache.axis2.engine.Handler

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.