|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.sun.jdo.api.persistence.support.SynchronizationManager
public class SynchronizationManager
This class allows for multiple instances to be called at transaction completion, which JDO does not currently provide. JDO only provides for a single instance to be registered. This service exploits the JDO capability by registering an instance of SynchronizationManager with JDO and then calling each instance registered with itself.
| Field Summary | |
|---|---|
protected static int |
defaultCapacity
The default capacity of the List of Synchronizations. |
protected java.util.List |
synchronizations
The list of instances to synchronize. |
| Constructor Summary | |
|---|---|
|
SynchronizationManager()
Creates new SynchronizationManager instance with a default capacity of the List of Synchronization instances. |
|
SynchronizationManager(int initialCapacity)
Creates new SynchronizationManager instance specifying the initial capacity of the list of Synchronization instances. |
protected |
SynchronizationManager(PersistenceManager pm)
Creates new SynchronizationManager instance and registers it with the persistence manager. |
| Method Summary | |
|---|---|
void |
afterCompletion(int status)
This method will be called during transaction completion. |
void |
beforeCompletion()
This method will be called during transaction completion. |
protected static SynchronizationManager |
getSynchronizationManager(PersistenceManager pm)
Get the synchronization manager already registered with this persistence manager. |
protected void |
registerSynchronization(Synchronization instance)
Register an instance with this synchronization manager. |
static void |
registerSynchronization(Synchronization instance,
PersistenceManager pm)
Register a new Synchronization with the current transaction. |
static void |
setDefaultCapacity(int capacity)
Specify the default capacity of the list of Synchronizations. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static int defaultCapacity
protected final java.util.List synchronizations
| Constructor Detail |
|---|
public SynchronizationManager(int initialCapacity)
initialCapacity - the initial capacity of the List of Synchronization instancespublic SynchronizationManager()
protected SynchronizationManager(PersistenceManager pm)
pm - the persistence manager managing this transaction| Method Detail |
|---|
public static void registerSynchronization(Synchronization instance,
PersistenceManager pm)
instance - the instance to be registeredpm - the persistence manager which manages this transactionpublic static void setDefaultCapacity(int capacity)
capacity - the default capacity of the List of Synchronizationsprotected static SynchronizationManager getSynchronizationManager(PersistenceManager pm)
pm - the persistence manager
public void beforeCompletion()
beforeCompletion in interface Synchronizationpublic void afterCompletion(int status)
afterCompletion in interface Synchronizationstatus - the completion status of the transactionprotected void registerSynchronization(Synchronization instance)
instance - the instance to be registered
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||