Class Trace
java.lang.Object
org.jpos.transaction.participant.Trace
- All Implemented Interfaces:
Configurable, AbortParticipant, TransactionConstants, TransactionParticipant
Diagnostic transaction participant that records a configurable trace label
at each lifecycle phase via
Context.checkPoint(String).-
Field Summary
Fields inherited from interface TransactionConstants
ABORTED, FAIL, NO_JOIN, PAUSE, PREPARED, READONLY, RETRYModifier and TypeFieldDescriptionstatic final intTransaction has been aborted.static final intShortcut for a read-only, non-joining abort (READONLY | NO_JOIN).static final intThis participant does not join the transactionstatic final intTransaction is paused.static final intTransaction has been prepared successfully.static final intContext has not been modified (no need to persist a snapshot)static final intTransaction should be retried. -
Constructor Summary
ConstructorsConstructorDescriptionTrace()Creates the participant; configuration is supplied viasetConfiguration(Configuration). -
Method Summary
Modifier and TypeMethodDescriptionvoidabort(long id, Serializable o) Called by TransactionManager upon transaction commit.voidcommit(long id, Serializable o) Called by TransactionManager upon transaction commit.intprepare(long id, Serializable o) Called by TransactionManager in preparation for a transactionintprepareForAbort(long id, Serializable o) Called by TransactionManager in preparation for a transaction that is known to abort.voidConfigures this object with the suppliedConfiguration.
-
Constructor Details
-
Trace
public Trace()Creates the participant; configuration is supplied viasetConfiguration(Configuration).
-
-
Method Details
-
prepare
Description copied from interface:TransactionParticipantCalled by TransactionManager in preparation for a transaction- Specified by:
preparein interfaceTransactionParticipant- Parameters:
id- the Transaction identifiero- transaction context- Returns:
- PREPARED or ABORTED (| NO_JOIN | READONLY)
-
commit
Description copied from interface:TransactionParticipantCalled by TransactionManager upon transaction commit. Warning: implementation should be able to handle multiple calls with the same transaction id (rare crash recovery)- Specified by:
commitin interfaceTransactionParticipant- Parameters:
id- the Transaction identifiero- transaction context
-
abort
Description copied from interface:TransactionParticipantCalled by TransactionManager upon transaction commit. Warning: implementation should be able to handle multiple calls with the same transaction id (rare crash recovery)- Specified by:
abortin interfaceTransactionParticipant- Parameters:
id- the Transaction identifiero- transaction context
-
prepareForAbort
Description copied from interface:AbortParticipantCalled by TransactionManager in preparation for a transaction that is known to abort.- Specified by:
prepareForAbortin interfaceAbortParticipant- Parameters:
id- the Transaction identifiero- transaction context- Returns:
- 0 [| NO_JOIN | READONLY)
-
setConfiguration
Description copied from interface:ConfigurableConfigures this object with the suppliedConfiguration.- Specified by:
setConfigurationin interfaceConfigurable- Parameters:
cfg- Configuration object
-