当前位置: 首页>>代码示例>>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;未经允许,请勿转载。