当前位置: 首页>>代码示例>>Java>>正文


Java ServiceStopper.stop方法代码示例

本文整理汇总了Java中org.apache.activemq.util.ServiceStopper.stop方法的典型用法代码示例。如果您正苦于以下问题:Java ServiceStopper.stop方法的具体用法?Java ServiceStopper.stop怎么用?Java ServiceStopper.stop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.activemq.util.ServiceStopper的用法示例。


在下文中一共展示了ServiceStopper.stop方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: stop

import org.apache.activemq.util.ServiceStopper; //导入方法依赖的package包/类
public void stop() throws Exception {
    try {
        if (connectionInfo != null) {
            localBroker.request(connectionInfo.createRemoveCommand());
            remoteBroker.request(connectionInfo.createRemoveCommand());
        }
        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();
    }
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:18,代码来源:ForwardingBridge.java

示例2: stop

import org.apache.activemq.util.ServiceStopper; //导入方法依赖的package包/类
@Override
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 (TransportConnection connection : connections) {
        ss.stop(connection);
    }
    server = null;
    ss.throwFirstException();
    LOG.info("Connector {} stopped", getName());
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:21,代码来源:TransportConnector.java

示例3: stop

import org.apache.activemq.util.ServiceStopper; //导入方法依赖的package包/类
public void stop() throws Exception {
    if (!running.compareAndSet(true, false)) {
        return;
    }
    shuttingDown.set(true);
    ServiceStopper ss = new ServiceStopper();
    ss.stop(localTransport);
    ss.stop(remoteTransport);
    ss.throwFirstException();
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:11,代码来源:ProxyConnection.java

示例4: stop

import org.apache.activemq.util.ServiceStopper; //导入方法依赖的package包/类
public void stop() throws Exception {
    ServiceStopper ss = new ServiceStopper();
    if (this.server != null) {
        ss.stop(this.server);
    }
    for (Iterator<ProxyConnection> iter = connections.iterator(); iter.hasNext();) {
        LOG.info("Connector stopped: Stopping proxy.");
        ss.stop(iter.next());
    }
    ss.throwFirstException();
    LOG.info("Proxy Connector {} stopped", getName());
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:13,代码来源:ProxyConnector.java

示例5: stop

import org.apache.activemq.util.ServiceStopper; //导入方法依赖的package包/类
public void stop() throws Exception {
    try {
        synchronized (reconnectMutex) {
            ServiceStopper ss = new ServiceStopper();

            if (!started) {
                return;
            }
            started = false;
            disposed = true;
            connected=false;

            for (Iterator<FanoutTransportHandler> iter = transports.iterator(); iter.hasNext();) {
                FanoutTransportHandler th = iter.next();
                if (th.transport != null) {
                    ss.stop(th.transport);
                }
            }

            LOG.debug("Stopped: " + this);
            ss.throwFirstException();
        }
    } finally {
        reconnectTask.shutdown();
        reconnectTaskFactory.shutdownNow();
    }
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:28,代码来源:FanoutTransport.java

示例6: stop

import org.apache.activemq.util.ServiceStopper; //导入方法依赖的package包/类
@Override
public void stop() throws Exception {
    ServiceStopper ss = new ServiceStopper();
    ss.stop(discoveryAgent);
    ss.stop(next);
    ss.throwFirstException();
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:8,代码来源:DiscoveryTransport.java

示例7: stop

import org.apache.activemq.util.ServiceStopper; //导入方法依赖的package包/类
@Override
public void stop() throws Exception {
    if (started.compareAndSet(true, false)) {
        if (disposed.compareAndSet(false, true)) {
            LOG.debug(" stopping {} bridge to {}", configuration.getBrokerName(), remoteBrokerName);

            futureRemoteBrokerInfo.cancel(true);
            futureLocalBrokerInfo.cancel(true);

            NetworkBridgeListener l = this.networkBridgeListener;
            if (l != null) {
                l.onStop(this);
            }
            try {
                // local start complete
                if (startedLatch.getCount() < 2) {
                    LOG.trace("{} unregister bridge ({}) to {}", new Object[]{
                            configuration.getBrokerName(), this, remoteBrokerName
                    });
                    brokerService.getBroker().removeBroker(null, remoteBrokerInfo);
                    brokerService.getBroker().networkBridgeStopped(remoteBrokerInfo);
                }

                remoteBridgeStarted.set(false);
                final CountDownLatch sendShutdown = new CountDownLatch(1);

                brokerService.getTaskRunnerFactory().execute(new Runnable() {
                    @Override
                    public void run() {
                        try {
                            serialExecutor.shutdown();
                            if (!serialExecutor.awaitTermination(5, TimeUnit.SECONDS)) {
                                List<Runnable> pendingTasks = serialExecutor.shutdownNow();
                                    LOG.info("pending tasks on stop {}", pendingTasks);
                            }
                            localBroker.oneway(new ShutdownInfo());
                            remoteBroker.oneway(new ShutdownInfo());
                        } catch (Throwable e) {
                            LOG.debug("Caught exception sending shutdown", e);
                        } finally {
                            sendShutdown.countDown();
                        }

                    }
                }, "ActiveMQ ForwardingBridge StopTask");

                if (!sendShutdown.await(10, TimeUnit.SECONDS)) {
                    LOG.info("Network Could not shutdown in a timely manner");
                }
            } finally {
                ServiceStopper ss = new ServiceStopper();
                ss.stop(remoteBroker);
                ss.stop(localBroker);
                ss.stop(duplexInboundLocalBroker);
                // Release the started Latch since another thread could be
                // stuck waiting for it to start up.
                startedLatch.countDown();
                startedLatch.countDown();
                localStartedLatch.countDown();

                ss.throwFirstException();
            }
        }

        LOG.info("{} bridge to {} stopped", configuration.getBrokerName(), remoteBrokerName);
    }
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:68,代码来源:DemandForwardingBridgeSupport.java

示例8: doStop

import org.apache.activemq.util.ServiceStopper; //导入方法依赖的package包/类
protected void doStop(ServiceStopper ss) {
    ss.stop(queueRegion);
    ss.stop(topicRegion);
    ss.stop(tempQueueRegion);
    ss.stop(tempTopicRegion);
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:7,代码来源:RegionBroker.java

示例9: doStop

import org.apache.activemq.util.ServiceStopper; //导入方法依赖的package包/类
@Override
protected void doStop(ServiceStopper stopper) throws Exception {
    for (PersistenceAdapter persistenceAdapter : adapters) {
        stopper.stop(persistenceAdapter);
    }
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:7,代码来源:MultiKahaDBPersistenceAdapter.java


注:本文中的org.apache.activemq.util.ServiceStopper.stop方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。