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


Java TransportDisposedIOException类代码示例

本文整理汇总了Java中org.apache.activemq.transport.TransportDisposedIOException的典型用法代码示例。如果您正苦于以下问题:Java TransportDisposedIOException类的具体用法?Java TransportDisposedIOException怎么用?Java TransportDisposedIOException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: getMessageQueue

import org.apache.activemq.transport.TransportDisposedIOException; //导入依赖的package包/类
public LinkedBlockingQueue<Object> getMessageQueue() throws TransportDisposedIOException {
    LinkedBlockingQueue<Object> result = messageQueue;
    if (result == null) {
        synchronized (this) {
            result = messageQueue;
            if (result == null) {
                if (disposed.get()) {
                    throw new TransportDisposedIOException("The Transport has been disposed");
                }

                messageQueue = result = new LinkedBlockingQueue<Object>(this.asyncQueueDepth);
            }
        }
    }
    return result;
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:17,代码来源:VMTransport.java

示例2: oneway

import org.apache.activemq.transport.TransportDisposedIOException; //导入依赖的package包/类
public void oneway(Object command) throws IOException {

        if (disposed.get()) {
            throw new TransportDisposedIOException("Transport disposed.");
        }

        if (peer == null) {
            throw new IOException("Peer not connected.");
        }

        try {

            if (peer.disposed.get()) {
                throw new TransportDisposedIOException("Peer (" + peer.toString() + ") disposed.");
            }

            if (peer.async || !peer.started.get()) {
                peer.getMessageQueue().put(command);
                peer.wakeup();
                return;
            }

        } catch (InterruptedException e) {
            InterruptedIOException iioe = new InterruptedIOException(e.getMessage());
            iioe.initCause(e);
            throw iioe;
        }

        dispatch(peer, peer.messageQueue, command);
    }
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:31,代码来源:VMTransport.java

示例3: doDispatch

import org.apache.activemq.transport.TransportDisposedIOException; //导入依赖的package包/类
public void doDispatch(VMTransport transport, TransportListener transportListener, Object command) {
    if (command == DISCONNECT) {
        transportListener.onException(new TransportDisposedIOException("Peer (" + peer.toString() + ") disposed."));
    } else {
        transport.receiveCounter++;
        transportListener.onCommand(command);
    }
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:9,代码来源:VMTransport.java

示例4: iterate

import org.apache.activemq.transport.TransportDisposedIOException; //导入依赖的package包/类
/**
 * @see org.apache.activemq.thread.Task#iterate()
 */
public boolean iterate() {

    final TransportListener tl = transportListener;

    LinkedBlockingQueue<Object> mq;
    try {
        mq = getMessageQueue();
    } catch (TransportDisposedIOException e) {
        return false;
    }

    Object command = mq.poll();
    if (command != null && !disposed.get()) {
        if( command == DISCONNECT ) {
            tl.onException(new TransportDisposedIOException("Peer (" + peer.toString() + ") disposed."));
        } else {
            tl.onCommand(command);
        }
        return !mq.isEmpty() && !disposed.get();
    } else {
        if(disposed.get()) {
            mq.clear();
        }
        return false;
    }
}
 
开发者ID:DiamondLightSource,项目名称:daq-eclipse,代码行数:30,代码来源:VMTransport.java


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