本文整理汇总了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();
}
}
示例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());
}
示例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();
}
示例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());
}
示例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();
}
}
示例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();
}
示例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);
}
}
示例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);
}
示例9: doStop
import org.apache.activemq.util.ServiceStopper; //导入方法依赖的package包/类
@Override
protected void doStop(ServiceStopper stopper) throws Exception {
for (PersistenceAdapter persistenceAdapter : adapters) {
stopper.stop(persistenceAdapter);
}
}