Examples of ConnectionEvent


Examples of com.twitter.hbc.core.event.ConnectionEvent

  StatusLine establishConnection(Connection conn, HttpUriRequest request) {
    logger.info("{} Establishing a connection", name);
    // establish connection
    StatusLine status = null;
    try {
      addEvent(new ConnectionEvent(EventType.CONNECTION_ATTEMPT, request));
      status = conn.connect(request);
    } catch (UnknownHostException e) {
      // banking on some httpHosts.nextHost() being legitimate, or else this connection will fail.
      logger.warn("{} Unknown host - {}", name, request.getURI().getHost());
      addEvent(new Event(EventType.CONNECTION_ERROR, e));
View Full Code Here

Examples of javax.mail.event.ConnectionEvent

    public void removeConnectionListener(ConnectionListener listener) {
        connectionListeners.remove(listener);
    }

    protected void notifyConnectionListeners(int type) {
        queue.queueEvent(new ConnectionEvent(this, type), connectionListeners);
    }
View Full Code Here

Examples of javax.resource.spi.ConnectionEvent

    }

    public void sendEvent(int eventType, Exception ex,
                          Object connectionHandle) {
        Vector list = (Vector) listeners.clone();
        ConnectionEvent ce = null;
        if (ex == null) {
            ce = new ConnectionEvent(mcon, eventType);
        } else {
            ce = new ConnectionEvent(mcon, eventType, ex);
        }
        if (connectionHandle != null) {
            ce.setConnectionHandle(connectionHandle);
        }
         int size = list.size();
        for (int i=0; i<size; i++) {
            ConnectionEventListener l =
                (ConnectionEventListener) list.elementAt(i);
View Full Code Here

Examples of javax.resource.spi.ConnectionEvent

   
    synchronized (this.handles) {
      handles.remove(wc);
    }
   
    ConnectionEvent ce = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
    ce.setConnectionHandle(wc);
   
    ArrayList<ConnectionEventListener> copy = null;
    synchronized (this.listeners) {
      copy = new ArrayList<ConnectionEventListener>(this.listeners);
    }
View Full Code Here

Examples of javax.resource.spi.ConnectionEvent

    // Asynchronous JORAM exception does not notify of a connection loss:
    // doing nothing.
    if (! (exc instanceof javax.jms.IllegalStateException))
      return;

    ConnectionEvent event =
      new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED);

    ConnectionEventListener listener;
    for (int i = 0; i < listeners.size(); i++) {
      listener = (ConnectionEventListener) listeners.get(i);
      listener.connectionErrorOccurred(event);
View Full Code Here

Examples of javax.resource.spi.ConnectionEvent

    if (startedLocalTx)
      throw new LocalTransactionException("Local transaction has "
                                          + "already begun.");

    ConnectionEvent event =
      new ConnectionEvent(this, ConnectionEvent.LOCAL_TRANSACTION_STARTED);

    ConnectionEventListener listener;
    for (int i = 0; i < listeners.size(); i++) {
      listener = (ConnectionEventListener) listeners.get(i);
      listener.localTransactionStarted(event);
View Full Code Here

Examples of javax.resource.spi.ConnectionEvent

    catch (JMSException exc) {
      throw new LocalTransactionException("Commit of the transacted JMS "
                                          + "session failed: " + exc);
    }

    ConnectionEvent event =
      new ConnectionEvent(this, ConnectionEvent.LOCAL_TRANSACTION_COMMITTED);

    ConnectionEventListener listener;
    for (int i = 0; i < listeners.size(); i++) {
      listener = (ConnectionEventListener) listeners.get(i);
      listener.localTransactionCommitted(event);
View Full Code Here

Examples of javax.resource.spi.ConnectionEvent

    catch (JMSException exc) {
      throw new LocalTransactionException("Rollback of the transacted JMS "
                                          + "session failed: " + exc);
    }

    ConnectionEvent event =
      new ConnectionEvent(this, ConnectionEvent.LOCAL_TRANSACTION_ROLLEDBACK);

    ConnectionEventListener listener;
    for (int i = 0; i < listeners.size(); i++) {
      listener = (ConnectionEventListener) listeners.get(i);
      listener.localTransactionRolledback(event);
View Full Code Here

Examples of javax.resource.spi.ConnectionEvent

  /** Notifies of the closing of one of the connection handles. */
  void closeHandle(OutboundConnection handle) {
    if (AdapterTracing.dbgAdapter.isLoggable(BasicLevel.DEBUG))
      AdapterTracing.dbgAdapter.log(BasicLevel.DEBUG, this + " closeHandle(" + handle + ")");

    ConnectionEvent event =
      new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
    event.setConnectionHandle(handle);

    ConnectionEventListener listener;
    for (int i = 0; i < listeners.size(); i++) {
      listener = (ConnectionEventListener) listeners.get(i);
      listener.connectionClosed(event);
View Full Code Here

Examples of javax.resource.spi.ConnectionEvent

    }

    public void sendEvent(int eventType, Exception ex,
                          Object connectionHandle) {
        Vector list = (Vector) listeners.clone();
        ConnectionEvent ce = null;
        if (ex == null) {
            ce = new ConnectionEvent(mcon, eventType);
        } else {
            ce = new ConnectionEvent(mcon, eventType, ex);
        }
        if (connectionHandle != null) {
            ce.setConnectionHandle(connectionHandle);
        }
        int size = list.size();
        for (int i=0; i<size; i++) {
            ConnectionEventListener l =
                (ConnectionEventListener) list.elementAt(i);
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.