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


Java ConnectionEvent.getSource方法代码示例

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


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

示例1: connectionClosed

import javax.resource.spi.ConnectionEvent; //导入方法依赖的package包/类
/**
 * Callback for Connection Closed.
 * 
 * @param event ConnectionEvent Object.
 */
public void connectionClosed(ConnectionEvent event) {
  if (isActive) {
    ManagedConnection conn = (ManagedConnection) event.getSource();
    TransactionManagerImpl transManager = TransactionManagerImpl.getTransactionManager();
    try {
      Transaction txn = transManager.getTransaction();
      if (txn == null) {
        mannPoolCache.returnPooledConnectionToPool(conn);
      }
    } catch (Exception se) {
      String exception =
          "FacetsJCAConnectionManagerImpl::connectionClosed: Exception occured due to "
              + se.getMessage();
      if (logger.isDebugEnabled()) {
        logger.debug(exception, se);
      }
    }
  }
}
 
开发者ID:ampool,项目名称:monarch,代码行数:25,代码来源:FacetsJCAConnectionManagerImpl.java

示例2: connectionClosed

import javax.resource.spi.ConnectionEvent; //导入方法依赖的package包/类
/**
 * Callback for Connection Closed.
 * 
 * @param event ConnectionEvent Object.
 */
public void connectionClosed(ConnectionEvent event) {
  if (isActive) {
    ManagedConnection conn = (ManagedConnection) event.getSource();
    XAResource xar = null;
    if (xaResourcesMap.get(conn) != null)
        xar = (XAResource) xaResourcesMap.get(conn);
    xaResourcesMap.remove(conn);
    try {
      Transaction txn = transManager.getTransaction();
      if (txn != null && xar != null) {
        txn.delistResource(xar, XAResource.TMSUCCESS);
      }
    }
    catch (Exception se) {
      String exception = "JCAConnectionManagerImpl::connectionClosed: Exception occured due to "
          + se;
      LogWriterI18n writer = TransactionUtils.getLogWriterI18n();
      if (writer.fineEnabled()) writer.fine(exception, se);
    }
    mannPoolCache.returnPooledConnectionToPool(conn);
  }
}
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:28,代码来源:JCAConnectionManagerImpl.java

示例3: connectionClosed

import javax.resource.spi.ConnectionEvent; //导入方法依赖的package包/类
/**
 * Callback for Connection Closed.
 * 
 * @param event ConnectionEvent Object.
 */
public void connectionClosed(ConnectionEvent event) {
  if (isActive) {
    ManagedConnection conn = (ManagedConnection) event.getSource();
    TransactionManagerImpl transManager = TransactionManagerImpl
        .getTransactionManager();
    try {
      Transaction txn = transManager.getTransaction();
      if (txn == null) {
        mannPoolCache.returnPooledConnectionToPool(conn);
      }
    }
    catch (Exception se) {
      String exception = "FacetsJCAConnectionManagerImpl::connectionClosed: Exception occured due to "
          + se;
      LogWriterI18n writer = TransactionUtils.getLogWriterI18n();
      if (writer.fineEnabled()) writer.fine(exception, se);
    }
  }
}
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:25,代码来源:FacetsJCAConnectionManagerImpl.java

示例4: connectionErrorOccurred

import javax.resource.spi.ConnectionEvent; //导入方法依赖的package包/类
/**
 * CallBack for Connection Error.
 * 
 * @param event ConnectionEvent
 */
public void connectionErrorOccurred(ConnectionEvent event) {
  if (isActive) {
    // If its an XAConnection
    ManagedConnection conn = (ManagedConnection) event.getSource();
    XAResource xar = (XAResource) xaResourcesMap.get(conn);
    xaResourcesMap.remove(conn);
    TransactionManagerImpl transManager = TransactionManagerImpl.getTransactionManager();
    try {
      Transaction txn = transManager.getTransaction();
      if (txn != null && xar != null)
        txn.delistResource(xar, XAResource.TMSUCCESS);
    } catch (SystemException se) {
      se.printStackTrace();
    }
    try {
      mannPoolCache.expirePooledConnection(conn);
      // mannPoolCache.destroyPooledConnection(conn);
    } catch (Exception ex) {
      String exception =
          "JCAConnectionManagerImpl::connectionErrorOccured: Exception occured due to " + ex;
      if (logger.isDebugEnabled()) {
        logger.debug(exception, ex);
      }
    }
  }
}
 
开发者ID:ampool,项目名称:monarch,代码行数:32,代码来源:JCAConnectionManagerImpl.java

示例5: connectionErrorOccurred

import javax.resource.spi.ConnectionEvent; //导入方法依赖的package包/类
/**
 * CallBack for Connection Error.
 * 
 * @param event ConnectionEvent
 */
public void connectionErrorOccurred(ConnectionEvent event) {
  if (isActive) {
    // If its an XAConnection
    ManagedConnection conn = (ManagedConnection) event.getSource();
    // XAResource xar = (XAResource) xaResourcesMap.get(conn);
    ((List) xalistThreadLocal.get()).remove(conn);
    TransactionManagerImpl transManager = TransactionManagerImpl.getTransactionManager();
    try {
      Transaction txn = transManager.getTransaction();
      if (txn == null) {
        mannPoolCache.returnPooledConnectionToPool(conn);
      } else {
        // do nothing.
      }
    } catch (Exception se) {
      se.printStackTrace();
    }
    try {
      mannPoolCache.expirePooledConnection(conn);
      // mannPoolCache.destroyPooledConnection(conn);
    } catch (Exception ex) {
      String exception =
          "FacetsJCAConnectionManagerImpl::connectionErrorOccured: Exception occured due to "
              + ex.getMessage();
      if (logger.isDebugEnabled()) {
        logger.debug(exception, ex);
      }
    }
  }
}
 
开发者ID:ampool,项目名称:monarch,代码行数:36,代码来源:FacetsJCAConnectionManagerImpl.java

示例6: connectionErrorOccurred

import javax.resource.spi.ConnectionEvent; //导入方法依赖的package包/类
/**
 * CallBack for Connection Error.
 * 
 * @param event ConnectionEvent
 */
public void connectionErrorOccurred(ConnectionEvent event) {
  if (isActive) {
    // If its an XAConnection
    ManagedConnection conn = (ManagedConnection) event.getSource();
    XAResource xar = (XAResource) xaResourcesMap.get(conn);
    xaResourcesMap.remove(conn);
    TransactionManagerImpl transManager = TransactionManagerImpl
        .getTransactionManager();
    try {
      Transaction txn = transManager.getTransaction();
      if (txn != null && xar != null)
          txn.delistResource(xar, XAResource.TMSUCCESS);
    }
    catch (SystemException se) {
      se.printStackTrace();
    }
    try {
      mannPoolCache.expirePooledConnection(conn);
      //mannPoolCache.destroyPooledConnection(conn);
    }
    catch (Exception ex) {
      String exception = "JCAConnectionManagerImpl::connectionErrorOccured: Exception occured due to "
          + ex;
      LogWriterI18n writer = TransactionUtils.getLogWriterI18n();
      if (writer.fineEnabled()) writer.fine(exception, ex);
    }
  }
}
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:34,代码来源:JCAConnectionManagerImpl.java

示例7: connectionErrorOccurred

import javax.resource.spi.ConnectionEvent; //导入方法依赖的package包/类
/**
 * CallBack for Connection Error.
 * 
 * @param event ConnectionEvent
 */
public void connectionErrorOccurred(ConnectionEvent event) {
  if (isActive) {
    // If its an XAConnection
    ManagedConnection conn = (ManagedConnection) event.getSource();
    //	        XAResource xar = (XAResource) xaResourcesMap.get(conn);
    ((List) xalistThreadLocal.get()).remove(conn);
    TransactionManagerImpl transManager = TransactionManagerImpl
        .getTransactionManager();
    try {
      Transaction txn = transManager.getTransaction();
      if (txn == null) {
        mannPoolCache.returnPooledConnectionToPool(conn);
      }
      else {
        // do nothing.
      }
    }
    catch (Exception se) {
      se.printStackTrace();
    }
    try {
      mannPoolCache.expirePooledConnection(conn);
      //mannPoolCache.destroyPooledConnection(conn);
    }
    catch (Exception ex) {
      String exception = "FacetsJCAConnectionManagerImpl::connectionErrorOccured: Exception occured due to "
          + ex;
      LogWriterI18n writer = TransactionUtils.getLogWriterI18n();
      if (writer.fineEnabled()) writer.fine(exception, ex);
    }
  }
}
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:38,代码来源:FacetsJCAConnectionManagerImpl.java


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