Package org.apache.cxf.buslifecycle

Examples of org.apache.cxf.buslifecycle.BusLifeCycleManager


        }
        return instance;
    }

    protected void initializeBus(Bus bus) {
        BusLifeCycleManager lifeCycleManager = bus.getExtension(BusLifeCycleManager.class);
        if (null != lifeCycleManager) {
            lifeCycleManager.initComplete();
        }
    }
View Full Code Here


    @PostConstruct    
    public void register() {   
        if (null != bus) {
            bus.setExtension(this, InstrumentationManager.class);
            BusLifeCycleManager blcm = bus.getExtension(BusLifeCycleManager.class);
            if (null != blcm) {
                blcm.registerLifeCycleListener(this);
            }   
        }
    }
View Full Code Here

            l.busCreated(this);
        }
       
        doInitializeInternal();
       
        BusLifeCycleManager lifeCycleManager = this.getExtension(BusLifeCycleManager.class);
        if (null != lifeCycleManager) {
            lifeCycleManager.initComplete();
        }   
        setState(BusState.RUNNING);
    }
View Full Code Here

   
    public void shutdown(boolean wait) {
        if (state == BusState.SHUTTING_DOWN) {
            return;
        }
        BusLifeCycleManager lifeCycleManager = this.getExtension(BusLifeCycleManager.class);
        if (null != lifeCycleManager) {
            lifeCycleManager.preShutdown();
        }
        synchronized (this) {
            state = BusState.SHUTTING_DOWN;
        }
        destroyBeans();
        synchronized (this) {
            state = BusState.SHUTDOWN;
            notifyAll();
        }
        if (null != lifeCycleManager) {
            lifeCycleManager.postShutdown();
        }

        if (BusFactory.getDefaultBus(false) == this) {
            BusFactory.setDefaultBus(null);
        }
View Full Code Here

                                 extensions,
                                 resourceManager);
       
        setState(BusState.INITIAL);
       
        BusLifeCycleManager lifeCycleManager = this.getExtension(BusLifeCycleManager.class);
        if (null != lifeCycleManager) {
            lifeCycleManager.initComplete();
           
        }

        DestinationFactoryManager dfm = this.getExtension(DestinationFactoryManager.class);
        if (null == dfm) {
View Full Code Here

        ((CXFBusImpl)bus).initialize();
        super.initializeBus(bus);
    }

    void registerApplicationContextLifeCycleListener(Bus bus, BusApplicationContext bac) {
        BusLifeCycleManager lm = bus.getExtension(BusLifeCycleManager.class);
        if (null != lm) {
            lm.registerLifeCycleListener(new BusApplicationContextLifeCycleListener(bac));
        }
    }
View Full Code Here

            throw new RuntimeException(ex);
        }
    }

    void registerApplicationContextLifeCycleListener(Bus bus, BusApplicationContext bac) {
        BusLifeCycleManager lm = bus.getExtension(BusLifeCycleManager.class);
        if (null != lm) {
            lm.registerLifeCycleListener(new BusApplicationContextLifeCycleListener(bac));
        }
    }
View Full Code Here

            l.busCreated(this);
        }
       
        doInitializeInternal();
       
        BusLifeCycleManager lifeCycleManager = this.getExtension(BusLifeCycleManager.class);
        if (null != lifeCycleManager) {
            lifeCycleManager.initComplete();
        }   
        setState(BusState.RUNNING);
    }
View Full Code Here

   
    public void shutdown(boolean wait) {
        if (state == BusState.SHUTTING_DOWN) {
            return;
        }
        BusLifeCycleManager lifeCycleManager = this.getExtension(BusLifeCycleManager.class);
        if (null != lifeCycleManager) {
            lifeCycleManager.preShutdown();
        }
        synchronized (this) {
            state = BusState.SHUTTING_DOWN;
        }
        destroyBeans();
        synchronized (this) {
            state = BusState.SHUTDOWN;
            notifyAll();
        }
        if (null != lifeCycleManager) {
            lifeCycleManager.postShutdown();
        }

        if (BusFactory.getDefaultBus(false) == this) {
            BusFactory.setDefaultBus(null);
        }
View Full Code Here

    }
   
    @Test
    public void testShutdownWithBusLifecycle() {
        final CXFBusImpl bus = new ExtensionManagerBus();
        BusLifeCycleManager lifeCycleManager = bus.getExtension(BusLifeCycleManager.class);
        BusLifeCycleListener listener = EasyMock.createMock(BusLifeCycleListener.class);
        EasyMock.reset(listener);
        listener.preShutdown();
        EasyMock.expectLastCall();
        listener.postShutdown();
        EasyMock.expectLastCall();       
        EasyMock.replay(listener);       
        lifeCycleManager.registerLifeCycleListener(listener);
        bus.shutdown(true);
        EasyMock.verify(listener);
       
    }
View Full Code Here

TOP

Related Classes of org.apache.cxf.buslifecycle.BusLifeCycleManager

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.