|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.bushe.swing.event.annotation.AbstractProxySubscriber
org.bushe.swing.event.annotation.ProxyTopicSubscriber
public class ProxyTopicSubscriber
A class that subscribes to an EventService on behalf of another object.
This class is not used directly (though you could), but rather through the use of the
@org.bushe.swing.event.annotation.EventTopicSubscriber. Advanced EventBus
users could use this class in Aspect-Oriented code. Consider using the
AnnotationProcessor instead, it may suit your needs and be easier.
| Field Summary |
|---|
| Fields inherited from class org.bushe.swing.event.annotation.AbstractProxySubscriber |
|---|
veto |
| Constructor Summary | |
|---|---|
ProxyTopicSubscriber(java.lang.Object proxiedSubscriber,
java.lang.reflect.Method subscriptionMethod,
ReferenceStrength referenceStrength,
EventService es,
java.lang.String topic,
boolean veto)
Creates a proxy. |
|
ProxyTopicSubscriber(java.lang.Object proxiedSubscriber,
java.lang.reflect.Method subscriptionMethod,
ReferenceStrength referenceStrength,
int priority,
EventService es,
java.lang.String topic,
boolean veto)
Creates a proxy. |
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object obj)
|
void |
onEvent(java.lang.String topic,
java.lang.Object data)
Handles the event publication by pushing it to the real subscriber's subscription Method. |
boolean |
shouldVeto(java.lang.String topic,
java.lang.Object data)
Determine whether a topic publication should be vetoed or allowed. |
java.lang.String |
toString()
|
protected void |
unsubscribe(java.lang.String topic)
|
| Methods inherited from class org.bushe.swing.event.annotation.AbstractProxySubscriber |
|---|
getEventService, getPriority, getProxiedSubscriber, getReferenceStrength, getSubscriptionMethod, hashCode, proxyUnsubscribed, retryReflectiveCallUsingAccessibleObject |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ProxyTopicSubscriber(java.lang.Object proxiedSubscriber,
java.lang.reflect.Method subscriptionMethod,
ReferenceStrength referenceStrength,
EventService es,
java.lang.String topic,
boolean veto)
proxiedSubscriber - the subscriber that the proxy will call when an event is publishedsubscriptionMethod - the method the proxy will call, must have an Object as it's first and only parameterreferenceStrength - if the subscription is weak, the reference from the proxy to the real subscriber should
be tooes - the EventService we will be subscribed to, since we may need to unsubscribe when weak refs no longer
existtopic - the topic to subscribe to, used for unsubscription onlyveto - if this proxy is for a veto subscriber
public ProxyTopicSubscriber(java.lang.Object proxiedSubscriber,
java.lang.reflect.Method subscriptionMethod,
ReferenceStrength referenceStrength,
int priority,
EventService es,
java.lang.String topic,
boolean veto)
proxiedSubscriber - the subscriber that the proxy will call when an event is publishedsubscriptionMethod - the method the proxy will call, must have an Object as it's first and only parameterreferenceStrength - if the subscription is weak, the reference from the proxy to the real subscriber should
be tooes - the EventService we will be subscribed to, since we may need to unsubscribe when weak refs no longer
existtopic - the topic to subscribe to, used for unsubscription onlyveto - if this proxy is for a veto subscriber| Method Detail |
|---|
public void onEvent(java.lang.String topic,
java.lang.Object data)
onEvent in interface EventTopicSubscribertopic - the topic on which the object is being publisheddata - The Object that is being published on the topic.
public boolean shouldVeto(java.lang.String topic,
java.lang.Object data)
VetoTopicEventListenerPrerequisite: 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
shouldVeto in interface VetoTopicEventListenertopic - The topic name the data object is published on.data - The data object being published on the topic.
protected void unsubscribe(java.lang.String topic)
public boolean equals(java.lang.Object obj)
equals in class AbstractProxySubscriberpublic java.lang.String toString()
toString in class AbstractProxySubscriber
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||