|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atomikos.icatch.imp.BaseTransactionManager
public class BaseTransactionManager
Abstract TM class, to be extended for different communication layers. For instance, transactional RMI could be one extension, JTS another one.
Constructor Summary | |
---|---|
protected |
BaseTransactionManager()
Constructor. |
Method Summary | |
---|---|
void |
committed(CompositeTransaction tx)
Called if a tx is ended successfully. |
CompositeTransaction |
createCompositeTransaction(long timeout)
Starts a new (sub)transaction (not an activity) for the current thread. |
CompositeTransaction |
getCompositeTransaction()
Gets the composite transaction for the current thread. |
CompositeTransaction |
getCompositeTransaction(String tid)
Gets the composite transaction with the given id. |
Participant |
getParticipant(String root)
Get the participant for the given root. |
void |
init(TransactionServiceImp service,
Properties properties)
Initialize the TM. |
protected void |
printMsg(String msg,
int level)
Print a message to the console, with the given level of detail. |
protected CompositeTransaction |
recreateCompositeTransaction(Propagation context,
boolean orphancheck,
boolean heur_commit)
Recreate a composite transaction based on an imported context. |
void |
resume(CompositeTransaction ct)
Re-maps the thread to the given tx. |
void |
rolledback(CompositeTransaction tx)
Called if a tx is ended with failure. |
void |
shutdown(boolean force)
Shut down the server in a clean way. |
protected void |
startlistening(CompositeTransaction transaction)
|
CompositeTransaction |
suspend()
Suspends the tx for the current thread. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected BaseTransactionManager()
Method Detail |
---|
protected void printMsg(String msg, int level)
msg
- level
- public void init(TransactionServiceImp service, Properties properties) throws SysException
service
- The tx service to use. As part of this method, the service
will also be initialized.properties
- The init properties.
SysException
public Participant getParticipant(String root)
root
-
public void committed(CompositeTransaction tx)
committed
in interface SubTxAwareParticipant
tx
- The composite transaction that has terminated
locally at its node.SubTxAwareParticipant
public void rolledback(CompositeTransaction tx)
rolledback
in interface SubTxAwareParticipant
SubTxAwareParticipant
public CompositeTransaction getCompositeTransaction() throws SysException
CompositeTransactionManager
getCompositeTransaction
in interface CompositeTransactionManager
SysException
- Unexpected failure.CompositeTransactionManager
public CompositeTransaction getCompositeTransaction(String tid) throws SysException
CompositeTransactionManager
getCompositeTransaction
in interface CompositeTransactionManager
tid
- The id of the transaction.
SysException
- Unexpected failure.CompositeTransactionManager
protected CompositeTransaction recreateCompositeTransaction(Propagation context, boolean orphancheck, boolean heur_commit) throws SysException
context
- The propagationcontext.orphancheck
- If true, real composite txs are done. If false, OTS like
behavior applies.heur_commit
- True for heuristic commit, false for heuristic rollback.
SysException
- Failure.public CompositeTransaction suspend() throws SysException
CompositeTransactionManager
suspend
in interface CompositeTransactionManager
SysException
- On failure.CompositeTransactionManager
public void resume(CompositeTransaction ct) throws IllegalStateException, SysException
CompositeTransactionManager
resume
in interface CompositeTransactionManager
ct
- The CompositeTransaction to resume.
IllegalStateException
- If thread has tx already.
SysException
- Unexpected failure.CompositeTransactionManager
public void shutdown(boolean force) throws SysException, IllegalStateException
force
- If true, shutdown will not wait for possibly indoubt txs to
finish. Calling shutdown with force being true implies that
shutdown will not fail, but there may be remaining timer
threads that stay asleep until there timeouts expire. Such
remaining active transactions will NOT be able to finish,
because the recovery manager will be shutdown by that time.
New transactions will not be allowed.
SysException
- For unexpected errors.
IllegalStateException
- If active txs exist, and not force.protected void startlistening(CompositeTransaction transaction) throws SysException
SysException
public CompositeTransaction createCompositeTransaction(long timeout) throws SysException
CompositeTransactionManager
createCompositeTransaction
in interface CompositeTransactionManager
SysException
- Unexpected error.CompositeTransactionManager
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |