|
jremote jbase5.2.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jbase.jremote.jca.spring.JConnectionFactoryUtils
public abstract class JConnectionFactoryUtils
Helper class that provides static methods for obtaining JRemote Connections
from a JConnectionFactory
. Includes special
support for Spring-managed transactional Connections, e.g. managed
by JRemoteLocalTransactionManager
or
JtaTransactionManager
.
getConnection(com.jbase.jremote.JConnectionFactory)
,
releaseConnection(com.jbase.jremote.JConnection, com.jbase.jremote.JConnectionFactory)
,
JRemoteLocalTransactionManager
,
JtaTransactionManager
,
TransactionSynchronizationManager
Constructor Summary | |
---|---|
JConnectionFactoryUtils()
|
Method Summary | |
---|---|
static JConnection |
getConnection(JConnectionFactory cf)
Obtain a JConnection from the given JConnectionFactory. |
static boolean |
isConnectionTransactional(JConnection con,
JConnectionFactory cf)
Determine whether the given JRemote Connection is transactional, that is, bound to the current thread by Spring's transaction facilities. |
static void |
releaseConnection(JConnection con,
JConnectionFactory cf)
Close the given JConnection, obtained from the given JConnectionFactory, if it is not managed externally (that is, not bound to the thread). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JConnectionFactoryUtils()
Method Detail |
---|
public static JConnection getConnection(JConnectionFactory cf) throws JRemoteException
Is aware of a corresponding Connection bound to the current thread, for example
when using JRemoteLocalTransactionManager
. Will bind a Connection to the thread
if transaction synchronization is active (e.g. if in a JTA transaction).
cf
- the ConnectionFactory to obtain Connection from
JRemoteException
- if the attempt to get a Connection failedreleaseConnection(com.jbase.jremote.JConnection, com.jbase.jremote.JConnectionFactory)
public static boolean isConnectionTransactional(JConnection con, JConnectionFactory cf)
con
- the JConnection to checkcf
- the JConnectionFactory that the JConnection was obtained from
(may be null
)
public static void releaseConnection(JConnection con, JConnectionFactory cf)
con
- the Connection to close if necessary
(if this is null
, the call will be ignored)cf
- the ConnectionFactory that the Connection was obtained from
(can be null
)getConnection(com.jbase.jremote.JConnectionFactory)
|
jremote jbase5.2.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |