|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.jonas.resource.ConnectionManagerImpl
Description of the ConnectionManagerImpl
Field Summary | |
protected static org.objectweb.util.monolog.api.Logger |
conTrace
Connection Management logger |
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
|
protected java.lang.String |
jndiname
The jndiname of the associated factory |
static java.lang.String |
JNDINAME
This constant is used in the by the init method |
static java.lang.String |
LOCAL_TRANS_SUPPORT
Rar supports local transactions |
static java.lang.String |
LOGGER
This constant is used in the by the init method |
static java.lang.String |
LOGGER_FACTORY
This constant is used in the by the init method |
protected java.util.Hashtable |
mc2mci
This hashtable allows to find the list of connection handle associated to a ManagedConnection |
protected java.util.Vector |
mcs
The list of managedConnection used without transaction |
static java.lang.String |
NO_TRANS_SUPPORT
Rar doesn't support transactions |
static java.lang.String |
POOL_LOGGER
This constant is used in the by the init method |
protected Pool |
poolMCs
The pool of ManagedConnections associated to a ManagedConnectionFactory There's one instance of pool by instance for one instance of this class (ConnectionManagerImpl). |
protected static org.objectweb.util.monolog.api.Logger |
poolTrace
Pool infomation logger |
static java.lang.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 java.lang.String |
RESOURCE_ADAPTER
This constant is used in the by the init method |
static java.lang.String |
RESOURCE_BUNDLE_NAME
This constant is used in the by the init method |
static java.lang.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 java.util.Vector |
synchros
The list of Synchronisation instance managed in this ConnectionManager |
protected org.objectweb.transaction.jta.TransactionManager |
tm
The transaction manager in server |
protected static org.objectweb.util.monolog.api.Logger |
trace
Main logger |
static java.lang.String |
TRANSACTION_MANAGER
This constant is used in the by the init method |
protected java.util.Hashtable |
usedMCs
The list of used ManagedConnections key = transaction reference value = MCInfo |
static java.lang.String |
XA_TRANS_SUPPORT
Rar supports XA transactions |
Constructor Summary | |
ConnectionManagerImpl(java.lang.String transSupport)
ConnectionManagerImpl constructor |
Method Summary | |
java.lang.Object |
allocateConnection(javax.resource.spi.ManagedConnectionFactory pMcf,
javax.resource.spi.ConnectionRequestInfo cxRequestInfo)
The method allocateConnection gets called by the resource adapter's connection factory instance. |
void |
cleanResourceAdapter()
Description of the Method |
void |
connectionClosed(javax.resource.spi.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(javax.resource.spi.ConnectionEvent event)
The connectionErrorOccurred method indicates that the associated ManagedConnection instance is now invalid and unusable. |
java.lang.Object |
createResource(java.lang.Object hints)
Call the ManagedConnectionFactory in order to create a new instance. |
void |
destroyPStmts(MCInfo mcinfo)
Destroying of the PreparedStatement objects of the Pool |
void |
forceCloseConnection(int connectionId)
force the close of the Connection identified by ots Id |
int |
getCheckLevel()
|
java.util.Map |
getConnectionDetails(int connectionId)
Return a Map with details about a Connection |
int |
getCurrentInTx()
|
int |
getMaxPstmtPoolSize()
|
int[] |
getOpenedConnections()
return a list of idents that represent the connections opened for a given nb of seconds |
int[] |
getOpenedConnections(int usedTimeSec)
return a list of idents that represent the connections opened for a given nb of seconds |
Pool |
getPool()
|
java.sql.PreparedStatement |
getPStatement(MCInfo mcinfo,
java.lang.Object conn,
java.lang.String user,
java.lang.String sql)
Get the specified PreparedStatement |
java.sql.PreparedStatement |
getPStatement(MCInfo mcinfo,
java.lang.Object conn,
java.lang.String user,
java.lang.String sql,
int autoGeneratedKeys)
Get the specified PreparedStatement |
java.sql.PreparedStatement |
getPStatement(MCInfo mcinfo,
java.lang.Object conn,
java.lang.String user,
java.lang.String sql,
int[] columnIndexes)
Get the specified PreparedStatement |
java.sql.PreparedStatement |
getPStatement(MCInfo mcinfo,
java.lang.Object conn,
java.lang.String user,
java.lang.String sql,
int resultSetType,
int resultSetConcurrency)
Get the specified PreparedStatement |
java.sql.PreparedStatement |
getPStatement(MCInfo mcinfo,
java.lang.Object conn,
java.lang.String user,
java.lang.String sql,
int resultSetType,
int resultSetConcurrency,
int resultSetHoldability)
Get the specified PreparedStatement |
java.sql.PreparedStatement |
getPStatement(MCInfo mcinfo,
java.lang.Object conn,
java.lang.String user,
java.lang.String sql,
java.lang.String[] columnNames)
Get the specified PreparedStatement |
protected java.lang.String |
getState(java.lang.String prefix)
Gets the State attribute of the ConnectionManagerImpl object |
java.lang.String |
getTestStatement()
|
java.lang.String |
getXAName()
Get the XAName to use |
void |
init(javax.naming.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. |
boolean |
isObservable()
|
void |
localTransactionCommitted(javax.resource.spi.ConnectionEvent event)
Notifies that a Resource Manager Local Transaction was committed on the ManagedConnection instance. |
void |
localTransactionRolledback(javax.resource.spi.ConnectionEvent event)
Notifies that a Resource Manager Local Transaction was rolled back on the ManagedConnection instance. |
void |
localTransactionStarted(javax.resource.spi.ConnectionEvent event)
Notifies that a Resource Manager Local Transaction was started on the ManagedConnection instance. |
boolean |
matchResource(java.lang.Object res,
java.lang.Object hints)
All method of the pool match to the right type of ManagedConnection because there is one pool by ManagedConnectionFactory. |
java.lang.Object |
matchResource(java.util.Set res,
java.lang.Object hints)
All method of the pool match to the right type of ManagedConnection because there is one pool by ManagedConnectionFactory. |
void |
registerXAResource(java.util.Properties tmProp)
Register an XAResource with JOTM for recovery |
void |
releaseResource(java.lang.Object rMc)
Release the ManagedConnection object resource |
void |
returnXAResource(java.lang.String rmName,
javax.transaction.xa.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 |
setObservable(boolean observable)
|
void |
setPrintWriter(java.io.PrintWriter pw)
Setters method to initialize the ConnectionManager The printwriter where event are logged |
void |
setResourceAdapter(javax.resource.spi.ManagedConnectionFactory tmcf)
Setters method to initialize the ConnectionManager The managedConnectionFactory instance of the resource which must be managed by this connectionManager |
void |
setResourceAdapter(javax.resource.spi.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(java.lang.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(java.lang.String xanm)
Set the XAName to use |
java.lang.String |
toString()
Description of the Method |
void |
validateResource(java.util.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 |
protected static org.objectweb.util.monolog.api.Logger trace
protected static org.objectweb.util.monolog.api.Logger conTrace
protected static org.objectweb.util.monolog.api.Logger poolTrace
protected org.objectweb.transaction.jta.ResourceManagerEventListener rmel
protected org.objectweb.transaction.jta.TransactionManager tm
protected java.util.Hashtable mc2mci
protected java.lang.String jndiname
protected Pool poolMCs
protected java.util.Hashtable usedMCs
protected java.util.Vector mcs
protected java.util.Vector synchros
public static final java.lang.String RESOURCE_BUNDLE_NAME
public static final java.lang.String LOGGER
public static final java.lang.String POOL_LOGGER
public static final java.lang.String JNDINAME
public static final java.lang.String LOGGER_FACTORY
public static final java.lang.String TRANSACTION_MANAGER
public static final java.lang.String RESOURCE_MANAGER_EVENT_LISTENER
public static final java.lang.String RESOURCE_ADAPTER
public static final java.lang.String PRINT_WRITER
public static final java.lang.String NO_TRANS_SUPPORT
public static final java.lang.String LOCAL_TRANS_SUPPORT
public static final java.lang.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(java.lang.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(java.io.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(javax.resource.spi.ManagedConnectionFactory tmcf) throws java.lang.Exception
tmcf
- The new ResourceAdapter value
java.lang.Exception
- Description of Exceptionpublic void setResourceAdapter(javax.resource.spi.ManagedConnectionFactory tmcf, ConnectionManagerPoolParams cmpp) throws java.lang.Exception
tmcf
- The ManagedConnectionFactory objectcmpp
- The pool parameters
java.lang.Exception
- Description of Exceptionpublic void init(javax.naming.Context ctx) throws java.lang.Exception
ctx
- Description of Parameter
java.lang.Exception
- Description of Exceptionpublic void cleanResourceAdapter() throws javax.resource.ResourceException
javax.resource.ResourceException
- Description of Exceptionpublic java.lang.Object allocateConnection(javax.resource.spi.ManagedConnectionFactory pMcf, javax.resource.spi.ConnectionRequestInfo cxRequestInfo) throws javax.resource.ResourceException
allocateConnection
in interface javax.resource.spi.ConnectionManager
javax.resource.ResourceException
ConnectionManager
public boolean matchResource(java.lang.Object res, java.lang.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.
PoolMatchFactory
public java.lang.Object matchResource(java.util.Set res, java.lang.Object hints) throws java.lang.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.
java.lang.Exception
- Description of ExceptionPoolMatchFactory
public java.lang.Object createResource(java.lang.Object hints) throws java.lang.Exception
createResource
in interface PoolMatchFactory
hints
- The "properties" that the created Object should
conform to.
java.lang.Exception
- if an error occursPoolMatchFactory
public void validateResource(java.util.Set res) throws java.lang.Exception
validateResource
in interface PoolMatchFactory
res
- A set of Objects to test if matching with some
"properties" specified by hints.
java.lang.Exception
- Description of ExceptionPoolMatchFactory
public java.sql.PreparedStatement getPStatement(MCInfo mcinfo, java.lang.Object conn, java.lang.String user, java.lang.String sql) throws java.sql.SQLException
SQLManager
getPStatement
in interface SQLManager
mcinfo
- MCInfoconn
- Object connectionuser
- Stringsql
- String
java.sql.SQLException
- if an Exception occurspublic java.sql.PreparedStatement getPStatement(MCInfo mcinfo, java.lang.Object conn, java.lang.String user, java.lang.String sql, int resultSetType, int resultSetConcurrency) throws java.sql.SQLException
SQLManager
getPStatement
in interface SQLManager
mcinfo
- MCInfoconn
- Object connectionuser
- Stringsql
- StringresultSetType
- intresultSetConcurrency
- int
java.sql.SQLException
- if an Exception occurspublic java.sql.PreparedStatement getPStatement(MCInfo mcinfo, java.lang.Object conn, java.lang.String user, java.lang.String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws java.sql.SQLException
SQLManager
getPStatement
in interface SQLManager
mcinfo
- MCInfoconn
- Object connectionuser
- Stringsql
- StringresultSetType
- intresultSetConcurrency
- intresultSetHoldability
- int
java.sql.SQLException
- if an Exception occurspublic java.sql.PreparedStatement getPStatement(MCInfo mcinfo, java.lang.Object conn, java.lang.String user, java.lang.String sql, int autoGeneratedKeys) throws java.sql.SQLException
SQLManager
getPStatement
in interface SQLManager
mcinfo
- MCInfoconn
- Object connectionuser
- Stringsql
- StringautoGeneratedKeys
- key
java.sql.SQLException
- if an Exception occurspublic java.sql.PreparedStatement getPStatement(MCInfo mcinfo, java.lang.Object conn, java.lang.String user, java.lang.String sql, int[] columnIndexes) throws java.sql.SQLException
SQLManager
getPStatement
in interface SQLManager
mcinfo
- MCInfoconn
- Object connectionuser
- Stringsql
- StringcolumnIndexes
- int []
java.sql.SQLException
- if an Exception occurspublic java.sql.PreparedStatement getPStatement(MCInfo mcinfo, java.lang.Object conn, java.lang.String user, java.lang.String sql, java.lang.String[] columnNames) throws java.sql.SQLException
SQLManager
getPStatement
in interface SQLManager
mcinfo
- MCInfoconn
- Object connectionuser
- Stringsql
- StringcolumnNames
- String []
java.sql.SQLException
- if an Exception occurspublic void releaseResource(java.lang.Object rMc) throws java.lang.Exception
releaseResource
in interface PoolMatchFactory
rMc
- Object to release
java.lang.Exception
- if an Exception occurspublic void destroyPStmts(MCInfo mcinfo) throws java.lang.Exception
mcinfo
- ManagedConnection information
java.lang.Exception
- Exceptionpublic void connectionClosed(javax.resource.spi.ConnectionEvent event)
connectionClosed
in interface javax.resource.spi.ConnectionEventListener
ConnectionEventListener
public void connectionErrorOccurred(javax.resource.spi.ConnectionEvent event)
connectionErrorOccurred
in interface javax.resource.spi.ConnectionEventListener
ConnectionEventListener
public void localTransactionCommitted(javax.resource.spi.ConnectionEvent event)
localTransactionCommitted
in interface javax.resource.spi.ConnectionEventListener
ConnectionEventListener
public void localTransactionRolledback(javax.resource.spi.ConnectionEvent event)
localTransactionRolledback
in interface javax.resource.spi.ConnectionEventListener
ConnectionEventListener
public void localTransactionStarted(javax.resource.spi.ConnectionEvent event)
localTransactionStarted
in interface javax.resource.spi.ConnectionEventListener
ConnectionEventListener
public java.lang.String toString()
protected java.lang.String getState(java.lang.String prefix)
prefix
- Description of Parameter
public void setXAName(java.lang.String xanm)
xanm
- String of XA Namepublic java.lang.String getXAName()
public void registerXAResource(java.util.Properties tmProp)
public void returnXAResource(java.lang.String rmName, javax.transaction.xa.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 java.lang.String getTestStatement()
public void setTestStatement(java.lang.String stmt)
public boolean isObservable()
public void setObservable(boolean observable)
observable
- the observable to setpublic int getCurrentInTx()
public int getMaxPstmtPoolSize()
getMaxPstmtPoolSize
in interface SQLManager
public void setMaxPstmtPoolSize(int maxPstmtPoolSize)
maxPstmtPoolSize
- The maxPstmtPoolSize to set.public int[] getOpenedConnections(int usedTimeSec)
usedTimeSec
- nb of seconds the Connection has been opened
public int[] getOpenedConnections()
public void forceCloseConnection(int connectionId)
connectionId
- int that represent the Connectionpublic java.util.Map getConnectionDetails(int connectionId)
connectionId
- Ident that represent the connection
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |