Package javax.xml.rpc.handler

Examples of javax.xml.rpc.handler.HandlerChain


        SEIFactory seiFactory = (SEIFactory) portNameToSEIFactoryMap.get(portName);
        if (seiFactory == null) {
            return null;
        }
        HandlerChain handlerChain = seiFactory.createHandlerChain();
        return handlerChain;

    }
View Full Code Here


            throw new ServiceException("Could not construct service instance", e.getTargetException());
        }
    }

    public HandlerChain createHandlerChain() {
        HandlerChain handlerChain = handlerInfoChainFactory.createHandlerChain();
        return handlerChain;
    }
View Full Code Here

        SEIFactory seiFactory = (SEIFactory) portNameToSEIFactoryMap.get(portName);
        if (seiFactory == null) {
            return null;
        }
        HandlerChain handlerChain = seiFactory.createHandlerChain();
        return handlerChain;

    }
View Full Code Here

    }


    private void initHandlerChain(QName portName, HandlerRegistry handlerRegistry,
            HandlerInfo handlerInfo, ArrayList<String> soaprolesToAdd) {
        HandlerChain handlerChain = (HandlerChain) handlerRegistry.getHandlerChain(portName);
        @SuppressWarnings("unchecked") // Can't change the API
        Iterator<Handler> iter = handlerChain.iterator();
        while (iter.hasNext()) {
            Handler handler = iter.next();
            handler.init(handlerInfo);
        }
        String[] soaprolesRegistered = handlerChain.getRoles();
        String [] soaproles = new String[soaprolesRegistered.length + soaprolesToAdd.size()];
        int i;
        for (i = 0;i < soaprolesRegistered.length; i++)
            soaproles[i] = soaprolesRegistered[i];
        for (int j = 0; j < soaprolesToAdd.size(); j++)
            soaproles[i+j] = soaprolesToAdd.get(j);
        handlerChain.setRoles(soaproles);
        handlerRegistry.setHandlerChain(portName, handlerChain);
    }
View Full Code Here

        SEIFactory seiFactory = (SEIFactory) portNameToSEIFactoryMap.get(portName);
        if (seiFactory == null) {
            return null;
        }
        HandlerChain handlerChain = seiFactory.createHandlerChain();
        return handlerChain;

    }
View Full Code Here

            this.operation = operation;
        }

        @AroundInvoke
        public Object intercept(InvocationContext context) throws Exception {
            HandlerChain handlerChain = new HandlerChainImpl(handlerInfos);
            try {
                Object invocationResult = null;

                try {
                    if (handlerChain.handleRequest(messageContext)) {
                        // update arguments as handlers could change the soap msg
                        context.setParameters(getArguments());

                        invocationResult = context.proceed();

                        // update the soap msg so that handlers see invocation result
                        if (!handlerChain.isEmpty()) {
                            createResult(invocationResult);
                        }

                    } else {
                        /* The Handler implementation class has the responsibility of setting
                         * the response SOAP message in the handleRequest method and perform
                         * additional processing in the handleResponse method.
                         */
                        invocationResult = null;
                    }
                } catch (SOAPFaultException e) {
                    handlerChain.handleFault(messageContext);
                    throw e;
                }

                handlerChain.handleResponse(messageContext);

                if (!handlerChain.isEmpty()) {
                    /*
                     * Deserialize the result value from soap msg as handers could have
                     * changed it.
                     */
                    try {
                        invocationResult = demarshallResult();
                    } catch (Exception e) {
                        // if this fails, return invocationResult from above
                    }
                }

                return invocationResult;
            } finally {
                handlerChain.destroy();
            }
        }
View Full Code Here

    }


    private void initHandlerChain(QName portName, HandlerRegistry handlerRegistry,
            HandlerInfo handlerInfo, ArrayList<String> soaprolesToAdd) {
        HandlerChain handlerChain = (HandlerChain) handlerRegistry.getHandlerChain(portName);
        Iterator<Handler> iter = handlerChain.iterator();
        while (iter.hasNext()) {
            Handler handler = iter.next();
            handler.init(handlerInfo);
        }
        String[] soaprolesRegistered = handlerChain.getRoles();
        String [] soaproles = new String[soaprolesRegistered.length + soaprolesToAdd.size()];
        int i;
        for (i = 0;i < soaprolesRegistered.length; i++)
            soaproles[i] = soaprolesRegistered[i];
        for (int j = 0; j < soaprolesToAdd.size(); j++)
            soaproles[i+j] = soaprolesToAdd.get(j);
        handlerChain.setRoles(soaproles);
        handlerRegistry.setHandlerChain(portName, handlerChain);
    }
View Full Code Here

         }
      }

      boolean status = true;

      HandlerChain handlerChain = null;
      if (type == HandlerType.PRE)
         handlerChain = preHandlerChain;
      else if (type == HandlerType.ENDPOINT)
         handlerChain = jaxrpcHandlerChain;
      else if (type == HandlerType.POST)
         handlerChain = postHandlerChain;

      if (handlerChain != null)
         status = handlerChain.handleRequest(msgContext);

      return status;
   }
View Full Code Here

   public boolean callResponseHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType type)
   {
      SOAPMessageContextJAXRPC msgContext = (SOAPMessageContextJAXRPC)MessageContextAssociation.peekMessageContext();

      HandlerChain handlerChain = null;
      if (type == HandlerType.PRE)
         handlerChain = preHandlerChain;
      else if (type == HandlerType.ENDPOINT)
         handlerChain = jaxrpcHandlerChain;
      else if (type == HandlerType.POST)
         handlerChain = postHandlerChain;

      boolean status = (handlerChain != null ? handlerChain.handleResponse(msgContext) : true);

      if (type == HandlerType.ENDPOINT)
         XOPContext.visitAndRestoreXOPData();

      return status;
View Full Code Here

   public boolean callFaultHandlerChain(ServerEndpointMetaData sepMetaData, HandlerType type, Exception ex)
   {
      SOAPMessageContextJAXRPC msgContext = (SOAPMessageContextJAXRPC)MessageContextAssociation.peekMessageContext();

      HandlerChain handlerChain = null;
      if (type == HandlerType.PRE)
         handlerChain = preHandlerChain;
      else if (type == HandlerType.ENDPOINT)
         handlerChain = jaxrpcHandlerChain;
      else if (type == HandlerType.POST)
         handlerChain = postHandlerChain;

      boolean status = (handlerChain != null ? handlerChain.handleFault(msgContext) : true);

      if (type == HandlerType.ENDPOINT)
         XOPContext.visitAndRestoreXOPData();

      return status;
View Full Code Here

TOP

Related Classes of javax.xml.rpc.handler.HandlerChain

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.