|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IEvent
Represents an event.
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 |
---|
long getInstanceNumber()
short getType()
void setSource(IEventSource source)
IEventSource getSource()
void setAcknowledger(IEventAcknowledger acknowledger)
IEventAcknowledger getAcknowledger()
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.
IEvent setEndOfBatch(boolean val)
boolean isEndOfBatch()
An event processor can use this as a hint to determine whether another event is immediately going to follow this one.
IEvent setAttachment(Object attachment)
attachment
- The object to attach.Object getAttachment()
IEvent setHandled()
boolean isHandled()
Event setDelay(int val)
int getDelay()
long getDispatchTime()
long getScheduledTime()
int getRemainingTime(long now)
Event acquire()
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.
int owners()
void dispose()
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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |