public class TransactionMessageBus extends java.lang.Object implements TransactionMessageBusI
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
MAGIC_WHOLE_BO_ATTRIBUTE
Attribute'name' used to represent a refresh of all scalars and n-1 relations on the BOProc.
|
Constructor and Description |
---|
TransactionMessageBus(Transaction _tx) |
Modifier and Type | Method and Description |
---|---|
void |
consumeAfterSetMessage(SetValueEventI changeEvent) |
static void |
consumeScriptedAttributeChange(SetValueEventI changeEvent)
This method will call consumeAfterSetMessage on the MessageBus for the BOs loadingTransaction.
|
boolean |
createAfterAddMessage(BO bo,
AttributeI attribute,
BO addedBO) |
boolean |
createAfterRemoveMessage(BO bo,
AttributeI attribute,
BO removed) |
boolean |
createAfterSetMessage(BO bo,
AttributeI attribute,
java.lang.Object newValue) |
boolean |
createAfterSetMessage(BO bo,
AttributeI attribute,
java.lang.Object newValue,
java.lang.Object oldValue)
Creates and queues a new change message for setting a scalar or n-1 relation to a new value.
|
void |
disableSynchronousEventsForUnittests()
Disable synchronous events again.
|
void |
doSignalProcListeners() |
void |
enableSynchronousEventsForUnittests()
New Events will trigger a notification of listeners directly, in the thread that triggered the event,
skipping the asynchronous event collection behaviour.
|
void |
fireCheckPoint() |
void |
fireNewProcs()
Notify the NewProcsRunner thread that this MessageBus has new messages to handle.
|
void |
forceResumeFiringNewProcs()
Ignores previous pauses to event firing by any sources and reenables it
|
Transaction |
getTransaction() |
boolean |
isAcceptingMessages() |
boolean |
isEventFiringPaused() |
static void |
killNewProcsRunner()
This should only be called if a classloader is disposed of and we need to stop this class's NewProcsRunner!
|
void |
newProcSync()
Waits until the backlog is cleared and all listeners have been informed.
|
void |
notifyFiredProcWaits() |
void |
pauseFiringNewProcs()
Pauses notifications for all consumers until a matching number of resumeFiringNewProcs calls have been made.
|
boolean |
putIntoVirtualProcQueue(BOProc proc)
Puts the proc into the explicit queue for non persistent changes or persistent changes that have been applied to the
transactions BOs indirectly (e.g. otherTransactionsSaveSuccess).
|
boolean |
putIntoVirtualProcQueue(java.util.List<BOProc> procs)
Puts multiple procs into the virtual proc queue
|
void |
registerListener(TransactionListenerI l)
Registers a nonnull listener to receive notification on new changes from now on.
|
void |
removeAllListeners() |
void |
resumeFiringNewProcs()
Reduces the number of pause requests created by by one and resumes firing of new
procs if no pause requests remain.
|
java.lang.String |
toString() |
void |
unregisterListener(TransactionListenerI l)
Unregisters a nonnull listener, causing that listener to no longer receive notifications.
|
public static final java.lang.String MAGIC_WHOLE_BO_ATTRIBUTE
public TransactionMessageBus(Transaction _tx)
public Transaction getTransaction()
public boolean isEventFiringPaused()
isEventFiringPaused
in interface TransactionMessageBusI
#isAcceptingMessages()
, then the messages will be queued and delayed until
the messaging has been resumed.
false, if not paused.
If not paused and this bus accepts messages, then listeners will get notified.
When not accepting messages, then this property has effectively no effect.public void pauseFiringNewProcs()
TransactionMessageBusI
pauseFiringNewProcs
in interface TransactionMessageBusI
public void resumeFiringNewProcs()
TransactionMessageBusI
resumeFiringNewProcs
in interface TransactionMessageBusI
public void forceResumeFiringNewProcs()
public static void killNewProcsRunner()
public void registerListener(TransactionListenerI l)
TransactionMessageBusI
registerListener
in interface TransactionMessageBusI
public void unregisterListener(TransactionListenerI l)
TransactionMessageBusI
unregisterListener
in interface TransactionMessageBusI
public void removeAllListeners()
public void doSignalProcListeners()
public void fireCheckPoint()
public void newProcSync()
TransactionMessageBusI
newProcSync
in interface TransactionMessageBusI
public void notifyFiredProcWaits()
public boolean isAcceptingMessages()
public void fireNewProcs()
public void enableSynchronousEventsForUnittests()
public void disableSynchronousEventsForUnittests()
public static void consumeScriptedAttributeChange(SetValueEventI changeEvent)
public void consumeAfterSetMessage(SetValueEventI changeEvent)
consumeAfterSetMessage
in interface TransactionMessageBusI
public boolean createAfterSetMessage(BO bo, AttributeI attribute, java.lang.Object newValue)
createAfterSetMessage
in interface TransactionMessageBusI
public boolean createAfterSetMessage(BO bo, AttributeI attribute, java.lang.Object newValue, java.lang.Object oldValue)
TransactionMessageBusI
createAfterSetMessage
in interface TransactionMessageBusI
bo
- the bo which was changed virtually, nonnull.attribute
- the nullable attribute that was changed. While this method doesn't check if attribute is really virtual,
it should be. Persistent attributes generate procs automatically by the transaction, if not, it is probably missing an include.newValue
- a nullable newValue to put into the notification, can be null if newValue isn't available directly and the up-to-date
value has to be accessed by the view anyway.oldValue
- a nullable and optional oldValue to be put into the event.
Should only be provided if the oldValue is readily available, because it is most likely ignored.public boolean createAfterAddMessage(BO bo, AttributeI attribute, BO addedBO)
createAfterAddMessage
in interface TransactionMessageBusI
public boolean createAfterRemoveMessage(BO bo, AttributeI attribute, BO removed)
createAfterRemoveMessage
in interface TransactionMessageBusI
public boolean putIntoVirtualProcQueue(BOProc proc)
proc
- the proc to put into the virtual queue, nonnull.public boolean putIntoVirtualProcQueue(java.util.List<BOProc> procs)
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2000-2025 OAshi S.à r.l. All Rights Reserved.