com.neeve.aep.event
Class AepStuckAlertEvent

java.lang.Object
  extended by com.neeve.util.UtlListElement
      extended by com.neeve.event.Event
          extended by com.neeve.event.alert.AlertEvent
              extended by com.neeve.aep.event.AepStuckAlertEvent
All Implemented Interfaces:
IAlertEvent, IEvent, UtlPool.Item<Event>, UtlReferenceTracker.HasReferenceTracker

public final class AepStuckAlertEvent
extends AlertEvent

Event used to notify of a stuck engine.

AepStuckAlertEvent are emitted when an AepEngine is configured with an stuckAlertEventThread which is set via the engine descriptor AepEngineDescriptor#setStuckAlertEventThreshold(int)

Note that unlike other alert event emitted by an AepEngine, engine stuck alerts are emitted by a separate thread that periodically checks engine health. To listen for AepStuckAlertEvent one must set an IAepAsynchronousEventHandler on the AepEngine via AepEngine.setAsynchronousEventHandler(handler).

Because AepStuckAlertEvent are not emitted on the AepEngine's event multiplexer thread, it is not generally safe to access engine methods that are not thread safe when processing this event.

See Also:
AepEngine.setAsynchronousEventHandler(com.neeve.aep.IAepAsynchronousEventHandler), AepEngineDescriptor.setStuckAlertEventThreshold(int)
Threading:
This class is safe for concurrent access by multiple threads.

Nested Class Summary
static class AepStuckAlertEvent.Reason
          Enumerates the reasons that cause an AepStuckAlertEvent to be emitted.
 
Field Summary
 
Fields inherited from class com.neeve.util.UtlListElement
count, head, next, prev
 
Method Summary
static AepStuckAlertEvent create(AepStuckAlertEvent.Reason reason, long lastEventProcessingTimestamp, long lastCommitCompletionTimestamp, int incompleteCommitCount)
          Create a new (initialized) stuck engine event.
static Event create(Properties props)
          Create a new (uninitialized) stuck engine event.
 int getIncompleteCommitCount()
          Gets the number of commits that have not been completed.
 long getLastCommitCompletionTimestamp()
          Gets the timestamp that the last commit was completed.
 long getLastEventProcessedTimestamp()
          Gets the event processing completion timestamp of the last event processed by the engine.
 AepStuckAlertEvent.Reason getReason()
          Returns the reason for this alert.
 String message()
          An optional descriptive message indicating the reason that the engine was determined to be stuck.
 void setMessage(String message)
           
 String toString()
          Get a string representation of a stuck event.
 
Methods inherited from class com.neeve.event.alert.AlertEvent
getBackingMessage, getEventTime, getTriggeringMessage, setBackingMessage
 
Methods inherited from class com.neeve.event.Event
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
 
Methods inherited from class com.neeve.util.UtlListElement
count, insertAfter, insertBefore, isLinked, next, previous, unlink, wipe
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.neeve.event.IEvent
acquire, dispose, getAcknowledger, getAttachment, getDelay, getDispatchTime, getInstanceNumber, getRemainingTime, getScheduledTime, getSource, getType, isEndOfBatch, isHandled, owners, setAcknowledger, setAttachment, setDelay, setEndOfBatch, setHandled, setSource
 
Methods inherited from interface com.neeve.util.UtlReferenceTracker.HasReferenceTracker
referenceTracker
 

Method Detail

create

public static Event create(Properties props)
Create a new (uninitialized) stuck engine event.


create

public static AepStuckAlertEvent create(AepStuckAlertEvent.Reason reason,
                                        long lastEventProcessingTimestamp,
                                        long lastCommitCompletionTimestamp,
                                        int incompleteCommitCount)
Create a new (initialized) stuck engine event.

Parameters:
lastEventProcessingTimestamp - The timestamp of the last completed event procesed by the engine.
lastCommitCompletionTimestamp - The last commit completion.
incompleteCommitCount - The number of incomplete transactions.

setMessage

public final void setMessage(String message)

getReason

public AepStuckAlertEvent.Reason getReason()
Returns the reason for this alert.

Returns:
The reason this alert was raised

message

public String message()
An optional descriptive message indicating the reason that the engine was determined to be stuck.

Returns:
A description of the problem, possibly null

getLastEventProcessedTimestamp

public long getLastEventProcessedTimestamp()
Gets the event processing completion timestamp of the last event processed by the engine.

Returns:
The last event processing completion timestamp.

getLastCommitCompletionTimestamp

public long getLastCommitCompletionTimestamp()
Gets the timestamp that the last commit was completed.

Returns:
the last commit completion timestamp

getIncompleteCommitCount

public int getIncompleteCommitCount()
Gets the number of commits that have not been completed.

Returns:
the number of commits that have not been completed.

toString

public final String toString()
Get a string representation of a stuck event.

Overrides:
toString in class AlertEvent


Copyright © 2016 Neeve Research, LLC. All Rights Reserved.