Package org.scijava.event
Class DefaultEventBus
- java.lang.Object
-
- org.scijava.event.bushe.ThreadSafeEventService
-
- org.scijava.event.DefaultEventBus
-
public class DefaultEventBus extends ThreadSafeEventService
Anorg.scijava.event.bushe.EventServiceimplementation for SciJava.It is called "DefaultEventBus" rather than "DefaultEventService" to avoid a name clash with
DefaultEventService, which is not anorg.scijava.event.bushe.EventServicebut rather a SciJavaServiceimplementation.- Author:
- Curtis Rueden
-
-
Field Summary
-
Fields inherited from class org.scijava.event.bushe.ThreadSafeEventService
CLEANUP_PERIOD_MS_DEFAULT, CLEANUP_START_THRESHOLD_DEFAULT, CLEANUP_STOP_THRESHOLD_DEFAULT, LOG
-
-
Constructor Summary
Constructors Constructor Description DefaultEventBus(ThreadService threadService, LogService log)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidpublish(Object event)protected voidpublish(Object event, String topic, Object eventObj, List subscribers, List vetoSubscribers, StackTraceElement[] callingStack)All publish methods call this method.voidpublish(Type genericType, Object event)voidpublish(String topicName, Object eventObj)voidpublishLater(Object event)voidpublishLater(Type genericType, Object event)voidpublishLater(String topicName, Object eventObj)voidpublishNow(Object event)voidpublishNow(Type genericType, Object event)voidpublishNow(String topicName, Object eventObj)-
Methods inherited from class org.scijava.event.bushe.ThreadSafeEventService
addEventToCache, clearAllSubscribers, clearCache, clearCache, clearCache, clearCache, decWeakRefPlusProxySubscriberCount, getCachedEvents, getCachedTopicData, getCacheSizeForEventClass, getCacheSizeForTopic, getCleanupPeriodMS, getCleanupStartThreshhold, getCleanupStopThreshold, getDefaultCacheSizePerClassOrTopic, getLastEvent, getLastTopicData, getRealSubscriberAndCleanStaleSubscriberIfNecessary, getSubscribers, getSubscribers, getSubscribers, getSubscribers, getSubscribersByPattern, getSubscribersToClass, getSubscribersToExactClass, getSubscribersToPattern, getSubscribersToTopic, getVetoEventListeners, getVetoSubscribers, getVetoSubscribers, getVetoSubscribers, getVetoSubscribersByPattern, getVetoSubscribersToClass, getVetoSubscribersToExactClass, getVetoSubscribersToTopic, handleException, handleException, handleVeto, incWeakRefPlusProxySubscriberCount, onEventException, removeProxySubscriber, setCacheSizeForEventClass, setCacheSizeForTopic, setCacheSizeForTopic, setCleanupPeriodMS, setCleanupStartThreshhold, setCleanupStopThreshold, setDefaultCacheSizePerClassOrTopic, setStatus, subscribe, subscribe, subscribe, subscribe, subscribe, subscribeExactly, subscribeExactlyStrongly, subscribeStrongly, subscribeStrongly, subscribeStrongly, subscribeVetoException, subscribeVetoListener, subscribeVetoListener, subscribeVetoListener, subscribeVetoListener, subscribeVetoListenerExactly, subscribeVetoListenerExactlyStrongly, subscribeVetoListenerStrongly, subscribeVetoListenerStrongly, subscribeVetoListenerStrongly, unsubscribe, unsubscribe, unsubscribe, unsubscribe, unsubscribe, unsubscribe, unsubscribe, unsubscribeExactly, unsubscribeExactly, unsubscribeVeto, unsubscribeVeto, unsubscribeVeto, unsubscribeVetoExactly, unsubscribeVetoListener, unsubscribeVetoListener, unsubscribeVetoListener, unsubscribeVetoListener, unsubscribeVetoListenerExactly
-
-
-
-
Constructor Detail
-
DefaultEventBus
public DefaultEventBus(ThreadService threadService, LogService log)
-
-
Method Detail
-
publishNow
public void publishNow(Object event)
-
publishLater
public void publishLater(Object event)
-
publish
public void publish(Object event)
- Overrides:
publishin classThreadSafeEventService- See Also:
EventService.publish(Object)
-
publish
public void publish(Type genericType, Object event)
- Overrides:
publishin classThreadSafeEventService- See Also:
EventService.publish(java.lang.reflect.Type, Object)
-
publish
public void publish(String topicName, Object eventObj)
- Overrides:
publishin classThreadSafeEventService- See Also:
EventService.publish(String,Object)
-
publish
protected void publish(Object event, String topic, Object eventObj, List subscribers, List vetoSubscribers, StackTraceElement[] callingStack)
Description copied from class:ThreadSafeEventServiceAll publish methods call this method. Extending classes only have to override this method to handle all publishing cases.- Overrides:
publishin classThreadSafeEventService- Parameters:
event- the event to publish, null if publishing on a topictopic- if publishing on a topic, the topic to publish on, else nulleventObj- if publishing on a topic, the eventObj to publish, else nullsubscribers- the subscribers to publish to - must be a snapshot copyvetoSubscribers- the veto subscribers to publish to - must be a snapshot copy.callingStack- the stack that called this publication, helpful for reporting errors on other threads
-
-