Package org.codehaus.xfire.handler

Examples of org.codehaus.xfire.handler.HandlerPipeline


    {
        ServiceBean service = (ServiceBean) getContext().getBean("firstBeforeSecond");
        AbstractHandler testHandler = (AbstractHandler) getContext().getBean("firstHandler");
        AbstractHandler testHandler2 = (AbstractHandler) getContext().getBean("secondHandler");

        HandlerPipeline pipeline = new HandlerPipeline(getXFire().getInPhases());
        pipeline.addHandlers(service.getInHandlers());

        List inHandlers = pipeline.getPhaseHandlers(Phase.USER).getHandlers();
        int firstPos = inHandlers.indexOf(testHandler);
        int secondPos = inHandlers.indexOf(testHandler2);
        assertTrue(firstPos != -1);
        assertTrue(secondPos != -1);
        assertTrue(firstPos < secondPos);
View Full Code Here


    {
        ServiceBean service = (ServiceBean) getContext().getBean("firstAfterSecond");
        AbstractHandler testHandler = (AbstractHandler) getContext().getBean("firstHandler2");
        AbstractHandler testHandler2 = (AbstractHandler) getContext().getBean("secondHandler2");

        HandlerPipeline pipeline = new HandlerPipeline(getXFire().getInPhases());
        pipeline.addHandlers(service.getInHandlers());

        List inHandlers = pipeline.getPhaseHandlers(Phase.USER).getHandlers();
        int firstPos = inHandlers.indexOf(testHandler);
        int secondPos = inHandlers.indexOf(testHandler2);
        assertTrue(firstPos != -1);
        assertTrue(secondPos != -1);
        assertTrue(firstPos > secondPos);
View Full Code Here

          //the Client object in the context is not necessary "this" (client.onReceive())
          // we need to invoke the handlers from the client in the context not "this"
          // was creating issues when used in multi-threaded
          Client contextClient = context.getClient();
         
            HandlerPipeline inPipe = new HandlerPipeline(contextClient.getXFire().getInPhases());
            inPipe.addHandlers(contextClient.getInHandlers());
            inPipe.addHandlers(contextClient.getTransport().getInHandlers());
            context.setInPipeline(inPipe);
           
            inPipe.invoke(context);
        }
        catch (Exception e1)
        {
            XFireFault fault = XFireFault.createFault(e1);
           
            AbstractMessage faultMsg = context.getExchange().getFaultMessage();
            faultMsg.setBody(fault);
           
            context.setCurrentMessage(faultMsg);
           
            HandlerPipeline inPipe = new HandlerPipeline(getXFire().getInPhases());
            inPipe.addHandlers(getFaultHandlers());
            inPipe.addHandlers(getTransport().getFaultHandlers());
            context.setInPipeline(inPipe);
           
            try
            {
                inPipe.invoke(context);
            }
            catch (Exception e)
            {
                if (e instanceof XFireRuntimeException)
                    throw (XFireRuntimeException) e;
View Full Code Here

            MessageExchange exchange = new MessageExchange(context);
            exchange.setOperation(op);
            exchange.setOutMessage(msg);
            context.setCurrentMessage(msg);
           
            HandlerPipeline outPipe = new HandlerPipeline(client.getXFire().getOutPhases());
            outPipe.addHandlers(client.getXFire().getOutHandlers());
            outPipe.addHandlers(client.getOutHandlers());
            outPipe.addHandlers(client.getTransport().getOutHandlers());
           
            context.setOutPipeline(outPipe);

            ServiceInvocationHandler.writeHeaders(context, null);
           
            outPipe.invoke(context);
        }
        catch (Exception e1)
        {
            throw XFireFault.createFault(e1);
        }
View Full Code Here

            exchange.setInMessage(msg);
            context.setCurrentMessage(msg);
        }
       
        // Create the handlerpipeline and invoke it
        HandlerPipeline pipeline = new HandlerPipeline(context.getXFire().getInPhases());
        pipeline.addHandlers(context.getXFire().getInHandlers());
        pipeline.addHandlers(msg.getChannel().getTransport().getInHandlers());
        pipeline.addHandlers(getInHandlers());
       
        if (context.getService() != null)
        {
            pipeline.addHandlers(context.getService().getInHandlers());
            context.setProperty(SERVICE_HANDLERS_REGISTERED, Boolean.TRUE);
        }
       
        context.setInPipeline(pipeline);
       
        if (context.getFaultHandler() == null)
            context.setFaultHandler(createFaultHandler());
       
        try
        {
            pipeline.invoke(context);
           
            // finishReadingMessage(msg, context);
        }
        catch (Exception e)
        {
            XFireFault fault = XFireFault.createFault(e);
            context.setProperty(DefaultFaultHandler.EXCEPTION, fault);

            pipeline.handleFault(fault, context);
           
            try
            {
                context.getFaultHandler().invoke(context);
            }
View Full Code Here

TOP

Related Classes of org.codehaus.xfire.handler.HandlerPipeline

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.