public final class AepEngineStoppingEvent extends LifecycleEvent implements IAlertEvent
This event is dispatched to an application to notify it that the AEP engine is about to be stopped.
count, head, next, prev
Modifier and Type | Method and Description |
---|---|
static AepEngineStoppingEvent |
create(Exception cause,
boolean preserveChannelJoins)
Create a new (initialized) engine stopping event.
|
static Event |
create(Properties props)
Create a new (uninitialized) engine stopping event.
|
Exception |
getCause()
Get the reason for the stop.
|
boolean |
getPreserveChannelJoins()
Tests whether or not the engine will preserve subscriptions on closed
message bus bindings.
|
MessageView |
getTriggeringMessage()
Implementation of
IAlertEvent.getTriggeringMessage() |
void |
setPreserveChannelJoins(boolean preserveChannelJoins)
A handler of an
AepEngineStoppingEvent can set this value to indicate
whether channel joins should be preserved when closing the engine's buses. |
String |
toString()
Get a string representation of the object
|
getBackingMessage, getEventTime, setBackingMessage
acquire, dispose, getAcknowledger, getAttachment, getDelay, getDispatchTime, getInstanceNumber, getOfferTs, getPollTs, getPool, getRemainingTime, getScheduledTime, getSource, getType, init, isEndOfBatch, isHandled, owners, referenceTracker, setAcknowledger, setAttachment, setDelay, setDispatchTime, setEndOfBatch, setHandled, setPool, setScheduledTime, setSource
count, insertAfter, insertBefore, isLinked, next, previous, unlink, wipe
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getBackingMessage, getEventTime, setBackingMessage
acquire, dispose, getAcknowledger, getAttachment, getDelay, getDispatchTime, getInstanceNumber, getRemainingTime, getScheduledTime, getSource, getType, isEndOfBatch, isHandled, owners, setAcknowledger, setAttachment, setDelay, setEndOfBatch, setHandled, setSource
referenceTracker
public static Event create(Properties props)
This method instantiates a new engine stopping event object. The method is for use by the event factory to instantiate new engine stopping events. The method should not be used directly by the user since the method bypasses any event pooling i.e. it creates a new engine stopping event object even if there are eligible event objects available in the event type's pool.
public static AepEngineStoppingEvent create(Exception cause, boolean preserveChannelJoins)
This method instantiates and initializes a engine stopping event. The method uses the event factory to instantiate a new engine stopping event (the factory recycles objects through the event type's object pool is configured for the type) and then initializes it with the supplied parameters.
cause
- Specifies the reason why the engine is stopping. A null value
indicates a graceful stop.preserveChannelJoins
- Indicates whether or not the engine will preserve
subscriptions established by channels that were joined.public final Exception getCause()
public boolean getPreserveChannelJoins()
public void setPreserveChannelJoins(boolean preserveChannelJoins)
AepEngineStoppingEvent
can set this value to indicate
whether channel joins should be preserved when closing the engine's buses.
When an AepEngine stops cleanly the default behavior is to remove any subscriptions or
interests that its bus bindings have created unless it is configured to preserve joins
on stop
. This method allows overriding of the configured behavior at runtime.
In the event that there are multiple handlers for an AepEngineStoppingEvent
that
both set the value, the last value set will be the one used.
Note that setting this value to false
will not have an effect if the engine is
stopping as the result of an exception (e.g. getCause()
!= null. Similarly A value of false
will not take effect if the bus binding is in a failed state (a bus connection that has failed will not
be reestablished so its joins can be removed). In both of these cases subscriptions are preserved with
the presumption that the engine will failover to a backup as the result of an ungraceful shutdown.
Setting this to true
will only preserve joined channels
established at the time the engine was stopped (it is possible that not all channels will have been joined
if an error occurred opening the engine's bus bindings).
preserveChannelJoins
- True to preserve subscriptions/interests of joined channels.public final MessageView getTriggeringMessage()
IAlertEvent.getTriggeringMessage()
getTriggeringMessage
in interface IAlertEvent
public String toString()
toString
in class LifecycleEvent
Copyright © 2019 Neeve Research, LLC. All Rights Reserved.