public class ThreadLocalTransactionEvents extends Object
ThreadLocalEvents.start();
try {
//do database transaction and collect events by using ThreadLocalEvents.postEvent(event); instead of going directly
//to your injected event manager
ThreadLocalEvents.commit(mEventManager);
} finally {
ThreadLocalEvents.close();
}
Constructor and Description |
---|
ThreadLocalTransactionEvents()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
static void |
close()
Deprecated.
Closes the transaction
|
static void |
commit(EventManager pEventManager)
Deprecated.
Ends the transaction and posts all the events to pEventManager
|
static void |
postEvent(IOEvent pEvent,
EventManager pEventManager)
Deprecated.
If we are in a transaction, pEvent will be added to the internal list of events.
|
static void |
start()
Deprecated.
Starts the transaction.
|
public static void start()
public static void postEvent(IOEvent pEvent, EventManager pEventManager)
EventManager
pEvent
- the event to add to the transactionpEventManager
- the EventManager
to use when sending the eventpublic static void commit(EventManager pEventManager)
pEventManager
- the EventManager
to use when sending eventspublic static void close()
© 1998- 2018 Stibo DX