Package org.codehaus.xfire.handler

Examples of org.codehaus.xfire.handler.AbstractHandler


        assertNotNull(service.getInHandlers());
    }
   
    public void testPhasePropertyOfHandlers() throws Exception
    {
        AbstractHandler unchangedHandler = (AbstractHandler) getContext().getBean("addressingHandler");
        assertEquals("pre-dispatch",unchangedHandler.getPhase());
       
        AbstractHandler handler = (AbstractHandler) getContext().getBean("changedPhaseHandler");
        assertEquals("pre-invoke",handler.getPhase());
       
    }
View Full Code Here


    }
   
    public void testHandlerOrderingBefore() throws Exception
    {
        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();
View Full Code Here

    }

    public void testHandlerOrderingAfter() throws Exception
    {
        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();
View Full Code Here

        File f = getTestFile("src/test/org/codehaus/xfire/attachments/echo11.xml");
        FileDataSource fs = new FileDataSource(f);

        final DataHandler dh = new DataHandler(fs);
       
        client.addOutHandler(new AbstractHandler() {

            public void invoke(MessageContext context)
                throws Exception
            {
                Attachments atts = new JavaMailAttachments();
                atts.addPart(new SimpleAttachment("test.jpg", dh));
                context.getOutMessage().setAttachments(atts);
            }
        });
       
        client.addInHandler(new AbstractHandler() {

            public void invoke(MessageContext context)
                throws Exception
            {
                Attachments atts = context.getInMessage().getAttachments();
View Full Code Here

            if(!(handler instanceof AbstractHandler )){
                String msg ="Handler "+ handler.getClass().getName()+" is not instance of AbstractHandler!";
                log.error(msg);
                throw new RuntimeException(msg);
            }
            AbstractHandler aHandler = (AbstractHandler) handler;
            for( Iterator iter = before.iterator(); iter.hasNext();){
                aHandler.before((String)iter.next());
            }
        }
        if (after!= null)
        {
            if(!(handler instanceof AbstractHandler )){
                String msg = "Handler "+ handler.getClass().getName()+" is not instance of AbstractHandler!";
                log.error(msg);
                throw new RuntimeException(msg);
            }
            AbstractHandler aHandler = (AbstractHandler) handler;
            for( Iterator iter = after.iterator(); iter.hasNext();){
                aHandler.after((String)iter.next());
            }
        }

    }
View Full Code Here

TOP

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

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.