Package org.apache.activemq.util

Examples of org.apache.activemq.util.ServiceStopper


    protected void tearDown() throws Exception {
      for (int i=0; i < WORKER_COUNT; i++) {
        workers[i].stop();
      }
        new ServiceStopper().stop(bs);
    }
View Full Code Here


        if (connections != null) {
            for (int i = 0;i < connections.length;i++) {
                connections[i].close();
            }
        }
        ServiceStopper stopper = new ServiceStopper();
        stopper.stopServices(services);
    }
View Full Code Here

        if (connections != null) {
            for (int i = 0;i < connections.length;i++) {
                connections[i].close();
            }
        }
        ServiceStopper stopper = new ServiceStopper();
        stopper.stopServices(services);
    }
View Full Code Here

    @Override
    public void stop() throws Exception {
        started = false;
        this.scheduler.cancel(purgeInactiveDestinationsTask);
        ServiceStopper ss = new ServiceStopper();
        doStop(ss);
        ss.throwFirstException();
        // clear the state
        clientIdSet.clear();
        connections.clear();
        destinations.clear();
        brokerInfos.clear();
View Full Code Here

        }
    }

    public void stop() throws Exception {
        synchronized (reconnectMutex) {
          ServiceStopper ss = new ServiceStopper();
         
            if (!started)
                return;
            started = false;
            disposed = true;

            for (Iterator iter = transports.iterator(); iter.hasNext();) {
                FanoutTransportHandler th = (FanoutTransportHandler) iter.next();
                if( th.transport != null ) {
                  ss.stop(th.transport);
                }
            }
           
            log.debug("Stopped: "+this);
            ss.throwFirstException();
        }
        reconnectTask.shutdown();
    }
View Full Code Here

       
        log.info("Connector "+getName()+" Started");
    }

    public void stop() throws Exception {
        ServiceStopper ss = new ServiceStopper();
        if( discoveryAgent!=null ) {
            ss.stop(discoveryAgent);
        }
        if (server != null) {
            ss.stop(server);
        }
        if (this.statusDector != null){
            this.statusDector.stop();
        }
       
        for (Iterator iter = connections.iterator(); iter.hasNext();) {
            TransportConnection c = (TransportConnection) iter.next();
            ss.stop(c);
        }
        ss.throwFirstException();
        log.info("Connector "+getName()+" Stopped");
    }
View Full Code Here

            localBroker.setTransportListener(null);
            remoteBroker.setTransportListener(null);
            localBroker.oneway(new ShutdownInfo());
            remoteBroker.oneway(new ShutdownInfo());
        } finally {
            ServiceStopper ss = new ServiceStopper();
            ss.stop(localBroker);
            ss.stop(remoteBroker);
            ss.throwFirstException();
        }
    }
View Full Code Here

        log.info("ActiveMQ Message Broker (" + getBrokerName()+", "+brokerId+") is shutting down");
        BrokerRegistry.getInstance().unbind(getBrokerName());
       
        removeShutdownHook();

        ServiceStopper stopper = new ServiceStopper();
       
        if (services != null) {
            for (int i = 0; i < services.length; i++) {
                Service service = services[i];
                stopper.stop(service);
            }
        }
       
        stopAllConnectors(stopper);

       
        //remove any VMTransports connected
        VMTransportFactory.stopped(getBrokerName());


        stopper.stop(persistenceAdapter);

        if (broker != null) {
            stopper.stop(broker);
        }
        if(tempDataStore!=null){
            tempDataStore.close();
        }

        if (isUseJmx()) {
            MBeanServer mbeanServer = getManagementContext().getMBeanServer();
            if (mbeanServer != null) {
                for (Iterator iter = registeredMBeanNames.iterator(); iter.hasNext();) {
                    ObjectName name = (ObjectName) iter.next();
                    try {
                        mbeanServer.unregisterMBean(name);
                    }
                    catch (Exception e) {
                        stopper.onException(mbeanServer, e);
                    }
                }
            }
            stopper.stop(getManagementContext());
        }

        log.info("ActiveMQ JMS Message Broker (" + getBrokerName()+", "+brokerId+") stopped");

        stopper.throwFirstException();
    }
View Full Code Here

        discoveryAgent.start();
        next.start();
    }

    public void stop() throws Exception {
      ServiceStopper ss = new ServiceStopper();
      ss.stop(discoveryAgent);
      ss.stop(next);
      ss.throwFirstException();
    }
View Full Code Here

        }
        catch (IOException e) {
            log.debug("Caught exception stopping", e);
        }
        finally {
            ServiceStopper ss = new ServiceStopper();
            ss.stop(localBroker);
            ss.stop(remoteBroker);
            ss.throwFirstException();
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.activemq.util.ServiceStopper

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.