org.bushe.swing.event
Interface VetoTopicEventListener


public interface VetoTopicEventListener

Interface for classes that can veto publication on topic names from the EventService.

Author:
Michael Bushe michael@bushe.com

Method Summary
 boolean shouldVeto(java.lang.String topic, java.lang.Object data)
          Determine whether a topic publication should be vetoed or allowed.
 

Method Detail

shouldVeto

boolean shouldVeto(java.lang.String topic,
                   java.lang.Object data)
Determine whether a topic publication should be vetoed or allowed.

The EventService calls this method before publication of on a topic name. If any of the VetoTopicEventListeners return true, then none of the subscribers to that topic are called.

Prequisite: VetoTopicEventListener has to be subscribed with the EventService for the topic name.

Guaranteed to be called in the SwingEventThread when using the SwingEventService (EventBus). See EventService

Parameters:
topic - The topic name the data object is published on.
data - The data object being published on the topic.
Returns:
true if the publication on the topic should be vetoed and not published, false if the data should be published on the topic.