com.neeve.event
Interface IEvent

All Superinterfaces:
UtlReferenceTracker.HasReferenceTracker
All Known Subinterfaces:
IAlertEvent, IEventBatch, ILifecycleEvent, IStoreAlertEvent, IStoreBindingFailedEvent, IStoreBindingRoleChangedEvent, IStoreCommitCompletionEvent, IStoreCommitEvent, IStoreEvent, IStoreLifecycleEvent, IStoreMemberConnectEvent, IStoreMemberConnectReplyEvent, IStoreMemberControlEvent, IStoreMemberDownEvent, IStoreMemberFoundEvent, IStoreMemberHandshakeBackupHelloEvent, IStoreMemberHandshakePrimaryHelloEvent, IStoreMemberHandshakeStartReadyEvent, IStoreMemberInitCompleteEvent, IStoreMemberInitReadyEvent, IStoreMemberLostEvent, IStoreMemberTableOpenWaitCompletionEvent, IStoreMemberUpEvent, IStoreObjectAddedEvent, IStoreObjectReceivedEvent, IStoreObjectRemovedEvent, IStoreObjectUpdatedEvent, IStoreTransactionLogRepairedEvent
All Known Implementing Classes:
AepApplicationExceptionEvent, AepBusBindingCreatedEvent, AepBusBindingCreateFailedEvent, AepBusBindingDestroyedEvent, AepBusBindingDownEvent, AepBusBindingOpenedEvent, AepBusBindingOpenFailedEvent, AepBusBindingOpeningEvent, AepBusBindingUpEvent, AepChannelDownEvent, AepChannelUpEvent, AepClientConnectedEvent, AepClientDisconnectedEvent, AepClientPacketEvent, AepDuplicateAcknowledgementAlertEvent, AepEngineActiveEvent, AepEngineCreatedEvent, AepEngineStartedEvent, AepEngineStopEvent, AepEngineStoppedEvent, AepEngineStoppingEvent, AepFlowCreatedEvent, AepInboundLogExceptionEvent, AepMessageTraceLoggingExceptionEvent, AepMessagingFailedEvent, AepMessagingPrestartEvent, AepMessagingStartedEvent, AepMessagingStartFailedEvent, AepOutboundLogExceptionEvent, AepOutOfOrderSendCommitCompletionAlertEvent, AepQuarantineEvent, AepResumeTransactionEvent, AepScheduleEvent, AepSendCommitCompletionEvent, AepSendEvent, AepSendExceptionEvent, AepStateCreatedEvent, AepStatsAlertEvent, AepStuckAlertEvent, AepTransactionStageEvent, AepUnhandledMessageEvent, AlertEvent, BusCongestedEvent, Event, EventBatch, EventWakeup, LifecycleEvent, MessageBatchEvent, MessageBusBindingFailedEvent, MessageBusBindingFlushCompletionEvent, MessageBusBindingOpenCompletionEvent, MessageBusBindingReconnectedEvent, MessageBusBindingReconnectingEvent, MessageEvent, MessageStabilityBatchEvent, MessageStabilityEvent, UnhandledMessageEvent

public interface IEvent
extends UtlReferenceTracker.HasReferenceTracker

Represents an event.

Threading:
Event objects are not safe for concurrent access by multiple threads.

Method Summary
 Event acquire()
          Increment an event's ownership count.
 void dispose()
          Dispose of a event.
 IEventAcknowledger getAcknowledger()
          Get the event acknowledger.
 Object getAttachment()
          Get an event's opaque attachment.
 int getDelay()
          Get an event's the scheduling delay
 long getDispatchTime()
          Get the time at which the event was dispatched
 long getInstanceNumber()
          Get the event's instance number
 int getRemainingTime(long now)
          Get the total time remaining to dispatch
 long getScheduledTime()
          Get the time at which the event was scheduled
 IEventSource getSource()
          Get the event source.
 short getType()
          Get the event type
 boolean isEndOfBatch()
          Get whether the event is the end of a batch of events.
 boolean isHandled()
          Get whether the event has been handled
 int owners()
          Get an event's ownership count.
 void setAcknowledger(IEventAcknowledger acknowledger)
          Set the event acknowledger.
 IEvent setAttachment(Object attachment)
          Attach an opaque object to an event
 Event setDelay(int val)
          Set an event's scheduling delay
 IEvent setEndOfBatch(boolean val)
          Set whether the event is the end of a batch of events.
 IEvent setHandled()
          Set whether the event has been handled
 void setSource(IEventSource source)
          Set the event source.
 
Methods inherited from interface com.neeve.util.UtlReferenceTracker.HasReferenceTracker
referenceTracker
 

Method Detail

getInstanceNumber

long getInstanceNumber()
Get the event's instance number


getType

short getType()
Get the event type


setSource

void setSource(IEventSource source)
Set the event source.


getSource

IEventSource getSource()
Get the event source.


setAcknowledger

void setAcknowledger(IEventAcknowledger acknowledger)
Set the event acknowledger.


getAcknowledger

IEventAcknowledger getAcknowledger()
Get the event acknowledger.

Event acknowledgers are used to acknowledge processing of events. They are conditionally attached to the event if the event generator is interested knowing about event processing.


setEndOfBatch

IEvent setEndOfBatch(boolean val)
Set whether the event is the end of a batch of events.


isEndOfBatch

boolean isEndOfBatch()
Get whether the event is the end of a batch of events.

Returns:
false if the event is part of a batch and this event is not the end of the batch. true otherwise

An event processor can use this as a hint to determine whether another event is immediately going to follow this one.


setAttachment

IEvent setAttachment(Object attachment)
Attach an opaque object to an event

Parameters:
attachment - The object to attach.

getAttachment

Object getAttachment()
Get an event's opaque attachment.


setHandled

IEvent setHandled()
Set whether the event has been handled


isHandled

boolean isHandled()
Get whether the event has been handled


setDelay

Event setDelay(int val)
Set an event's scheduling delay


getDelay

int getDelay()
Get an event's the scheduling delay


getDispatchTime

long getDispatchTime()
Get the time at which the event was dispatched


getScheduledTime

long getScheduledTime()
Get the time at which the event was scheduled


getRemainingTime

int getRemainingTime(long now)
Get the total time remaining to dispatch


acquire

Event acquire()
Increment an event's ownership count.

Event ownership is used in conjunction with managing event pools. If a event is tagged to an object pool, the event is released back to the pool by dispose() when the ownership count reduces to 0. If not tagged to a pool, change of ownership count has no side effects. An event's ownership count starts at 1.


owners

int owners()
Get an event's ownership count.


dispose

void dispose()
Dispose of a event.

This method should be invoked by the user when done with a event. It decrements the event's ownership count and releases it to its object pool if one is tagged to it and the method causes the ownership count to reduce to zero. If not tagged to a pool, ownership change methods have no side effects aside from just updating the ownership counter.

Upon return from this method, the caller should assume that the event has been disposed and release its references to the event.



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