|
||||||||||
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.BaseProxySubscriber
public class BaseProxySubscriber
A class is subscribed to an EventService on behalf of another object.
Field Summary |
---|
Fields inherited from class org.bushe.swing.event.annotation.AbstractProxySubscriber |
---|
veto |
Constructor Summary | |
---|---|
BaseProxySubscriber(Object proxiedSubscriber,
Method subscriptionMethod,
ReferenceStrength referenceStrength,
EventService es,
Class subscription,
boolean veto)
Creates a proxy. |
|
BaseProxySubscriber(Object proxiedSubscriber,
Method subscriptionMethod,
ReferenceStrength referenceStrength,
int priority,
EventService es,
Class subscription,
boolean veto)
Creates a proxy with a priority. |
Method Summary | |
---|---|
boolean |
equals(Object obj)
|
void |
onEvent(Object event)
Handles the event publication by pushing it to the real subscriber's subscription Method. |
boolean |
shouldVeto(Object event)
Determine whether an event should be vetoed or published. |
String |
toString()
|
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 BaseProxySubscriber(Object proxiedSubscriber, Method subscriptionMethod, ReferenceStrength referenceStrength, EventService es, Class subscription, 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
existsubscription
- the class to subscribe to, used for unsubscription onlyveto
- whether this is a veto subscriberpublic BaseProxySubscriber(Object proxiedSubscriber, Method subscriptionMethod, ReferenceStrength referenceStrength, int priority, EventService es, Class subscription, 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
existsubscription
- the class to subscribe to, used for unsubscription onlyveto
- whether this is a veto subscriberMethod Detail |
---|
public void onEvent(Object event)
onEvent
in interface EventSubscriber
event
- The Object that is being published.public boolean shouldVeto(Object event)
VetoEventListener
Prerequisite: VetoEventListener has to be subscribed with the EventService for the event object's class.
Guaranteed to be
called in the SwingEventThread when using the SwingEventService (EventBus). See EventService
shouldVeto
in interface VetoEventListener
event
- The event object to veto or allow to be published.
public boolean equals(Object obj)
equals
in class AbstractProxySubscriber
public String toString()
toString
in class AbstractProxySubscriber
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |