Package org.objectweb.celtix.bus.jaxws.configuration.types

Examples of org.objectweb.celtix.bus.jaxws.configuration.types.SystemHandlerChainType


        }
        return busCfg;
    }

    private void configureHandlers(Configuration config, boolean isServer) {
        SystemHandlerChainType systemHandlers = config.getObject(SystemHandlerChainType.class,
                                                                 "systemHandlerChain");       

        org.objectweb.celtix.bus.jaxws.configuration.types.ObjectFactory factory
            = new org.objectweb.celtix.bus.jaxws.configuration.types.ObjectFactory();
       
        HandlerChainType handlerChain = null;
        HandlerType handler = null;
       
        if (null == systemHandlers) {
            systemHandlers = factory.createSystemHandlerChainType();

            boolean withRM = true;
           
            // pre-logical

            handlerChain = factory.createHandlerChainType();           
            handler = factory.createHandlerType();
            handler.setHandlerClass(MAPAggregator.class.getName());
            handler.setHandlerName("logical addressing handler");
            handlerChain.getHandler().add(handler);
            if (withRM) {
                handler = factory.createHandlerType();
                handler.setHandlerClass(RMHandler.class.getName());
                handler.setHandlerName("logical rm handler");
                handlerChain.getHandler().add(handler);
            }
            if (!isServer) {
                handler = factory.createHandlerType();
                handler.setHandlerClass(LogicalMessageContextRecorder.class.getName());
                handler.setHandlerName("logical message context recorder");
                handlerChain.getHandler().add(handler);
            }

            systemHandlers.setPreLogical(handlerChain);

            // post-protocol
           
            handlerChain = factory.createHandlerChainType();
            if (withRM) {
                handler = factory.createHandlerType();
                handler.setHandlerClass(RMSoapHandler.class.getName());
                handler.setHandlerName("protocol rm handler");
                handlerChain.getHandler().add(handler);
            }
          
            handler = factory.createHandlerType();
            handler.setHandlerClass(MAPCodec.class.getName());
            handler.setHandlerName("protocol addressing handler");
            handlerChain.getHandler().add(handler);
           
            boolean persist = true;
            if (persist) {
                handler = factory.createHandlerType();
                handler.setHandlerClass(RMPersistenceHandler.class.getName());
                handler.setHandlerName("protocol rm persistence handler");
                handlerChain.getHandler().add(handler);
            }

            systemHandlers.setPostProtocol(handlerChain);

            config.setObject("systemHandlerChain", systemHandlers);
        }
       
        handlerChain = config.getObject(HandlerChainType.class, "handlerChain");
View Full Code Here


     * Configure the system handlers specified in configuration
     *
     */
    public void configureSystemHandlers(Configuration c) {
        HandlerChainBuilder builder = new HandlerChainBuilder();
        SystemHandlerChainType sh =
            (SystemHandlerChainType)c.getObject(SYSTEM_HANDLER_CHAIN_PROPERTY_NAME);
        if (null != sh) {
            preLogicalSystemHandlers = builder.buildHandlerChainFromConfiguration(sh.getPreLogical());
            postLogicalSystemHandlers = builder.buildHandlerChainFromConfiguration(sh.getPostLogical());
            preProtocolSystemHandlers = builder.buildHandlerChainFromConfiguration(sh.getPreProtocol());
            postProtocolSystemHandlers = builder.buildHandlerChainFromConfiguration(sh.getPostProtocol());
        }       
    }
View Full Code Here

    }
   
    public void testConfigureSystemHandlers() {
        IMocksControl control = EasyMock.createControl();
        TestBinding b = new TestBinding();
        SystemHandlerChainType shc = null;
        Configuration c = control.createMock(Configuration.class);
        expect(c.getObject("systemHandlerChain")).andReturn(shc);
        control.replay();
       
        b.configureSystemHandlers(c);
View Full Code Here

    }
   
    public void testInjectSystemHandlers() {
        IMocksControl control = EasyMock.createControl();
        TestBinding b = new TestBinding();
        SystemHandlerChainType shc = createSystemHandlerChain();
        Configuration c = control.createMock(Configuration.class);
        expect(c.getObject("systemHandlerChain")).andReturn(shc);
        ResourceInjector ri = control.createMock(ResourceInjector.class);
        ri.inject(EasyMock.isA(SystemHandler.class));
        EasyMock.expectLastCall().times(6);
View Full Code Here

        control.verify();
    }
   
   
    private SystemHandlerChainType createSystemHandlerChain() {
        SystemHandlerChainType shc = new ObjectFactory().createSystemHandlerChainType();
        HandlerChainType hc = new ObjectFactory().createHandlerChainType();
        List<HandlerType> handlers = hc.getHandler();
        HandlerType h = new ObjectFactory().createHandlerType();
        h.setHandlerName("lhs1");
        h.setHandlerClass(TestLogicalSystemHandler.class.getName());
        handlers.add(h);
        h = new ObjectFactory().createHandlerType();
        h.setHandlerName("lhs2");
        h.setHandlerClass(TestLogicalSystemHandler.class.getName());
        handlers.add(h);
        shc.setPreLogical(hc);
       
        hc = new ObjectFactory().createHandlerChainType();
        handlers = hc.getHandler();
        h = new ObjectFactory().createHandlerType();
        h.setHandlerName("lhs3");
        h.setHandlerClass(TestLogicalSystemHandler.class.getName());
        handlers.add(h);
        shc.setPostLogical(hc);
       
        hc = new ObjectFactory().createHandlerChainType();
        handlers = hc.getHandler();
        h = new ObjectFactory().createHandlerType();
        h.setHandlerName("phs1");
        h.setHandlerClass(TestProtocolSystemHandler.class.getName());
        handlers.add(h);
        shc.setPreProtocol(hc);
       
        hc = new ObjectFactory().createHandlerChainType();
        handlers = hc.getHandler();
        h = new ObjectFactory().createHandlerType();
        h.setHandlerName("phs2");
        h.setHandlerClass(TestProtocolSystemHandler.class.getName());
        handlers.add(h);
        h = new ObjectFactory().createHandlerType();
        h.setHandlerName("phs3");
        h.setHandlerClass(TestProtocolSystemHandler.class.getName());
        handlers.add(h);
        shc.setPostProtocol(hc);
       
        return shc;
    }
View Full Code Here

TOP

Related Classes of org.objectweb.celtix.bus.jaxws.configuration.types.SystemHandlerChainType

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.