Examples of TransportListener


Examples of javax.mail.event.TransportListener

                        validUnsent,
                        invalid,
                        message);
        Iterator it = _listeners.iterator();
        while (it.hasNext()) {
            TransportListener listener = (TransportListener) it.next();
            event.dispatch(listener);
        }
    }
View Full Code Here

Examples of org.apache.activemq.transport.TransportListener

                public void onException(IOException error) {
                    serviceLocalException(error);
                }
            });
            remoteBroker.setTransportListener(new TransportListener() {

                public void onCommand(Object o) {
                    Command command = (Command)o;
                    serviceRemoteCommand(command);
                }
View Full Code Here

Examples of org.apache.activemq.transport.TransportListener

        }, "ActiveMQ Failover Worker: " + System.identityHashCode(this));
    }

    TransportListener createTransportListener() {
        return new TransportListener() {
            public void onCommand(Object o) {
                Command command = (Command)o;
                if (command == null) {
                    return;
                }
View Full Code Here

Examples of org.apache.activemq.transport.TransportListener

    /**
     * @see org.apache.activemq.thread.Task#iterate()
     */
    public boolean iterate() {
       
        final TransportListener tl;
        try {
            // Disable changing the state variables while we are running...
            enqueueValve.increment();
            tl = transportListener;
            if (!started || disposed || tl == null || stopping.get()) {
                if( stopping.get() ) {
                    // drain the queue it since folks could be blocked putting on to
                    // it and that would not allow the stop() method for finishing up.
                    getMessageQueue().clear()
                }
                return false;
            }
        } catch (InterruptedException e) {
            return false;
        } finally {
            enqueueValve.decrement();
        }

        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 {
            return false;
        }
View Full Code Here

Examples of org.apache.activemq.transport.TransportListener

                onAsyncException(e);
            }

        }
        for (Iterator<TransportListener> iter = transportListeners.iterator(); iter.hasNext();) {
            TransportListener listener = iter.next();
            listener.onCommand(command);
        }
    }
View Full Code Here

Examples of org.apache.activemq.transport.TransportListener

          ServiceSupport.dispose(ActiveMQConnection.this.transport);
          brokerInfoReceived.countDown();

          for (Iterator<TransportListener> iter = transportListeners
              .iterator(); iter.hasNext();) {
            TransportListener listener = iter.next();
            listener.onException(error);
          }
        }
      });
    }
  }
View Full Code Here

Examples of org.apache.activemq.transport.TransportListener

        for (Iterator<ActiveMQSession> i = this.sessions.iterator(); i.hasNext();) {
            ActiveMQSession s = i.next();
            s.clearMessagesInProgress();
        }
        for (Iterator<TransportListener> iter = transportListeners.iterator(); iter.hasNext();) {
            TransportListener listener = iter.next();
            listener.transportInterupted();
        }
    }
View Full Code Here

Examples of org.apache.activemq.transport.TransportListener

        }
    }

    public void transportResumed() {
        for (Iterator<TransportListener> iter = transportListeners.iterator(); iter.hasNext();) {
            TransportListener listener = iter.next();
            listener.transportResumed();
        }
        for (Iterator<ActiveMQSession> i = this.sessions.iterator(); i.hasNext();) {
            ActiveMQSession s = i.next();
            s.deliverAcks();
        }
View Full Code Here

Examples of org.apache.activemq.transport.TransportListener

                          TransactionManager transactionManager) {
        this(connection, new HashMap<SessionKey, SessionPool>(), poolFactory, transactionManager);
        // Add a transport Listener so that we can notice if this connection
        // should be expired due to
        // a connection failure.
        connection.addTransportListener(new TransportListener() {
            public void onCommand(Object command) {
            }

            public void onException(IOException error) {
                synchronized (ConnectionPool.this) {
View Full Code Here

Examples of org.apache.activemq.transport.TransportListener

                onClientInternalException(e);
            }

        }
        for (Iterator<TransportListener> iter = transportListeners.iterator(); iter.hasNext();) {
            TransportListener listener = iter.next();
            listener.onCommand(command);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.