Package org.apache.activemq.transport

Examples of org.apache.activemq.transport.TransportDisposedIOException


    }
   
    public void dispatch(VMTransport transport, TransportListener transportListener, Object command) {
        if( transportListener!=null ) {
            if( command == DISCONNECT ) {
                transportListener.onException(new TransportDisposedIOException("Peer (" + peer.toString() + ") disposed."));
            } else {
                transport.receiveCounter++;
                transportListener.onCommand(command);
            }
        }
View Full Code Here


        // If stop() is called while being start()ed.. then we can't stop until we return to the start() method.
        if( enqueueValve.isOn() ) {
         
            // let the peer know that we are disconnecting..
            try {
              peer.transportListener.onException(new TransportDisposedIOException("Peer (" + peer.toString() + ") disposed."));
            } catch (Exception ignore) {
            }
         
         
            TaskRunner tr = null;
View Full Code Here

        LinkedBlockingQueue<Object> mq = getMessageQueue();
        Object command = mq.poll();
        if (command != null) {
            if( command == DISCONNECT ) {
                tl.onException(new TransportDisposedIOException("Peer (" + peer.toString() + ") disposed."));
            } else {
                tl.onCommand(command);
            }
            return !mq.isEmpty();
        } else {
View Full Code Here

        this.peer=peer;
    }

    public void oneway(Object command) throws IOException{
        if(disposed){
            throw new TransportDisposedIOException("Transport disposed.");
        }
        if(peer==null)
            throw new IOException("Peer not connected.");
        if(!peer.disposed){
          
            if(async){
               asyncOneWay(command);
            }else{
                syncOneWay(command);
            }
        }else{
            throw new TransportDisposedIOException("Peer ("+peer.toString()+") disposed.");
        }
    }
View Full Code Here

        this.peer = peer;
    }

    public void oneway(Object command) throws IOException {
        if (disposed) {
            throw new TransportDisposedIOException("Transport disposed.");
        }
        if (peer == null) {
            throw new IOException("Peer not connected.");
        }

       
        TransportListener transportListener=null;
        try {
            // Disable the peer from changing his state while we try to enqueue onto him.
            peer.enqueueValve.increment();
       
            if (peer.disposed || peer.stopping.get()) {
                throw new TransportDisposedIOException("Peer (" + peer.toString() + ") disposed.");
            }
           
            if (peer.started) {
                if (peer.async) {
                    peer.getMessageQueue().put(command);
                    peer.wakeup();
                } else {
                    transportListener = peer.transportListener;
                }
            } else {
                peer.getMessageQueue().put(command);
            }
           
        } catch (InterruptedException e) {
            throw IOExceptionSupport.create(e);
        } finally {
            // Allow the peer to change state again...
            peer.enqueueValve.decrement();
        }

        if( transportListener!=null ) {
            if( command == DISCONNECT ) {
                transportListener.onException(new TransportDisposedIOException("Peer (" + peer.toString() + ") disposed."));
            } else {
                transportListener.onCommand(command);
            }
        }
    }
View Full Code Here

        LinkedBlockingQueue<Object> mq = getMessageQueue();
        Object command = mq.poll();
        if (command != null) {
            if( command == DISCONNECT ) {
                tl.onException(new TransportDisposedIOException("Peer (" + peer.toString() + ") disposed."));
            } else {
                tl.onCommand(command);
            }
            return !mq.isEmpty();
        } else {
View Full Code Here

    }

    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();
View Full Code Here

        }
    }

    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);
        }
    }
View Full Code Here

        }

        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 {
View Full Code Here

        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);
                }
            }
View Full Code Here

TOP

Related Classes of org.apache.activemq.transport.TransportDisposedIOException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.