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


Java ConnectionEvent.CONNECTION_ERROR_OCCURRED属性代码示例

本文整理汇总了Java中javax.resource.spi.ConnectionEvent.CONNECTION_ERROR_OCCURRED属性的典型用法代码示例。如果您正苦于以下问题:Java ConnectionEvent.CONNECTION_ERROR_OCCURRED属性的具体用法?Java ConnectionEvent.CONNECTION_ERROR_OCCURRED怎么用?Java ConnectionEvent.CONNECTION_ERROR_OCCURRED使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在javax.resource.spi.ConnectionEvent的用法示例。


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

示例1: onError

private void onError(Exception e) {

    this.localTran = null;

    synchronized (this.connections) {
      Iterator<GFConnectionImpl> connsItr = this.connections.iterator();
      while (connsItr.hasNext()) {
        GFConnectionImpl conn = connsItr.next();
        conn.invalidate();
        synchronized (this.listeners) {
          Iterator<ConnectionEventListener> itr = this.listeners.iterator();
          ConnectionEvent ce =
              new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED, e);
          ce.setConnectionHandle(conn);
          while (itr.hasNext()) {
            itr.next().connectionErrorOccurred(ce);
          }
        }
        connsItr.remove();
      }
    }

  }
 
开发者ID:ampool,项目名称:monarch,代码行数:23,代码来源:JCAManagedConnection.java

示例2: onError

private void onError(Exception e)
{

  this.localTran = null;

  synchronized (this.connections) {
    Iterator<GFConnectionImpl> connsItr = this.connections.iterator();
    while (connsItr.hasNext()) {
      GFConnectionImpl conn = connsItr.next();
      conn.invalidate();
      synchronized (this.listeners) {
        Iterator<ConnectionEventListener> itr = this.listeners.iterator();
        ConnectionEvent ce = new ConnectionEvent(this,
            ConnectionEvent.CONNECTION_ERROR_OCCURRED, e);
        ce.setConnectionHandle(conn);
        while (itr.hasNext()) {
          itr.next().connectionErrorOccurred(ce);
        }
      }
      connsItr.remove();
    }
  }

}
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:24,代码来源:JCAManagedConnection.java

示例3: sendConnectionEvent

protected void sendConnectionEvent(ConnectionEvent connEvent) {
for (int i = listeners.size() - 1; i >= 0; i--) {
    ConnectionEventListener listener =
	(ConnectionEventListener) listeners.get(i);
    if (connEvent.getId() == ConnectionEvent.CONNECTION_CLOSED) {
	listener.connectionClosed(connEvent);
    } else if (connEvent.getId() ==
	       ConnectionEvent.CONNECTION_ERROR_OCCURRED) {
	listener.connectionErrorOccurred(connEvent);
    } else if (connEvent.getId() ==
	       ConnectionEvent.LOCAL_TRANSACTION_STARTED) {
	listener.localTransactionStarted(connEvent);
    } else if (connEvent.getId() ==
	       ConnectionEvent.LOCAL_TRANSACTION_COMMITTED) {
	listener.localTransactionCommitted(connEvent);
    } else if (connEvent.getId() ==
	       ConnectionEvent.LOCAL_TRANSACTION_ROLLEDBACK) {
	listener.localTransactionRolledback(connEvent);
    }
}
   }
 
开发者ID:nologic,项目名称:nabs,代码行数:21,代码来源:JEManagedConnection.java

示例4: sendConnectionEvent

protected void sendConnectionEvent(ConnectionEvent connEvent) {
    for (int i = listeners.size() - 1; i >= 0; i--) {
        ConnectionEventListener listener =
            listeners.get(i);
        if (connEvent.getId() == ConnectionEvent.CONNECTION_CLOSED) {
            listener.connectionClosed(connEvent);
        } else if (connEvent.getId() ==
                   ConnectionEvent.CONNECTION_ERROR_OCCURRED) {
            listener.connectionErrorOccurred(connEvent);
        } else if (connEvent.getId() ==
                   ConnectionEvent.LOCAL_TRANSACTION_STARTED) {
            listener.localTransactionStarted(connEvent);
        } else if (connEvent.getId() ==
                   ConnectionEvent.LOCAL_TRANSACTION_COMMITTED) {
            listener.localTransactionCommitted(connEvent);
        } else if (connEvent.getId() ==
                   ConnectionEvent.LOCAL_TRANSACTION_ROLLEDBACK) {
            listener.localTransactionRolledback(connEvent);
        }
    }
}
 
开发者ID:prat0318,项目名称:dbms,代码行数:21,代码来源:JEManagedConnection.java

示例5: onException

public void onException(JMSException exception) {
    if (isDestroyed) {
        if (log.isTraceEnabled()) {
            log.trace("Ignoring error on already destroyed connection " + this, exception);
        }
        return;
    }

    log.warn("Handling jms exception failure: " + this, exception);

    // We need to unlock() before sending the connection error to the
    // event listeners. Otherwise the lock won't be in sync once
    // cleanup() is called
    if (lock.isLocked() && Thread.currentThread().equals(lock.getOwner())) {
        unlock();
    }

    try {
        con.setExceptionListener(null);
    } catch (JMSException e) {
        log.debug("Unable to unset exception listener", e);
    }

    ConnectionEvent event = new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED, exception);
    sendEvent(event);
}
 
开发者ID:vratsel,项目名称:generic-jms-ra,代码行数:26,代码来源:JmsManagedConnection.java

示例6: unfilteredConnectionError

protected void unfilteredConnectionError(Exception e) {
    ConnectionEvent event = new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED, e);
    if (listeners != null) {
        for (ConnectionEventListener listener : reverse(listeners)) {
            listener.connectionErrorOccurred(event);
        }
    }
    if (listener != null) {
        listener.connectionErrorOccurred(event);
    }
}
 
开发者ID:ops4j,项目名称:org.ops4j.pax.transx,代码行数:11,代码来源:AbstractManagedConnection.java

示例7: sendEvent

void sendEvent(final ConnectionEvent event) {
	int type = event.getId();

	if (log.isDebugEnabled()) {
		log.debug("Sending connection event: " + type);
	}

	// convert to an array to avoid concurrent modification exceptions
	ConnectionEventListener[] list =
	        (ConnectionEventListener[]) listeners.toArray(new ConnectionEventListener[listeners.size()]);

	for (int i = 0; i < list.length; i++) {
		switch (type) {
			case ConnectionEvent.CONNECTION_CLOSED:
				list[i].connectionClosed(event);
				break;

			case ConnectionEvent.LOCAL_TRANSACTION_STARTED:
				list[i].localTransactionStarted(event);
				break;

			case ConnectionEvent.LOCAL_TRANSACTION_COMMITTED:
				list[i].localTransactionCommitted(event);
				break;

			case ConnectionEvent.LOCAL_TRANSACTION_ROLLEDBACK:
				list[i].localTransactionRolledback(event);
				break;

			case ConnectionEvent.CONNECTION_ERROR_OCCURRED:
				list[i].connectionErrorOccurred(event);
				break;

			default :
				throw new IllegalArgumentException("Illegal eventType: " + type);
		}
	}
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:38,代码来源:ManagedConnectionImpl.java

示例8: onException

/**
 * Notifies user of a JMS exception.
 *
 * @param exception The JMS exception
 */
@Override
public void onException(final JMSException exception) {
   if (ActiveMQConnection.EXCEPTION_FAILOVER.equals(exception.getErrorCode())) {
      return;
   }
   if (logger.isTraceEnabled()) {
      ActiveMQRALogger.LOGGER.trace("onException(" + exception + ")");
   }

   if (isDestroyed.get()) {
      if (logger.isTraceEnabled()) {
         ActiveMQRALogger.LOGGER.trace("Ignoring error on already destroyed connection " + this, exception);
      }
      return;
   }

   ActiveMQRALogger.LOGGER.handlingJMSFailure(exception);

   try {
      connection.setExceptionListener(null);
   } catch (JMSException e) {
      logger.debug("Unable to unset exception listener", e);
   }

   ConnectionEvent event = new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED, exception);
   sendEvent(event);
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:32,代码来源:ActiveMQRAManagedConnection.java

示例9: sendEvent

/**
 * Send an event.
 *
 * @param event The event to send.
 */
protected void sendEvent(final ConnectionEvent event) {
   if (logger.isTraceEnabled()) {
      ActiveMQRALogger.LOGGER.trace("sendEvent(" + event + ")");
   }

   int type = event.getId();

   // convert to an array to avoid concurrent modification exceptions
   ConnectionEventListener[] list = eventListeners.toArray(new ConnectionEventListener[eventListeners.size()]);

   for (ConnectionEventListener l : list) {
      switch (type) {
         case ConnectionEvent.CONNECTION_CLOSED:
            l.connectionClosed(event);
            break;

         case ConnectionEvent.LOCAL_TRANSACTION_STARTED:
            l.localTransactionStarted(event);
            break;

         case ConnectionEvent.LOCAL_TRANSACTION_COMMITTED:
            l.localTransactionCommitted(event);
            break;

         case ConnectionEvent.LOCAL_TRANSACTION_ROLLEDBACK:
            l.localTransactionRolledback(event);
            break;

         case ConnectionEvent.CONNECTION_ERROR_OCCURRED:
            l.connectionErrorOccurred(event);
            break;

         default:
            throw new IllegalArgumentException("Illegal eventType: " + type);
      }
   }
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:42,代码来源:ActiveMQRAManagedConnection.java

示例10: sendEvent

void sendEvent(ConnectionEvent ce)
{
	Vector list = (Vector) m_listeners.clone();
	int size = list.size();
	for (int i = 0; i < size; i++)
	{
		ConnectionEventListener l =
				(ConnectionEventListener) list.elementAt(i);
		switch (ce.getId())
		{
			case ConnectionEvent.CONNECTION_CLOSED:
				l.connectionClosed(ce);
				break;
			case ConnectionEvent.LOCAL_TRANSACTION_STARTED:
				l.localTransactionStarted(ce);
				break;
			case ConnectionEvent.LOCAL_TRANSACTION_COMMITTED:
				l.localTransactionCommitted(ce);
				break;
			case ConnectionEvent.LOCAL_TRANSACTION_ROLLEDBACK:
				l.localTransactionRolledback(ce);
				break;
			case ConnectionEvent.CONNECTION_ERROR_OCCURRED:
				l.connectionErrorOccurred(ce);
				break;
			default:
				throw new IllegalArgumentException("Illegal eventType: " + ce.getId());
		}
	}
}
 
开发者ID:KualiCo,项目名称:ojb,代码行数:30,代码来源:OTMConnectionEventListener.java

示例11: errorHandle

/**
 * Error handle
 *
 * @param handle The handle
 * @param exception The exception
 */
void errorHandle(UnifiedSecurityConnection handle, Exception exception)
{
   connectionSet.remove(handle);

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

   List<ConnectionEventListener> copy = new ArrayList<ConnectionEventListener>(listeners);
   for (ConnectionEventListener cel : copy)
   {
      cel.connectionErrorOccurred(event);
   }
}
 
开发者ID:ironjacamar,项目名称:ironjacamar,代码行数:19,代码来源:UnifiedSecurityManagedConnection.java

示例12: errorHandle

/**
 * Error handle
 */
void errorHandle()
{
   ConnectionEvent errorEvent = new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED,
                                                    new Exception());
   errorEvent.setConnectionHandle(connection);

   List<ConnectionEventListener> copy = new ArrayList<ConnectionEventListener>(listeners);
   for (ConnectionEventListener cel : copy)
   {
      cel.connectionErrorOccurred(errorEvent);
   }
}
 
开发者ID:ironjacamar,项目名称:ironjacamar,代码行数:15,代码来源:PerfManagedConnection.java

示例13: errorHandle

/**
 * Error handle
 *
 * @param handle The handle
 * @param exception The exception
 */
void errorHandle(TxLogConnection handle, Exception exception)
{
   connections.remove((TxLogConnectionImpl)handle);

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

   List<ConnectionEventListener> copy = new ArrayList<ConnectionEventListener>(listeners);
   for (ConnectionEventListener cel : copy)
   {
      cel.connectionErrorOccurred(event);
   }
}
 
开发者ID:ironjacamar,项目名称:ironjacamar,代码行数:19,代码来源:TxLogManagedConnection.java

示例14: errorOccured

/**
 * All listeners of the container need to be triggered when an error occurs.
 */
public void errorOccured() {
	LOGGER.trace("errorOccured()");
	for (ConnectionEventListener listener : this.listenerList) {
		ConnectionEvent event = new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED);
		listener.connectionClosed(event);
	}
}
 
开发者ID:agito-it,项目名称:activiti-jobexecutor-ee,代码行数:10,代码来源:JobExecutorManagedConnection.java

示例15: sendEvent

/**
 * Send an event.
 *
 * @param event The event to send.
 */
protected void sendEvent(final ConnectionEvent event) {
    int type = event.getId();

    if (log.isTraceEnabled()) {
        log.trace("Sending connection event: " + type);
    }

    // convert to an array to avoid concurrent modification exceptions
    ConnectionEventListener[] list =
            (ConnectionEventListener[]) listeners.toArray(new ConnectionEventListener[listeners.size()]);

    for (int i = 0; i < list.length; i++) {
        switch (type) {
            case ConnectionEvent.CONNECTION_CLOSED:
                list[i].connectionClosed(event);
                break;

            case ConnectionEvent.LOCAL_TRANSACTION_STARTED:
                list[i].localTransactionStarted(event);
                break;

            case ConnectionEvent.LOCAL_TRANSACTION_COMMITTED:
                list[i].localTransactionCommitted(event);
                break;

            case ConnectionEvent.LOCAL_TRANSACTION_ROLLEDBACK:
                list[i].localTransactionRolledback(event);
                break;

            case ConnectionEvent.CONNECTION_ERROR_OCCURRED:
                list[i].connectionErrorOccurred(event);
                break;

            default:
                throw new IllegalArgumentException("Illegal eventType: " + type);
        }
    }
}
 
开发者ID:vratsel,项目名称:generic-jms-ra,代码行数:43,代码来源:JmsManagedConnection.java


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