org.bushe.swing.event
Interface EventTopicSubscriber

All Known Implementing Classes:
ProxyTopicPatternSubscriber, ProxyTopicSubscriber

public interface EventTopicSubscriber

Callback interface for topic-based subscribers of an EventService.

Author:
Michael Bushe michael@bushe.com

Method Summary
 void onEvent(java.lang.String topic, java.lang.Object data)
          Handle an event published on a topic.
 

Method Detail

onEvent

void onEvent(java.lang.String topic,
             java.lang.Object data)
Handle an event published on a topic.

The EventService calls this method on each publication on a matching topic name passed to one of the EventService's topic-based subscribe methods, specifically, EventService.subscribe(String, EventTopicSubscriber) EventService.subscribe(java.util.regex.Pattern,EventTopicSubscriber) EventService.subscribeStrongly(String,EventTopicSubscriber) and EventService.subscribeStrongly(java.util.regex.Pattern, EventTopicSubscriber).

Parameters:
topic - the name of the topic published on
data - the data object published on the topic