| java.lang.Object org.objectweb.jonas.resource.ConnectionManagerImpl
ConnectionManagerImpl | public class ConnectionManagerImpl implements ConnectionEventListener,ConnectionManager,PoolMatchFactory,SQLManager,TransactionResourceManager(Code) | | Description of the ConnectionManagerImpl
author: chassand author: created 15 novembre 2001 |
Method Summary | |
public Object | allocateConnection(ManagedConnectionFactory pMcf, ConnectionRequestInfo cxRequestInfo) The method allocateConnection gets called by the resource adapter's
connection factory instance. | public void | cleanResourceAdapter() | public void | connectionClosed(ConnectionEvent event) IMPLEMENTATION OF INTERFACE ConnectionEventListener *
A ManagedConnection instance calls the connectionClosed method to notify
its registered set of listeners when an application component closes a
connection handle. | public void | connectionErrorOccurred(ConnectionEvent event) The connectionErrorOccurred method indicates that the associated
ManagedConnection instance is now invalid and unusable. | public Object | createResource(Object hints) Call the ManagedConnectionFactory in order to create a new instance. | public void | destroyPStmts(MCInfo mcinfo) | public int | getCheckLevel() | public int | getCurrentInTx() | public int | getMaxPstmtPoolSize() | public PreparedStatement | getPStatement(MCInfo mcinfo, Object conn, String user, String sql) | public PreparedStatement | getPStatement(MCInfo mcinfo, Object conn, String user, String sql, int resultSetType, int resultSetConcurrency) | public PreparedStatement | getPStatement(MCInfo mcinfo, Object conn, String user, String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) | public PreparedStatement | getPStatement(MCInfo mcinfo, Object conn, String user, String sql, int autoGeneratedKeys) | public PreparedStatement | getPStatement(MCInfo mcinfo, Object conn, String user, String sql, int[] columnIndexes) | public PreparedStatement | getPStatement(MCInfo mcinfo, Object conn, String user, String sql, String[] columnNames) | public Pool | getPool() | protected String | getState(String prefix) | public String | getTestStatement() | public String | getXAName() | public void | init(Context ctx) This method permits to initialize the ConnectionManager with the following
parameter: RESOURCE_BUNDLE_NAME: The name of the resource bundle in order
to internationalize the logging LOGGER: The logger instance where events
are logged LOGGER_FACTORY: A logger factory to obtain a logger
PRINT_WRITER: The printwriter where event are logged TRANSACTION_MANAGER:
The Transaction manager linked to this resource manager
RESOURCE_MANAGER_EVENT_LISTENER: The resource manage event listener which
subscribed to later connection enlistement. | public void | localTransactionCommitted(ConnectionEvent event) Notifies that a Resource Manager Local Transaction was committed on the
ManagedConnection instance. | public void | localTransactionRolledback(ConnectionEvent event) Notifies that a Resource Manager Local Transaction was rolled back on the
ManagedConnection instance. | public void | localTransactionStarted(ConnectionEvent event) Notifies that a Resource Manager Local Transaction was started on the
ManagedConnection instance. | public boolean | matchResource(Object res, Object hints) All method of the pool match to the right type of ManagedConnection because
there is one pool by ManagedConnectionFactory. | public Object | matchResource(Set res, Object hints) All method of the pool match to the right type of ManagedConnection because
there is one pool by ManagedConnectionFactory. | public void | registerXAResource(Properties tmProp) | public void | releaseResource(Object rMc) | public void | returnXAResource(String rmName, XAResource rmXares) | public void | setCheckLevel(int level) | public void | setLogger(Logger l) | public void | setLoggerFactory(LoggerFactory lf) | public void | setMaxPstmtPoolSize(int maxPstmtPoolSize) | public void | setPrintWriter(PrintWriter pw) | public void | setResourceAdapter(ManagedConnectionFactory tmcf) | public void | setResourceAdapter(ManagedConnectionFactory tmcf, ConnectionManagerPoolParams cmpp) | public void | setResourceManagerEventListener(ResourceManagerEventListener rmel) | public void | setTestStatement(String stmt) | public void | setTransactionManager(TransactionManager tm) | public void | setXAName(String xanm) | public String | toString() | public void | validateResource(Set res) |
JDBC_CHECK_CONNECTION | final public static int JDBC_CHECK_CONNECTION(Code) | | |
JDBC_KEEP_ALIVE | final public static int JDBC_KEEP_ALIVE(Code) | | |
JDBC_NO_TEST | final public static int JDBC_NO_TEST(Code) | | Constants for use with JDBC connection level
|
JDBC_SEND_STATEMENT | final public static int JDBC_SEND_STATEMENT(Code) | | |
JNDINAME | final public static String JNDINAME(Code) | | This constant is used in the by the init method
|
LOCAL_TRANS_SUPPORT | final public static String LOCAL_TRANS_SUPPORT(Code) | | Rar supports local transactions
|
LOGGER | final public static String LOGGER(Code) | | This constant is used in the by the init method
|
LOGGER_FACTORY | final public static String LOGGER_FACTORY(Code) | | This constant is used in the by the init method
|
MAX_PSTMT_SIZE | final static int MAX_PSTMT_SIZE(Code) | | The default max pool size of pstmts per ManagedConnection.
|
NO_TRANS_SUPPORT | final public static String NO_TRANS_SUPPORT(Code) | | Rar doesn't support transactions
|
POOL_LOGGER | final public static String POOL_LOGGER(Code) | | This constant is used in the by the init method
|
PRINT_WRITER | final public static String PRINT_WRITER(Code) | | This constant is used in the by the init method
|
PSWRAP_1 | final public static int PSWRAP_1(Code) | | Constants to determine which PreparedStatement types to call
|
PSWRAP_2 | final public static int PSWRAP_2(Code) | | |
PSWRAP_3 | final public static int PSWRAP_3(Code) | | |
PSWRAP_4 | final public static int PSWRAP_4(Code) | | |
PSWRAP_5 | final public static int PSWRAP_5(Code) | | |
RESOURCE_ADAPTER | final public static String RESOURCE_ADAPTER(Code) | | This constant is used in the by the init method
|
RESOURCE_BUNDLE_NAME | final public static String RESOURCE_BUNDLE_NAME(Code) | | This constant is used in the by the init method
|
RESOURCE_MANAGER_EVENT_LISTENER | final public static String RESOURCE_MANAGER_EVENT_LISTENER(Code) | | This constant is used in the by the init method
|
TRANSACTION_MANAGER | final public static String TRANSACTION_MANAGER(Code) | | This constant is used in the by the init method
|
XA_TRANS_SUPPORT | final public static String XA_TRANS_SUPPORT(Code) | | Rar supports XA transactions
|
conTrace | protected static Logger conTrace(Code) | | Connection Management logger
|
jndiname | protected String jndiname(Code) | | The jndiname of the associated factory
|
mc2mci | protected Hashtable mc2mci(Code) | | This hashtable allows to find the list of connection handle associated to a
ManagedConnection
|
mcs | protected Vector mcs(Code) | | The list of managedConnection used without transaction
|
poolMCs | protected Pool poolMCs(Code) | | The pool of ManagedConnections associated to a ManagedConnectionFactory
There's one instance of pool by instance for one instance of this class (ConnectionManagerImpl).
The synchronization of the methods of this are ensured through synchronized
blocks on the poolMCs instance. Thus, the lock are shared between the two objects and that
avoids deadlock issues when the poolMCs.getRessource() is waiting for a connection releasing
(max nb of instances is reached in the pool).
|
poolTrace | protected static Logger poolTrace(Code) | | Pool infomation logger
|
rmel | protected ResourceManagerEventListener rmel(Code) | | Used by the server to register connections when no
transactionnal context exists
|
synchros | protected Vector synchros(Code) | | The list of Synchronisation instance managed in this ConnectionManager
|
tm | protected TransactionManager tm(Code) | | The transaction manager in server
|
trace | protected static Logger trace(Code) | | Main logger
|
usedMCs | protected Hashtable usedMCs(Code) | | The list of used ManagedConnections key = transaction reference value =
MCInfo
|
ConnectionManagerImpl | public ConnectionManagerImpl(String transSupport)(Code) | | ConnectionManagerImpl constructor
Parameters: transSupport - String defining level of support needed |
allocateConnection | public Object allocateConnection(ManagedConnectionFactory pMcf, ConnectionRequestInfo cxRequestInfo) throws ResourceException(Code) | | The method allocateConnection gets called by the resource adapter's
connection factory instance.
See Also: javax.resource.cci.ConnectionManager |
cleanResourceAdapter | public void cleanResourceAdapter() throws ResourceException(Code) | | Description of the Method
exception: ResourceException - Description of Exception |
connectionClosed | public void connectionClosed(ConnectionEvent event)(Code) | | IMPLEMENTATION OF INTERFACE ConnectionEventListener *
A ManagedConnection instance calls the connectionClosed method to notify
its registered set of listeners when an application component closes a
connection handle. The application server uses this connection close event
to make a decision on whether or not to put the ManagedConnection instance
back into the connection pool.
See Also: javax.resource.spi.ConnectionEventListener |
connectionErrorOccurred | public void connectionErrorOccurred(ConnectionEvent event)(Code) | | The connectionErrorOccurred method indicates that the associated
ManagedConnection instance is now invalid and unusable. The application
server handles the connection error event notification by initiating
application server-specific cleanup (for example, removing
ManagedConnection instance from the connection pool) and then calling
ManagedConnection.destroy method to destroy the physical connection..
See Also: javax.resource.spi.ConnectionEventListener |
createResource | public Object createResource(Object hints) throws Exception(Code) | | Call the ManagedConnectionFactory in order to create a new instance. of
ManagedConnection. The Object is a ManagedConnection instance. The hints is a
local structure: ResourceSpec
See Also: org.objectweb.util.pool.api.PoolMatchFactory |
destroyPStmts | public void destroyPStmts(MCInfo mcinfo) throws Exception(Code) | | Destroying of the PreparedStatement objects of the Pool
Parameters: mcinfo - ManagedConnection information throws: Exception - Exception |
getCheckLevel | public int getCheckLevel()(Code) | | |
getCurrentInTx | public int getCurrentInTx()(Code) | | |
getMaxPstmtPoolSize | public int getMaxPstmtPoolSize()(Code) | | Returns the maxPstmtPoolSize. |
getState | protected String getState(String prefix)(Code) | | Gets the State attribute of the ConnectionManagerImpl object
Parameters: prefix - Description of Parameter The State value |
getXAName | public String getXAName()(Code) | | Get the XAName to use
String of XA Name |
init | public void init(Context ctx) throws Exception(Code) | | This method permits to initialize the ConnectionManager with the following
parameter: RESOURCE_BUNDLE_NAME: The name of the resource bundle in order
to internationalize the logging LOGGER: The logger instance where events
are logged LOGGER_FACTORY: A logger factory to obtain a logger
PRINT_WRITER: The printwriter where event are logged TRANSACTION_MANAGER:
The Transaction manager linked to this resource manager
RESOURCE_MANAGER_EVENT_LISTENER: The resource manage event listener which
subscribed to later connection enlistement. RESOURCE_ADAPTER: The
managedConnectionFactory instance of the resource which must be maneged by
this connectionManager
JNDINAME: JndiName from the factory associated with this ConnectionManager
Parameters: ctx - Description of Parameter exception: Exception - Description of Exception |
localTransactionCommitted | public void localTransactionCommitted(ConnectionEvent event)(Code) | | Notifies that a Resource Manager Local Transaction was committed on the
ManagedConnection instance.
See Also: javax.resource.spi.ConnectionEventListener |
localTransactionRolledback | public void localTransactionRolledback(ConnectionEvent event)(Code) | | Notifies that a Resource Manager Local Transaction was rolled back on the
ManagedConnection instance.
See Also: javax.resource.spi.ConnectionEventListener |
localTransactionStarted | public void localTransactionStarted(ConnectionEvent event)(Code) | | Notifies that a Resource Manager Local Transaction was started on the
ManagedConnection instance.
See Also: javax.resource.spi.ConnectionEventListener |
matchResource | public boolean matchResource(Object res, Object hints)(Code) | | All method of the pool match to the right type of ManagedConnection because
there is one pool by ManagedConnectionFactory.
See Also: org.objectweb.util.pool.api.PoolMatchFactory |
matchResource | public Object matchResource(Set res, Object hints) throws Exception(Code) | | All method of the pool match to the right type of ManagedConnection because
there is one pool by ManagedConnectionFactory.
See Also: org.objectweb.util.pool.api.PoolMatchFactory |
registerXAResource | public void registerXAResource(Properties tmProp)(Code) | | Register an XAResource with JOTM for recovery
|
releaseResource | public void releaseResource(Object rMc) throws Exception(Code) | | Release the ManagedConnection object resource
Parameters: rMc - Object to release throws: Exception - if an Exception occurs |
returnXAResource | public void returnXAResource(String rmName, XAResource rmXares)(Code) | | Called from JOTM to free the XAResource and associated Managed Connection
when recovery is complete
Parameters: rmName - The Resource Manager to be unregistered. Parameters: rmXares - XAResource to be returned |
setCheckLevel | public void setCheckLevel(int level)(Code) | | |
setLogger | public void setLogger(Logger l)(Code) | | Setters method to initialize the ConnectionManager The logger instance
where events are logged
Parameters: l - The new Logger value |
setLoggerFactory | public void setLoggerFactory(LoggerFactory lf)(Code) | | Setters method to initialize the ConnectionManager A logger factory to
obtain a logger
Parameters: lf - The new LoggerFactory value |
setMaxPstmtPoolSize | public void setMaxPstmtPoolSize(int maxPstmtPoolSize)(Code) | | Parameters: maxPstmtPoolSize - The maxPstmtPoolSize to set. |
setPrintWriter | public void setPrintWriter(PrintWriter pw)(Code) | | Setters method to initialize the ConnectionManager The printwriter where
event are logged
Parameters: pw - The new PrintWriter value |
setResourceAdapter | public void setResourceAdapter(ManagedConnectionFactory tmcf) throws Exception(Code) | | Setters method to initialize the ConnectionManager The
managedConnectionFactory instance of the resource which must be managed by
this connectionManager
Parameters: tmcf - The new ResourceAdapter value exception: Exception - Description of Exception |
setResourceAdapter | public void setResourceAdapter(ManagedConnectionFactory tmcf, ConnectionManagerPoolParams cmpp) throws Exception(Code) | | Setters method to initialize the ConnectionManager The
managedConnectionFactory instance of the resource which must be maneged by
this connectionManager
Parameters: tmcf - The ManagedConnectionFactory object Parameters: cmpp - The pool parameters exception: Exception - Description of Exception |
setResourceManagerEventListener | public void setResourceManagerEventListener(ResourceManagerEventListener rmel)(Code) | | Setters method to initialize the ConnectionManager The logger instance
where events are logged
Parameters: rmel - The new ResourceManagerEventListener value |
setTestStatement | public void setTestStatement(String stmt)(Code) | | |
setTransactionManager | public void setTransactionManager(TransactionManager tm)(Code) | | Setters method to initialize the ConnectionManager The Transaction manager
linked to this resource managed
Parameters: tm - TransactionManager value |
setXAName | public void setXAName(String xanm)(Code) | | Set the XAName to use
Parameters: xanm - String of XA Name |
toString | public String toString()(Code) | | Description of the Method
Description of the Returned Value |
validateResource | public void validateResource(Set res) throws Exception(Code) | | If supported, call the ManagedConnectionFactory to validate the ManagedConnections
See Also: org.objectweb.util.pool.api.PoolMatchFactory |
|
|