Package org.apache.openjpa.kernel
Class AuditManager
java.lang.Object
org.apache.openjpa.kernel.InMemorySavepointManager
org.apache.openjpa.kernel.AuditManager
- All Implemented Interfaces:
PCRegistry.RegisterClassListener,BeginTransactionListener,EndTransactionListener,FlushTransactionListener,TransactionListener,SavepointManager
public class AuditManager
extends InMemorySavepointManager
implements TransactionListener, PCRegistry.RegisterClassListener
Controller for audit facility.
This controller performs the following basic duties:
Records auditable types at class loading time
Listens to instance life cycle changes and transaction.
Collects auditable instances on instance life cycle changes.
Delegates real auditing to the
Auditor at transaction boundary.- Author:
- Pinaki Poddar
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafterBegin(TransactionEvent event) ----------------------------------------------------------------------- Transaction callbacksvoidafterCommit(TransactionEvent event) Notification that a transaction has successfully committed.voidNotification that a transaction has successfully committed and the transaction is no longer active.voidafterFlush(TransactionEvent event) Notification that a transaction has flushed all object changes.voidafterRollback(TransactionEvent event) Notification that a transaction has been rolled back.voidNotification that a transaction has been rolled back and the transaction is no longer active.voidNotification that state transitions are complete.voidbeforeCommit(TransactionEvent event) Notification that the next flush is for the transaction commit.voidbeforeFlush(TransactionEvent event) Notification that a transaction is about to flush all object changes.protected BrokerExtracts the broker from the given persistence capable instance.protected PersistenceCapableExtracts the persistence capable instance from the source of the given event.protected booleanAffirms if the given state manager is auditable for the given operation.voidRecords all auditable classes in operation-specific sets.Methods inherited from class org.apache.openjpa.kernel.InMemorySavepointManager
getPreFlush, newSavepoint, setPreFlush, supportsIncrementalFlush
-
Constructor Details
-
AuditManager
-
-
Method Details
-
register
Records all auditable classes in operation-specific sets.- Specified by:
registerin interfacePCRegistry.RegisterClassListener
-
getAuditor
-
getAuditedTypes
-
afterBegin
----------------------------------------------------------------------- Transaction callbacks. ------------------------------------------------------------------------ Specified by:
afterBeginin interfaceBeginTransactionListener- See Also:
-
beforeCommit
Description copied from interface:EndTransactionListenerNotification that the next flush is for the transaction commit.- Specified by:
beforeCommitin interfaceEndTransactionListener- See Also:
-
afterCommit
Description copied from interface:EndTransactionListenerNotification that a transaction has successfully committed.- Specified by:
afterCommitin interfaceEndTransactionListener- See Also:
-
afterRollback
Description copied from interface:EndTransactionListenerNotification that a transaction has been rolled back.- Specified by:
afterRollbackin interfaceEndTransactionListener- See Also:
-
afterCommitComplete
Description copied from interface:EndTransactionListenerNotification that a transaction has successfully committed and the transaction is no longer active.- Specified by:
afterCommitCompletein interfaceEndTransactionListener- See Also:
-
afterRollbackComplete
Description copied from interface:EndTransactionListenerNotification that a transaction has been rolled back and the transaction is no longer active.- Specified by:
afterRollbackCompletein interfaceEndTransactionListener- See Also:
-
beforeFlush
Description copied from interface:FlushTransactionListenerNotification that a transaction is about to flush all object changes.- Specified by:
beforeFlushin interfaceFlushTransactionListener- See Also:
-
afterFlush
Description copied from interface:FlushTransactionListenerNotification that a transaction has flushed all object changes.- Specified by:
afterFlushin interfaceFlushTransactionListener- See Also:
-
afterStateTransitions
Description copied from interface:EndTransactionListenerNotification that state transitions are complete.- Specified by:
afterStateTransitionsin interfaceEndTransactionListener- See Also:
-
getPersistenceCapable
Extracts the persistence capable instance from the source of the given event.- Returns:
- null if an instance can not be extracted.
-
getBroker
Extracts the broker from the given persistence capable instance.- Parameters:
pc- a persistence capable instance- Returns:
- null if a Broker can notbe extracted
-
isAuditable
Affirms if the given state manager is auditable for the given operation.- Parameters:
op- an auditable operation
-