org.bushe.swing.event
Class SubscriberTimingEvent
java.lang.Object
org.bushe.swing.event.AbstractEventServiceEvent
org.bushe.swing.event.SubscriberTimingEvent
- All Implemented Interfaces:
- EventServiceEvent
public class SubscriberTimingEvent
- extends AbstractEventServiceEvent
This event is published internally to report timing for subscribe on an EventService. Applications may subscribe to
this event to do handle subscribers that take too long.
- Author:
- Michael Bushe michael@bushe.com
- See Also:
ThreadSafeEventService
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
SubscriberTimingEvent
public SubscriberTimingEvent(java.lang.Object source,
java.lang.Long start,
java.lang.Long end,
java.lang.Long timeLimitMilliseconds,
java.lang.Object event,
EventSubscriber subscriber,
VetoEventListener vetoEventListener)
- Create a timing event
- Parameters:
source
- event sourcestart
- system time at start of the notification of listenerend
- system time at end of the notification of listenertimeLimitMilliseconds
- expected maximum timeevent
- the published eventsubscriber
- the event subscriber that went over the time limit, can be null if vetoEventListener is not
nullvetoEventListener
- the vetoEventListener that took too long, can be null if the eventListener is not null
getStart
public java.lang.Long getStart()
- Returns:
- system time at start of the notification of listener
getEnd
public java.lang.Long getEnd()
- Returns:
- system time at end of the notification of listener
getTimeLimitMilliseconds
public java.lang.Long getTimeLimitMilliseconds()
- Returns:
- expected maximum time
getEvent
public java.lang.Object getEvent()
- Returns:
- the published event
getSubscriber
public EventSubscriber getSubscriber()
- Returns:
- subscriber the event subscriber that went over the time limit, can be null if vetoEventListener is not
null
getVetoEventListener
public VetoEventListener getVetoEventListener()
- Returns:
- the vetoEventListener that took too long, can be null if the eventListener is not null
isVetoExceeded
public boolean isVetoExceeded()
- Returns:
- true if a veto listener took too long, false if an EventSubscriber took took long
isEventHandlingExceeded
public boolean isEventHandlingExceeded()
- Returns:
- true if an EventSubscriber took too long, false if a veto listener took took long
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object