當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。