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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
afterBegin
(TransactionEvent event) ----------------------------------------------------------------------- Transaction callbacksvoid
afterCommit
(TransactionEvent event) Notification that a transaction has successfully committed.void
Notification that a transaction has successfully committed and the transaction is no longer active.void
afterFlush
(TransactionEvent event) Notification that a transaction has flushed all object changes.void
afterRollback
(TransactionEvent event) Notification that a transaction has been rolled back.void
Notification that a transaction has been rolled back and the transaction is no longer active.void
Notification that state transitions are complete.void
beforeCommit
(TransactionEvent event) Notification that the next flush is for the transaction commit.void
beforeFlush
(TransactionEvent event) Notification that a transaction is about to flush all object changes.protected Broker
Extracts the broker from the given persistence capable instance.protected PersistenceCapable
Extracts the persistence capable instance from the source of the given event.protected boolean
Affirms if the given state manager is auditable for the given operation.void
Records 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:
register
in interfacePCRegistry.RegisterClassListener
-
getAuditor
-
getAuditedTypes
-
afterBegin
----------------------------------------------------------------------- Transaction callbacks. ------------------------------------------------------------------------ Specified by:
afterBegin
in interfaceBeginTransactionListener
- See Also:
-
beforeCommit
Description copied from interface:EndTransactionListener
Notification that the next flush is for the transaction commit.- Specified by:
beforeCommit
in interfaceEndTransactionListener
- See Also:
-
afterCommit
Description copied from interface:EndTransactionListener
Notification that a transaction has successfully committed.- Specified by:
afterCommit
in interfaceEndTransactionListener
- See Also:
-
afterRollback
Description copied from interface:EndTransactionListener
Notification that a transaction has been rolled back.- Specified by:
afterRollback
in interfaceEndTransactionListener
- See Also:
-
afterCommitComplete
Description copied from interface:EndTransactionListener
Notification that a transaction has successfully committed and the transaction is no longer active.- Specified by:
afterCommitComplete
in interfaceEndTransactionListener
- See Also:
-
afterRollbackComplete
Description copied from interface:EndTransactionListener
Notification that a transaction has been rolled back and the transaction is no longer active.- Specified by:
afterRollbackComplete
in interfaceEndTransactionListener
- See Also:
-
beforeFlush
Description copied from interface:FlushTransactionListener
Notification that a transaction is about to flush all object changes.- Specified by:
beforeFlush
in interfaceFlushTransactionListener
- See Also:
-
afterFlush
Description copied from interface:FlushTransactionListener
Notification that a transaction has flushed all object changes.- Specified by:
afterFlush
in interfaceFlushTransactionListener
- See Also:
-
afterStateTransitions
Description copied from interface:EndTransactionListener
Notification that state transitions are complete.- Specified by:
afterStateTransitions
in 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
-