本文整理汇总了Java中org.apache.activemq.util.ServiceStopper类的典型用法代码示例。如果您正苦于以下问题:Java ServiceStopper类的具体用法?Java ServiceStopper怎么用?Java ServiceStopper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ServiceStopper类属于org.apache.activemq.util包,在下文中一共展示了ServiceStopper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: doStop
import org.apache.activemq.util.ServiceStopper; //导入依赖的package包/类
@Override
protected synchronized void doStop(ServiceStopper stopper) throws Exception {
for (JobSchedulerImpl js : this.schedulers.values()) {
js.stop();
}
if (this.pageFile != null) {
this.pageFile.unload();
}
if (this.journal != null) {
journal.close();
}
if (this.lockFile != null) {
this.lockFile.unlock();
}
this.lockFile = null;
LOG.info(this + " stopped");
}
示例4: stop
import org.apache.activemq.util.ServiceStopper; //导入依赖的package包/类
public void stop() throws Exception {
if (stopped.compareAndSet(false, true)) {
stopping.set(true);
ServiceStopper stopper = new ServiceStopper();
try {
doStop(stopper);
} catch (Exception e) {
stopper.onException(this, e);
}
stopped.set(true);
started.set(false);
stopping.set(false);
stopper.throwFirstException();
}
CountDownLatch countDownLatch = stoppedLatch.get();
if (countDownLatch != null && Thread.currentThread() != this.runnerThread) {
countDownLatch.await(1, TimeUnit.SECONDS);
}
}
示例5: 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();
}
示例6: 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());
}
示例7: stop
import org.apache.activemq.util.ServiceStopper; //导入依赖的package包/类
@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();
}
示例8: postStop
import org.apache.activemq.util.ServiceStopper; //导入依赖的package包/类
@Override
public void postStop(ServiceStopper stopper) throws Exception {
if (useLock) {
if (keepAliveTicket != null) {
keepAliveTicket.cancel(false);
keepAliveTicket = null;
}
if (locker != null) {
getLocker().stop();
}
ThreadPoolUtils.shutdown(clockDaemon);
}
}
示例9: doStop
import org.apache.activemq.util.ServiceStopper; //导入依赖的package包/类
protected void doStop(ServiceStopper stopper) throws Exception {
try {
if (selection != null) {
selection.close();
}
} finally {
super.doStop(stopper);
}
}
示例10: 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();
}
}
示例11: 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();
}
示例12: doStop
import org.apache.activemq.util.ServiceStopper; //导入依赖的package包/类
@Override
protected void doStop(ServiceStopper stopper) throws Exception {
Server temp = server;
server = null;
if (temp != null) {
temp.stop();
}
}
示例13: doStop
import org.apache.activemq.util.ServiceStopper; //导入依赖的package包/类
@Override
protected void doStop(ServiceStopper stopper) throws Exception {
super.doStop(stopper);
if (serverSocket != null) {
serverSocket.close();
}
}
示例14: doStop
import org.apache.activemq.util.ServiceStopper; //导入依赖的package包/类
@Override
protected void doStop(ServiceStopper stopper) throws Exception {
if (httpMethod != null) {
// In some versions of the JVM a race between the httpMethod and the completion
// of the method when using HTTPS can lead to a deadlock. This hack attempts to
// detect that and interrupt the thread that's locked so that they can complete
// on another attempt.
for (int i = 0; i < 3; ++i) {
Thread abortThread = new Thread(new Runnable() {
@Override
public void run() {
try {
httpMethod.abort();
} catch (Exception e) {
}
}
});
abortThread.start();
abortThread.join(2000);
if (abortThread.isAlive() && !httpMethod.isAborted()) {
abortThread.interrupt();
}
}
}
}
示例15: doStop
import org.apache.activemq.util.ServiceStopper; //导入依赖的package包/类
protected void doStop(ServiceStopper stopper) throws Exception {
super.doStop(stopper);
if (socket != null) {
try {
socket.leaveGroup(getMulticastAddress());
} catch (IOException e) {
stopper.onException(this, e);
}
socket.close();
}
}