@ComponentProfile(summary="A Transaction Manager that refers to another Transaction Manager configured elsewhere", tag="transactionManager,base") public class SharedTransactionManager extends SharedComponent implements TransactionManager
Modifier and Type | Field and Description |
---|---|
protected org.slf4j.Logger |
log |
Constructor and Description |
---|
SharedTransactionManager() |
SharedTransactionManager(java.lang.String lookupName) |
Modifier and Type | Method and Description |
---|---|
void |
beginTransaction() |
void |
close()
Closes the component.
|
boolean |
commit() |
void |
delistXAResource(java.lang.String name,
javax.transaction.xa.XAResource xaResource,
int status) |
void |
deRegisterXAResource(java.lang.String name,
javax.jms.XAConnectionFactory connectionFactory) |
void |
enlistXAResource(java.lang.String name,
javax.transaction.xa.XAResource xaResource) |
java.lang.String |
getLookupName()
Returns the exact name to bind this object to our
Context . |
java.lang.String |
getUniqueId()
Get the unique-id that is associated with this component.
|
void |
init()
Initialises the component.
|
void |
prepare()
Prepare for initialisation.
|
TransactionManager |
proxiedTransactionManager() |
void |
registerXAResource(java.lang.String name,
javax.jms.XAConnectionFactory connectionFactory) |
void |
rollback() |
void |
setLookupName(java.lang.String lookupName) |
void |
setRollbackOnly() |
void |
start()
Starts the component.
|
void |
stop()
Stop the component
|
boolean |
transactionIsActive() |
triggerJndiLookup
public SharedTransactionManager()
public SharedTransactionManager(java.lang.String lookupName)
public java.lang.String getLookupName()
JndiBindable
Context
.
Specifying a lookupName will not be modified at all when binding to jndi. Therefore you may want to prepend your own chosen subcontexts in this name e.g. "comp/env/"
getLookupName
in interface JndiBindable
public void setLookupName(java.lang.String lookupName)
public void init() throws CoreException
ComponentLifecycle
Component initialisation includes config verification, creation of connections etc.
init
in interface ComponentLifecycle
CoreException
- wrapping any underlying Exception
spublic void start() throws CoreException
ComponentLifecycle
Once a component is started it should be ready to process messages. In the case of AdaptrisMessageConsumer
, calling start
will begin message delivery.
start
in interface ComponentLifecycle
CoreException
- wrapping any underlying Exception
spublic void stop()
ComponentLifecycle
A stopped component is not expected to be ready to process messages. In the case of AdaptrisMessageConsumer
, calling stop
will pause message delivery. Throwing a RuntimeException
may cause unintended consequences
stop
in interface ComponentLifecycle
public void close()
ComponentLifecycle
A closed component should release any connections it uses, etc. and clean up completely. Throwing a RuntimeException
may
cause unintended consequences
close
in interface ComponentLifecycle
public void prepare() throws CoreException
ComponentLifecycleExtension
prepare
in interface ComponentLifecycleExtension
CoreException
public java.lang.String getUniqueId()
AdaptrisComponent
getUniqueId
in interface AdaptrisComponent
public void registerXAResource(java.lang.String name, javax.jms.XAConnectionFactory connectionFactory) throws java.lang.Exception
registerXAResource
in interface TransactionManager
java.lang.Exception
public void deRegisterXAResource(java.lang.String name, javax.jms.XAConnectionFactory connectionFactory) throws java.lang.Exception
deRegisterXAResource
in interface TransactionManager
java.lang.Exception
public void enlistXAResource(java.lang.String name, javax.transaction.xa.XAResource xaResource) throws java.lang.Exception
enlistXAResource
in interface TransactionManager
java.lang.Exception
public void delistXAResource(java.lang.String name, javax.transaction.xa.XAResource xaResource, int status) throws java.lang.Exception
delistXAResource
in interface TransactionManager
java.lang.Exception
public void beginTransaction() throws java.lang.Exception
beginTransaction
in interface TransactionManager
java.lang.Exception
public boolean commit() throws java.lang.Exception
commit
in interface TransactionManager
java.lang.Exception
public void rollback() throws java.lang.Exception
rollback
in interface TransactionManager
java.lang.Exception
public boolean transactionIsActive() throws java.lang.Exception
transactionIsActive
in interface TransactionManager
java.lang.Exception
public void setRollbackOnly() throws java.lang.Exception
setRollbackOnly
in interface TransactionManager
java.lang.Exception
public TransactionManager proxiedTransactionManager()