connectionimpl.java

来自「RESIN 3.2 最新源码」· Java 代码 · 共 73 行

JAVA
73
字号
package example;import java.io.*;import java.util.*;import javax.resource.*;import javax.resource.spi.*;import javax.security.auth.*;/** * Implementation of the user's view of the connection.  This * class is entirely customizable. * * Normally, it will just be a facade to the underlying managed * connection. */public class ConnectionImpl {  private String _name;    // Reference to the underlying connection  private ManagedConnectionImpl _mConn;  private volatile boolean _isClosed;  /**   * Create the connection, with a reference to the underlying   * connection.   */  ConnectionImpl(String name, ManagedConnectionImpl mConn)  {    _name = name;    _mConn = mConn;  }  /**   * Adding a <code>close()</code> method is very important for any   * connection API.  It lets Resin know that the user has   * closed the connection and Resin can mark the managed connection   * as idle and reuse it.   *   * It is also important that the connection let the user call   * <code>close()</code>, but only the allow the  first <code>close</code>   * to have any effect.   *   * In particular, it would be a mistake to call <code>_mConn.close</code>   * twice since that would tell Resin that the connection had closed   * twice, which might confuse Resin's pool.   */  public void close()  {    synchronized (this) {      if (_isClosed)	return;      _isClosed = true;    }    ManagedConnectionImpl mConn = _mConn;    _mConn = null;        mConn.close(this);  }  public String toString()  {    return "ConnectionImpl[" + _name + "," + _mConn + "]";  }  public void finalize()  {    close();  }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?