|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.jonas.resource.cm.ConnectionManagerImpl
public class ConnectionManagerImpl
Description of the ConnectionManagerImpl
Field Summary | |
---|---|
static int |
JDBC_CHECK_CONNECTION
|
static int |
JDBC_KEEP_ALIVE
|
static int |
JDBC_NO_TEST
Constants for use with JDBC connection level |
static int |
JDBC_SEND_STATEMENT
|
static String |
LOCAL_TRANS_SUPPORT
Rar supports local transactions |
static String |
LOGGER
This constant is used in the by the init method |
static String |
LOGGER_FACTORY
This constant is used in the by the init method |
protected Hashtable |
mc2mci
This hashtable allows to find the list of connection handle associated to a ManagedConnection |
static String |
NO_TRANS_SUPPORT
Rar doesn't support transactions |
static String |
POOL_LOGGER
This constant is used in the by the init method |
static org.objectweb.util.monolog.api.Logger |
poolTrace
Pool infomation logger |
static String |
PRINT_WRITER
This constant is used in the by the init method |
static int |
PSWRAP_1
Constants to determine which PreparedStatement types to call |
static int |
PSWRAP_2
|
static int |
PSWRAP_3
|
static int |
PSWRAP_4
|
static int |
PSWRAP_5
|
static String |
RESOURCE_ADAPTER
This constant is used in the by the init method |
static String |
RESOURCE_BUNDLE_NAME
This constant is used in the by the init method |
static String |
RESOURCE_MANAGER_EVENT_LISTENER
This constant is used in the by the init method |
protected org.objectweb.transaction.jta.ResourceManagerEventListener |
rmel
Used by the server to register connections when no transactionnal context exists |
protected org.objectweb.transaction.jta.TransactionManager |
tm
The transaction manager in server |
static org.objectweb.util.monolog.api.Logger |
trace
Main logger |
static String |
TRANSACTION_MANAGER
This constant is used in the by the init method |
static String |
XA_TRANS_SUPPORT
Rar supports XA transactions |
Constructor Summary | |
---|---|
ConnectionManagerImpl(String transSupport)
ConnectionManagerImpl constructor |
Method Summary | |
---|---|
Object |
allocateConnection(ManagedConnectionFactory pMcf,
ConnectionRequestInfo cxRequestInfo)
The method allocateConnection gets called by the resource adapter's connection factory instance. |
void |
cleanResourceAdapter()
Description of the Method |
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. |
void |
connectionErrorOccurred(ConnectionEvent event)
The connectionErrorOccurred method indicates that the associated ManagedConnection instance is now invalid and unusable. |
Object |
createResource(Object hints)
Call the ManagedConnectionFactory in order to create a new instance. |
void |
destroyPStmts(ManagedConnectionInfo mcinfo)
Destroying of the PreparedStatement objects of the Pool |
int |
getCheckLevel()
|
int |
getCurrentInTx()
|
List |
getManagedConnectionsWithoutTransaction()
|
int |
getMaxPstmtPoolSize()
|
Pool |
getPool()
|
PreparedStatement |
getPStatement(ManagedConnectionInfo mcinfo,
Object conn,
String user,
String sql)
IMPLEMENTATION OF INTERFACE SQLManager |
PreparedStatement |
getPStatement(ManagedConnectionInfo mcinfo,
Object conn,
String user,
String sql,
int autoGeneratedKeys)
Get the specified PreparedStatement |
PreparedStatement |
getPStatement(ManagedConnectionInfo mcinfo,
Object conn,
String user,
String sql,
int[] columnIndexes)
Get the specified PreparedStatement |
PreparedStatement |
getPStatement(ManagedConnectionInfo mcinfo,
Object conn,
String user,
String sql,
int resultSetType,
int resultSetConcurrency)
Get the specified PreparedStatement |
PreparedStatement |
getPStatement(ManagedConnectionInfo mcinfo,
Object conn,
String user,
String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
Get the specified PreparedStatement |
PreparedStatement |
getPStatement(ManagedConnectionInfo mcinfo,
Object conn,
String user,
String sql,
String[] columnNames)
Get the specified PreparedStatement |
String |
getState(String prefix)
Gets the State attribute of the ConnectionManagerImpl object |
List |
getSynchros()
|
String |
getTestStatement()
|
Map |
getUsedManagedConnections()
|
String |
getXAName()
Get the XAName to use |
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. |
void |
localTransactionCommitted(ConnectionEvent event)
Notifies that a Resource Manager Local Transaction was committed on the ManagedConnection instance. |
void |
localTransactionRolledback(ConnectionEvent event)
Notifies that a Resource Manager Local Transaction was rolled back on the ManagedConnection instance. |
void |
localTransactionStarted(ConnectionEvent event)
Notifies that a Resource Manager Local Transaction was started on the ManagedConnection instance. |
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. |
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. |
void |
registerXAResource(Properties tmProp)
Register an XAResource with JOTM for recovery |
void |
releaseResource(Object rMc)
Release the ManagedConnection object resource |
void |
returnXAResource(String rmName,
XAResource rmXares)
Called from JOTM to free the XAResource and associated Managed Connection when recovery is complete |
void |
setCheckLevel(int level)
|
void |
setLogger(org.objectweb.util.monolog.api.Logger l)
Setters method to initialize the ConnectionManager The logger instance where events are logged |
void |
setLoggerFactory(org.objectweb.util.monolog.api.LoggerFactory lf)
Setters method to initialize the ConnectionManager A logger factory to obtain a logger |
void |
setMaxPstmtPoolSize(int maxPstmtPoolSize)
|
void |
setPrintWriter(PrintWriter pw)
Setters method to initialize the ConnectionManager The printwriter where event are logged |
void |
setResourceAdapter(ManagedConnectionFactory tmcf)
Setters method to initialize the ConnectionManager The managedConnectionFactory instance of the resource which must be managed by this connectionManager |
void |
setResourceAdapter(ManagedConnectionFactory tmcf,
ConnectionManagerPoolParams cmpp)
Setters method to initialize the ConnectionManager The managedConnectionFactory instance of the resource which must be maneged by this connectionManager |
void |
setResourceManagerEventListener(org.objectweb.transaction.jta.ResourceManagerEventListener rmel)
Setters method to initialize the ConnectionManager The logger instance where events are logged |
void |
setTestStatement(String stmt)
|
void |
setTransactionManager(org.objectweb.transaction.jta.TransactionManager tm)
Setters method to initialize the ConnectionManager The Transaction manager linked to this resource managed |
void |
setXAName(String xanm)
Set the XAName to use |
String |
toString()
Description of the Method |
void |
validateResource(Set res)
If supported, call the ManagedConnectionFactory to validate the ManagedConnections |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static org.objectweb.util.monolog.api.Logger trace
public static org.objectweb.util.monolog.api.Logger poolTrace
protected org.objectweb.transaction.jta.ResourceManagerEventListener rmel
protected org.objectweb.transaction.jta.TransactionManager tm
protected Hashtable mc2mci
public static final String RESOURCE_BUNDLE_NAME
public static final String LOGGER
public static final String POOL_LOGGER
public static final String LOGGER_FACTORY
public static final String TRANSACTION_MANAGER
public static final String RESOURCE_MANAGER_EVENT_LISTENER
public static final String RESOURCE_ADAPTER
public static final String PRINT_WRITER
public static final String NO_TRANS_SUPPORT
public static final String LOCAL_TRANS_SUPPORT
public static final String XA_TRANS_SUPPORT
public static final int PSWRAP_1
public static final int PSWRAP_2
public static final int PSWRAP_3
public static final int PSWRAP_4
public static final int PSWRAP_5
public static final int JDBC_NO_TEST
public static final int JDBC_CHECK_CONNECTION
public static final int JDBC_SEND_STATEMENT
public static final int JDBC_KEEP_ALIVE
Constructor Detail |
---|
public ConnectionManagerImpl(String transSupport)
transSupport
- String defining level of support neededMethod Detail |
---|
public void setLogger(org.objectweb.util.monolog.api.Logger l)
l
- The new Logger valuepublic void setLoggerFactory(org.objectweb.util.monolog.api.LoggerFactory lf)
lf
- The new LoggerFactory valuepublic void setPrintWriter(PrintWriter pw)
pw
- The new PrintWriter valuepublic void setResourceManagerEventListener(org.objectweb.transaction.jta.ResourceManagerEventListener rmel)
rmel
- The new ResourceManagerEventListener valuepublic void setTransactionManager(org.objectweb.transaction.jta.TransactionManager tm)
tm
- TransactionManager valuepublic void setResourceAdapter(ManagedConnectionFactory tmcf) throws Exception
tmcf
- The new ResourceAdapter value
Exception
- Description of Exceptionpublic void setResourceAdapter(ManagedConnectionFactory tmcf, ConnectionManagerPoolParams cmpp) throws Exception
tmcf
- The ManagedConnectionFactory objectcmpp
- The pool parameters
Exception
- Description of Exceptionpublic void init(Context ctx) throws Exception
ctx
- Description of Parameter
Exception
- Description of Exceptionpublic void cleanResourceAdapter() throws ResourceException
ResourceException
- Description of Exceptionpublic Object allocateConnection(ManagedConnectionFactory pMcf, ConnectionRequestInfo cxRequestInfo) throws ResourceException
allocateConnection
in interface ConnectionManager
ResourceException
ConnectionManager
public boolean matchResource(Object res, Object hints)
matchResource
in interface PoolMatchFactory
res
- The Object to test its matching with some
"properties" specified by hints.hints
- The "properties" that the Object specified by pr
should match.
org.objectweb.util.pool.api.PoolMatchFactory
public Object matchResource(Set res, Object hints) throws Exception
matchResource
in interface PoolMatchFactory
res
- A set of Objects to test if matching with some
"properties" specified by hints.hints
- The "properties" that the Object specified by pr
should match.
Exception
- Description of Exceptionorg.objectweb.util.pool.api.PoolMatchFactory
public Object createResource(Object hints) throws Exception
createResource
in interface PoolMatchFactory
hints
- The "properties" that the created Object should
conform to.
Exception
- if an error occursorg.objectweb.util.pool.api.PoolMatchFactory
public void validateResource(Set res) throws Exception
validateResource
in interface PoolMatchFactory
res
- A set of Objects to test if matching with some
"properties" specified by hints.
Exception
- Description of Exceptionorg.objectweb.util.pool.api.PoolMatchFactory
public PreparedStatement getPStatement(ManagedConnectionInfo mcinfo, Object conn, String user, String sql) throws SQLException
getPStatement
in interface SQLManager
mcinfo
- ManagedConnectionInfoconn
- Object connectionuser
- Stringsql
- String
SQLException
- if an Exception occurspublic PreparedStatement getPStatement(ManagedConnectionInfo mcinfo, Object conn, String user, String sql, int resultSetType, int resultSetConcurrency) throws SQLException
SQLManager
getPStatement
in interface SQLManager
mcinfo
- ManagedConnectionInfoconn
- Object connectionuser
- Stringsql
- StringresultSetType
- intresultSetConcurrency
- int
SQLException
- if an Exception occurspublic PreparedStatement getPStatement(ManagedConnectionInfo mcinfo, Object conn, String user, String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
SQLManager
getPStatement
in interface SQLManager
mcinfo
- ManagedConnectionInfoconn
- Object connectionuser
- Stringsql
- StringresultSetType
- intresultSetConcurrency
- intresultSetHoldability
- int
SQLException
- if an Exception occurspublic PreparedStatement getPStatement(ManagedConnectionInfo mcinfo, Object conn, String user, String sql, int autoGeneratedKeys) throws SQLException
SQLManager
getPStatement
in interface SQLManager
mcinfo
- ManagedConnectionInfoconn
- Object connectionuser
- Stringsql
- StringautoGeneratedKeys
- key
SQLException
- if an Exception occurspublic PreparedStatement getPStatement(ManagedConnectionInfo mcinfo, Object conn, String user, String sql, int[] columnIndexes) throws SQLException
SQLManager
getPStatement
in interface SQLManager
mcinfo
- ManagedConnectionInfoconn
- Object connectionuser
- Stringsql
- StringcolumnIndexes
- int []
SQLException
- if an Exception occurspublic PreparedStatement getPStatement(ManagedConnectionInfo mcinfo, Object conn, String user, String sql, String[] columnNames) throws SQLException
SQLManager
getPStatement
in interface SQLManager
mcinfo
- ManagedConnectionInfoconn
- Object connectionuser
- Stringsql
- StringcolumnNames
- String []
SQLException
- if an Exception occurspublic void releaseResource(Object rMc) throws Exception
releaseResource
in interface PoolMatchFactory
rMc
- Object to release
Exception
- if an Exception occurspublic void destroyPStmts(ManagedConnectionInfo mcinfo) throws Exception
mcinfo
- ManagedConnection information
Exception
- Exceptionpublic void connectionClosed(ConnectionEvent event)
connectionClosed
in interface ConnectionEventListener
ConnectionEventListener
public void connectionErrorOccurred(ConnectionEvent event)
connectionErrorOccurred
in interface ConnectionEventListener
ConnectionEventListener
public void localTransactionCommitted(ConnectionEvent event)
localTransactionCommitted
in interface ConnectionEventListener
ConnectionEventListener
public void localTransactionRolledback(ConnectionEvent event)
localTransactionRolledback
in interface ConnectionEventListener
ConnectionEventListener
public void localTransactionStarted(ConnectionEvent event)
localTransactionStarted
in interface ConnectionEventListener
ConnectionEventListener
public String toString()
toString
in class Object
public String getState(String prefix)
prefix
- Description of Parameter
public void setXAName(String xanm)
xanm
- String of XA Namepublic String getXAName()
public void registerXAResource(Properties tmProp)
public void returnXAResource(String rmName, XAResource rmXares)
returnXAResource
in interface org.objectweb.jotm.TransactionResourceManager
rmName
- The Resource Manager to be unregistered.rmXares
- XAResource to be returnedpublic Pool getPool()
public int getCheckLevel()
public void setCheckLevel(int level)
public String getTestStatement()
public void setTestStatement(String stmt)
public int getCurrentInTx()
public int getMaxPstmtPoolSize()
getMaxPstmtPoolSize
in interface SQLManager
public void setMaxPstmtPoolSize(int maxPstmtPoolSize)
maxPstmtPoolSize
- The maxPstmtPoolSize to set.public List getSynchros()
public Map getUsedManagedConnections()
Transaction
)public List getManagedConnectionsWithoutTransaction()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |