當前位置: 首頁>>代碼示例>>Java>>正文


Java ServiceStopper類代碼示例

本文整理匯總了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();
    }
}
 
開發者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: 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");
}
 
開發者ID:DiamondLightSource,項目名稱:daq-eclipse,代碼行數:18,代碼來源:JobSchedulerStoreImpl.java

示例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);
    }
}
 
開發者ID:apache,項目名稱:activemq-openwire,代碼行數:21,代碼來源:TcpTransport.java

示例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();
}
 
開發者ID:DiamondLightSource,項目名稱:daq-eclipse,代碼行數:11,代碼來源:ProxyConnection.java

示例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());
}
 
開發者ID:DiamondLightSource,項目名稱:daq-eclipse,代碼行數:13,代碼來源:ProxyConnector.java

示例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();
}
 
開發者ID:DiamondLightSource,項目名稱:daq-eclipse,代碼行數:14,代碼來源:RegionBroker.java

示例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);
    }
}
 
開發者ID:DiamondLightSource,項目名稱:daq-eclipse,代碼行數:14,代碼來源:LockableServiceSupport.java

示例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);
    }
}
 
開發者ID:DiamondLightSource,項目名稱:daq-eclipse,代碼行數:10,代碼來源:StompNIOTransport.java

示例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();
    }
}
 
開發者ID:DiamondLightSource,項目名稱:daq-eclipse,代碼行數:28,代碼來源:FanoutTransport.java

示例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();
}
 
開發者ID:DiamondLightSource,項目名稱:daq-eclipse,代碼行數:8,代碼來源:DiscoveryTransport.java

示例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();
    }
}
 
開發者ID:DiamondLightSource,項目名稱:daq-eclipse,代碼行數:9,代碼來源:WSTransportServer.java

示例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();
    }
}
 
開發者ID:DiamondLightSource,項目名稱:daq-eclipse,代碼行數:8,代碼來源:TcpTransportServer.java

示例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();
            }
        }
    }
}
 
開發者ID:DiamondLightSource,項目名稱:daq-eclipse,代碼行數:28,代碼來源:HttpClientTransport.java

示例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();
    }
}
 
開發者ID:DiamondLightSource,項目名稱:daq-eclipse,代碼行數:12,代碼來源:MulticastTransport.java


注:本文中的org.apache.activemq.util.ServiceStopper類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。