Class Debug
java.lang.Object
org.jpos.util.Log
org.jpos.transaction.participant.Debug
- All Implemented Interfaces:
AbortParticipant, TransactionConstants, TransactionParticipant, LogSource
Diagnostic transaction participant that logs the
Context at every
lifecycle phase, useful for tracing TM behaviour during development.-
Field Summary
Fields inherited from class Log
DEBUG, defaultTags, ERROR, FATAL, INFO, logger, realm, TRACE, WARNModifier and TypeFieldDescriptionstatic final StringLevel constant for debug events.Default tags applied to everyLogEventcreated by thisLog.static final StringLevel constant for error events.static final StringLevel constant for fatal events.static final StringLevel constant for informational events.protected LoggerLogger receiving the events produced by thisLog.protected StringRealm associated with events emitted through thisLog.static final StringLevel constant for trace events.static final StringLevel constant for warning events.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
Constructors -
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.Methods inherited from class Log
applyDefaultTags, createDebug, createDebug, createError, createError, createFatal, createFatal, createInfo, createInfo, createLogEvent, createLogEvent, createTrace, createTrace, createWarn, createWarn, debug, debug, error, error, fatal, fatal, getDefaultTags, getLog, getLogger, getRealm, info, info, removeDefaultTag, setDefaultTag, setDefaultTags, setLogger, setLogger, setRealm, trace, trace, warn, warnModifier and TypeMethodDescriptionprotected LogEventapplyDefaultTags(LogEvent evt) Decoratesevtwith thisLog's default tags, if any.Creates an empty debug-level event.createDebug(Object detail) Creates a debug-level event with the given payload.Creates an empty error-level event.createError(Object detail) Creates an error-level event with the given payload.Creates an empty fatal-level event.createFatal(Object detail) Creates a fatal-level event with the given payload.Creates an empty info-level event.createInfo(Object detail) Creates an info-level event with the given payload.createLogEvent(String level) Creates a newLogEventat the given level decorated with thisLog's default tags.createLogEvent(String level, Object detail) Creates a newLogEventat the given level with an initial payload.Creates an empty trace-level event.createTrace(Object detail) Creates a trace-level event with the given payload.Creates an empty warning-level event.createWarn(Object detail) Creates a warning-level event with the given payload.voidLogs a debug event with the given detail.voidLogs a debug event with the given detail and an additional payload.voidLogs an error event with the given detail.voidLogs an error event with the given detail and an additional payload.voidLogs a fatal event with the given detail.voidLogs a fatal event with the given detail and an additional payload.Returns an unmodifiable snapshot of the current default tags.static LogConvenience factory returning aLogbound to the given logger name and realm.Returns the underlying logger.getRealm()Returns the realm associated with events emitted through thisLog.voidLogs an info event with the given detail.voidLogs an info event with the given detail and an additional payload.voidremoveDefaultTag(String key) Removes a previously-registered default tag.voidsetDefaultTag(String key, String value) Sets a default tag on every event produced by thisLog; anullvalue removes the entry.voidsetDefaultTags(Map<String, String> tags) Replaces the entire set of default tags.voidReplaces the underlying logger, leaving the realm unchanged.voidReplaces the underlying logger and realm.voidReplaces the realm associated with emitted events.voidLogs a trace event with the given detail.voidLogs a trace event with the given detail and an additional payload.voidLogs a warning event with the given detail.voidLogs a warning event with the given detail and an additional payload.
-
Constructor Details
-
Debug
public Debug()Default constructor; no instance state to initialise.
-
-
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)
-