Package com.adaptris.core.transaction
Class SharedTransactionManager
- java.lang.Object
-
- com.adaptris.core.SharedComponent
-
- com.adaptris.core.transaction.SharedTransactionManager
-
- All Implemented Interfaces:
AdaptrisComponent
,ComponentLifecycle
,ComponentLifecycleExtension
,TransactionManager
@ComponentProfile(summary="A Transaction Manager that refers to another Transaction Manager configured elsewhere", tag="transactionManager,base") public class SharedTransactionManager extends SharedComponent implements TransactionManager
-
-
Field Summary
Fields Modifier and Type Field Description protected org.slf4j.Logger
log
-
Constructor Summary
Constructors Constructor Description SharedTransactionManager()
SharedTransactionManager(java.lang.String lookupName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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()
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 componentboolean
transactionIsActive()
-
Methods inherited from class com.adaptris.core.SharedComponent
triggerJndiLookup
-
-
-
-
Method Detail
-
getLookupName
public java.lang.String getLookupName()
-
setLookupName
public void setLookupName(java.lang.String lookupName)
-
init
public void init() throws CoreException
Description copied from interface:ComponentLifecycle
Initialises the component.Component initialisation includes config verification, creation of connections etc.
- Specified by:
init
in interfaceComponentLifecycle
- Throws:
CoreException
- wrapping any underlyingException
s
-
start
public void start() throws CoreException
Description copied from interface:ComponentLifecycle
Starts the component.Once a component is started it should be ready to process messages. In the case of
AdaptrisMessageConsumer
, calling start will begin message delivery.- Specified by:
start
in interfaceComponentLifecycle
- Throws:
CoreException
- wrapping any underlyingException
s
-
stop
public void stop()
Description copied from interface:ComponentLifecycle
Stop the componentA stopped component is not expected to be ready to process messages. In the case of
AdaptrisMessageConsumer
, calling stop will pause message delivery. Throwing aRuntimeException
may cause unintended consequences- Specified by:
stop
in interfaceComponentLifecycle
-
close
public void close()
Description copied from interface:ComponentLifecycle
Closes the component.A closed component should release any connections it uses, etc. and clean up completely. Throwing a
RuntimeException
may cause unintended consequences- Specified by:
close
in interfaceComponentLifecycle
-
prepare
public void prepare() throws CoreException
Description copied from interface:ComponentLifecycleExtension
Prepare for initialisation.- Specified by:
prepare
in interfaceComponentLifecycleExtension
- Throws:
CoreException
-
getUniqueId
public java.lang.String getUniqueId()
Description copied from interface:AdaptrisComponent
Get the unique-id that is associated with this component.- Specified by:
getUniqueId
in interfaceAdaptrisComponent
- Returns:
- the unique-id
-
registerXAResource
public void registerXAResource(java.lang.String name, javax.jms.XAConnectionFactory connectionFactory) throws java.lang.Exception
- Specified by:
registerXAResource
in interfaceTransactionManager
- Throws:
java.lang.Exception
-
deRegisterXAResource
public void deRegisterXAResource(java.lang.String name, javax.jms.XAConnectionFactory connectionFactory) throws java.lang.Exception
- Specified by:
deRegisterXAResource
in interfaceTransactionManager
- Throws:
java.lang.Exception
-
enlistXAResource
public void enlistXAResource(java.lang.String name, javax.transaction.xa.XAResource xaResource) throws java.lang.Exception
- Specified by:
enlistXAResource
in interfaceTransactionManager
- Throws:
java.lang.Exception
-
delistXAResource
public void delistXAResource(java.lang.String name, javax.transaction.xa.XAResource xaResource, int status) throws java.lang.Exception
- Specified by:
delistXAResource
in interfaceTransactionManager
- Throws:
java.lang.Exception
-
beginTransaction
public void beginTransaction() throws java.lang.Exception
- Specified by:
beginTransaction
in interfaceTransactionManager
- Throws:
java.lang.Exception
-
commit
public boolean commit() throws java.lang.Exception
- Specified by:
commit
in interfaceTransactionManager
- Throws:
java.lang.Exception
-
rollback
public void rollback() throws java.lang.Exception
- Specified by:
rollback
in interfaceTransactionManager
- Throws:
java.lang.Exception
-
transactionIsActive
public boolean transactionIsActive() throws java.lang.Exception
- Specified by:
transactionIsActive
in interfaceTransactionManager
- Throws:
java.lang.Exception
-
setRollbackOnly
public void setRollbackOnly() throws java.lang.Exception
- Specified by:
setRollbackOnly
in interfaceTransactionManager
- Throws:
java.lang.Exception
-
proxiedTransactionManager
public TransactionManager proxiedTransactionManager()
-
-