public class BaseProxySubscriber extends AbstractProxySubscriber implements EventSubscriber, VetoEventListener
veto
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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() |
getEventService, getPriority, getProxiedSubscriber, getReferenceStrength, getSubscriptionMethod, hashCode, proxyUnsubscribed, retryReflectiveCallUsingAccessibleObject
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 subscriberpublic 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
Copyright © 2013 Bushe Enterprises, Inc.. All rights reserved.