Package org.apache.cxf.buslifecycle

Examples of org.apache.cxf.buslifecycle.BusLifeCycleManager


   
    @Test
    public void testForLifeCycle() {
        BusLifeCycleListener bl = EasyMock.createMock(BusLifeCycleListener.class);
        Bus bus = new SpringBusFactory().createBus();
        BusLifeCycleManager lifeCycleManager = bus.getExtension(BusLifeCycleManager.class);
        lifeCycleManager.registerLifeCycleListener(bl);
        EasyMock.reset(bl);
        bl.preShutdown();
        EasyMock.expectLastCall();
        bl.postShutdown();
        EasyMock.expectLastCall();
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 testForLifeCycle() {
        BusLifeCycleListener bl = EasyMock.createMock(BusLifeCycleListener.class);
        Bus bus = new SpringBusFactory().createBus();
        BusLifeCycleManager lifeCycleManager = bus.getExtension(BusLifeCycleManager.class);
        lifeCycleManager.registerLifeCycleListener(bl);
       
        bl.preShutdown();
        EasyMock.expectLastCall();
        bl.postShutdown();
        EasyMock.expectLastCall();
View Full Code Here

    public void shutdown() {
        shutdown(true);
    }

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

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

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

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

       
        if (doIt) {
            if (event instanceof ContextRefreshedEvent) {
                Bus bus = (Bus)ctx.getBean("cxf");
                ((CXFBusImpl)bus).initialize();
                BusLifeCycleManager lcm = (BusLifeCycleManager)
                    ctx.getBean("org.apache.cxf.buslifecycle.BusLifeCycleManager",
                            BusLifeCycleManager.class);
                lcm.initComplete();
            } else if (event instanceof ContextClosedEvent && ctx.isActive()) {
                // To avoid the ctx to be closed twice
                BusLifeCycleManager lcm = (BusLifeCycleManager)ctx
                    .getBean("org.apache.cxf.buslifecycle.BusLifeCycleManager", BusLifeCycleManager.class);
                lcm.postShutdown();

            }
        }
    }
View Full Code Here

            }
        }
    }
    private synchronized void addBusListener() {
        if (listener == null && bus != null) {
            BusLifeCycleManager blcm = bus.getExtension(BusLifeCycleManager.class);
            if (blcm != null) {
                listener = new JMSBusLifeCycleListener(this,
                                                       blcm);
            }
        }
View Full Code Here

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

    public void shutdown() {
        shutdown(true);
    }

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

        if (BusFactory.getDefaultBus(false) == this) {
            BusFactory.setDefaultBus(null);
        }
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.