Package javax.xml.ws.handler

Examples of javax.xml.ws.handler.Handler


        // we may be starting in the middle of the list, and therefore may need to switch contexts
        switchContext(direction, i);

        if (direction == Direction.OUT) {
            for (; i <= end; i++) {
                Handler handler = (Handler) handlers.get(i);
                if (log.isDebugEnabled()) {
                    log.debug("Invoking handleFault on: " + handler.getClass().getName());
                }
                boolean success = callHandleFaultWithTracker(handler);

                if (!success)
                    break;
                switchContext(direction, i + 1);
            }
        } else { // IN case
            for (; i >= end; i--) {
                Handler handler = (Handler) handlers.get(i);
                if (log.isDebugEnabled()) {
                    log.debug("Invoking handleFault on: " + handler.getClass().getName());
                }
                boolean success = callHandleFaultWithTracker(handler);

                if (!success)
                    break;
View Full Code Here


public class GeronimoHandlerLifecycleManager implements HandlerLifecycleManager {
       
    public Handler createHandlerInstance(MessageContext context, Class handlerClass)
        throws LifecycleException, ResourceInjectionException {    
            
        Handler instance = null;
       
        try {
            instance = (Handler) handlerClass.newInstance();
        } catch (Exception e) {
            throw new LifecycleException("Failed to create handler", e);
View Full Code Here

                    logger.debug("loading handler :" + trimString(handlerInfo.handlerName));
                }
                Class<? extends Handler> handlerClass = Class.forName(
                        trimString(handlerInfo.handlerClass), true, classLoader)
                        .asSubclass(Handler.class);
                Handler handler = handlerClass.newInstance();
                if (logger.isDebugEnabled()) {
                    logger.debug("adding handler to chain: " + handler);
                }
                handlerChain.add(handler);
            } catch (Exception e) {
View Full Code Here

            try {
                Class<? extends Handler> handlerClass = loadClass(handler.getHandlerClass()).asSubclass(Handler.class);
                ClientInjectionProcessor<Handler> processor = new ClientInjectionProcessor<Handler>(handlerClass, injections, handler.getPostConstruct(), handler.getPreDestroy(), context);
                processor.createInstance();
                processor.postConstruct();
                Handler handlerInstance = processor.getInstance();

                handlers.add(handlerInstance);
                handlerInstances.add(processor);
            } catch (Exception e) {
                throw new WebServiceException("Failed to instantiate handler", e);
View Full Code Here

                        handler.getPostConstruct(),
                        handler.getPreDestroy(),
                        unwrap(context));
                processor.createInstance();
                processor.postConstruct();
                Handler handlerInstance = processor.getInstance();

                handlers.add(handlerInstance);
                handlerInstances.add(processor);
            } catch (Exception e) {
                throw new WebServiceException("Failed to instantiate handler", e);
View Full Code Here

            Class<? extends Handler> handlerClass = Class.forName(
                                                                  trimString(ht.getHandlerClass()
                                                                      .getValue()), true, classLoader)
                .asSubclass(Handler.class);

            Handler handler = handlerClass.newInstance();
            LOG.fine("adding handler to chain: " + handler);
            configureHandler(handler, ht);
            handlerChain.add(handler);
        } catch (Exception e) {
            throw new WebServiceException(BUNDLE.getString("HANDLER_INSTANTIATION_EXC"), e);
View Full Code Here

        boolean continueProcessing = true;

        try {
            int index = invokedHandlers.size() - 2;
            while (index >= 0 && continueProcessing) {
                Handler h = invokedHandlers.get(index);
                if (h instanceof LogicalHandler) {
                    continueProcessing = h.handleFault(logicalMessageContext);
                } else {
                    continueProcessing = h.handleFault(protocolMessageContext);
                }

                if (!continueProcessing) {
                    invokeReversedClose();
                    break;
View Full Code Here

     * either handleMessage or handleFault
     */
    private void invokeReversedClose() {
        int index = invokedHandlers.size() - 1;
        while (index >= 0) {
            Handler handler = invokedHandlers.get(index);
            if (handler instanceof LogicalHandler) {
                handler.close(logicalMessageContext);
            } else {
                handler.close(protocolMessageContext);
            }
            invokedHandlers.remove(index);
            index--;
        }
        closed = true;
View Full Code Here

        Iterator handlerIterator = handlers.iterator();
       
        while (handlerIterator.hasNext()) {
            // this is a safe cast since the handlerResolver and binding.setHandlerChain
            // and InvocationContext.setHandlerChain verifies it before we get here
            Handler handler = (Handler)handlerIterator.next();
            // JAXWS 9.2.1.2 sort them by Logical, then SOAP
            if (LogicalHandler.class.isAssignableFrom(handler.getClass()))
                logicalHandlers.add((LogicalHandler) handler);
            else if (SOAPHandler.class.isAssignableFrom(handler.getClass()))
                // instanceof ProtocolHandler
                protocolHandlers.add((SOAPHandler) handler);
            else if (Handler.class.isAssignableFrom(handler.getClass())) {
                throw ExceptionFactory.makeWebServiceException(Messages
                    .getMessage("handlerChainErr1", handler.getClass().getName()));
            } else {
                throw ExceptionFactory.makeWebServiceException(Messages
                    .getMessage("handlerChainErr2", handler.getClass().getName()));
            }
        }
       
        logicalLength = logicalHandlers.size();
       
View Full Code Here

        int i = start;

        if (direction == Direction.OUT) {
            for (; i <= end; i++) {
                switchContext(direction, i);
                Handler handler = (Handler) handlers.get(i);
               
                if (log.isDebugEnabled()) {
                    log.debug("Invoking handleMessage on: " + handler.getClass().getName());
                }
                handler.handleMessage(currentMC);
            }
        } else { // IN case
            for (; i >= end; i--) {
                switchContext(direction, i);
                Handler handler = (Handler) handlers.get(i);
              
                if (log.isDebugEnabled()) {
                    log.debug("Invoking handleMessage on: " + handler.getClass().getName());
                }
                handler.handleMessage(currentMC);
            }
        }
    }
View Full Code Here

TOP

Related Classes of javax.xml.ws.handler.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.