javax.resource.spi.ConnectionEvent.getConnectionHandle()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(4.6k)|赞(0)|评价(0)|浏览(110)

本文整理了Java中javax.resource.spi.ConnectionEvent.getConnectionHandle()方法的一些代码示例,展示了ConnectionEvent.getConnectionHandle()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ConnectionEvent.getConnectionHandle()方法的具体详情如下:
包路径:javax.resource.spi.ConnectionEvent
类名称:ConnectionEvent
方法名:getConnectionHandle

ConnectionEvent.getConnectionHandle介绍

[英]Get the connection handle associated with the Managed Connection instance. Used for CONNECTION_CLOSED event.
[中]获取与托管连接实例关联的连接句柄。用于连接\u关闭事件。

代码示例

代码示例来源:origin: org.glassfish.connectors/connectors-runtime

public void connectionClosed(ConnectionEvent evt) {
  Object connectionHandle = evt.getConnectionHandle();
  ResourceHandle handle = resource;
  if (associatedHandles.containsKey(connectionHandle)) {
    handle = (ResourceHandle) associatedHandles.get(connectionHandle);
  }
  poolMgr.resourceClosed(handle); 
}

代码示例来源:origin: org.glassfish.connectors/connectors-runtime

/**
 * Resource adapters will signal that the connection being closed is bad.
 * @param evt ConnectionEvent
 */
public void badConnectionClosed(ConnectionEvent evt){
  Object connectionHandle = evt.getConnectionHandle();
  ResourceHandle handle = resource;
  if (associatedHandles.containsKey(connectionHandle)) {
    handle = (ResourceHandle) associatedHandles.get(connectionHandle);
  }
  ManagedConnection mc = (ManagedConnection) evt.getSource();
  mc.removeConnectionEventListener(this);
  poolMgr.badResourceClosed(handle); 
}

代码示例来源:origin: org.jboss.jbossas/jboss-as-connector

public void connectionClosed(ConnectionEvent ce)
{
  try
  {
   getCcm().unregisterConnection(NoTxConnectionManager.this, ce.getConnectionHandle());
  }
  catch (Throwable t)
  {
   log.info("Throwable from unregisterConnection", t);
  }
  unregisterAssociation(this, ce.getConnectionHandle());
  if (isManagedConnectionFree())
  {
   returnManagedConnection(this, false);
  }
}

代码示例来源:origin: org.apache.geronimo.components/geronimo-connector

public void connectionClosed(ConnectionEvent connectionEvent) {
  if (connectionEvent.getSource() != managedConnectionInfo.getManagedConnection()) {
    throw new IllegalArgumentException(
        "ConnectionClosed event received from wrong ManagedConnection. Expected "
        + managedConnectionInfo.getManagedConnection()
        + ", actual "
        + connectionEvent.getSource());
  }
  if (log.isTraceEnabled()) {
    log.trace("connectionClosed called with " + connectionEvent.getConnectionHandle() + " for MCI: " + managedConnectionInfo + " and MC: " + managedConnectionInfo.getManagedConnection());
  }
  ConnectionInfo ci = new ConnectionInfo(managedConnectionInfo);
  ci.setConnectionHandle(connectionEvent.getConnectionHandle());
  try {
    stack.returnConnection(ci, ConnectionReturnAction.RETURN_HANDLE);
  } catch (Throwable e) {
    if (log.isTraceEnabled()) {
      log.trace("connectionClosed failed with " + connectionEvent.getConnectionHandle() + " for MCI: " + managedConnectionInfo + " and MC: " + managedConnectionInfo.getManagedConnection(), e);
    }
    if (e instanceof Error) {
      throw (Error)e;
    }
  }
}

代码示例来源:origin: org.apache.geronimo.components/geronimo-connector

public void connectionErrorOccurred(ConnectionEvent connectionEvent) {
  if (connectionEvent.getSource() != managedConnectionInfo.getManagedConnection()) {
    throw new IllegalArgumentException(
        "ConnectionError event received from wrong ManagedConnection. Expected "
        + managedConnectionInfo.getManagedConnection()
        + ", actual "
        + connectionEvent.getSource());
  }
  log.warn("connectionErrorOccurred called with " + connectionEvent.getConnectionHandle(), connectionEvent.getException());
  boolean errorOccurred = this.errorOccurred;
  this.errorOccurred = true;
  if (!errorOccurred) {
    ConnectionInfo ci = new ConnectionInfo(managedConnectionInfo);
    ci.setConnectionHandle(connectionEvent.getConnectionHandle());
    stack.returnConnection(ci, ConnectionReturnAction.DESTROY);
  }
}

代码示例来源:origin: org.jboss.jbossas/jboss-as-connector

try
 getCcm().unregisterConnection(TxConnectionManager.this, ce.getConnectionHandle());
 if (wasFreed(ce.getConnectionHandle()))

代码示例来源:origin: org.jboss.ironjacamar/ironjacamar-core-impl

/**
  * {@inheritDoc}
  */
  public void connectionClosed(ConnectionEvent ce)
  {
   if (getCachedConnectionManager() != null)
   {
     try
     {
      getCachedConnectionManager().unregisterConnection(getConnectionManager(), this, ce.getConnectionHandle());
     }
     catch (Throwable t)
     {
      log.debug("Throwable from unregisterConnection", t);
     }
   }

   getConnectionManager().unregisterAssociation(this, ce.getConnectionHandle());
   
   if (isManagedConnectionFree())
   {
     getConnectionManager().returnManagedConnection(this, false);
   }
  }
}

代码示例来源:origin: com.caucho/resin

public void connectionClosed(ConnectionEvent event)
 Object handle = event.getConnectionHandle();

代码示例来源:origin: org.jboss.ironjacamar/ironjacamar-core-impl

ce.getConnectionHandle());
if (wasFreed(ce.getConnectionHandle()))

相关文章