org.bushe.swing.event.annotation
Class AbstractProxySubscriber

java.lang.Object
  extended by org.bushe.swing.event.annotation.AbstractProxySubscriber
All Implemented Interfaces:
Prioritized, ProxySubscriber
Direct Known Subclasses:
BaseProxySubscriber, ProxyTopicSubscriber

public abstract class AbstractProxySubscriber
extends Object
implements ProxySubscriber, Prioritized

Common base class for EventService Proxies.

Implementing Prioritized even when Priority is not used is always OK. The default value of 0 retains the FIFO order.


Field Summary
protected  boolean veto
           
 
Constructor Summary
protected AbstractProxySubscriber(Object proxiedSubscriber, Method subscriptionMethod, ReferenceStrength referenceStrength, EventService es, boolean veto)
           
protected AbstractProxySubscriber(Object proxiedSubscriber, Method subscriptionMethod, ReferenceStrength referenceStrength, int priority, EventService es, boolean veto)
           
 
Method Summary
 boolean equals(Object obj)
           
 EventService getEventService()
           
 int getPriority()
           
 Object getProxiedSubscriber()
           
 ReferenceStrength getReferenceStrength()
           
 Method getSubscriptionMethod()
           
 int hashCode()
           
 void proxyUnsubscribed()
          Called by EventServices to inform the proxy that it is unsubscribed.
protected  boolean retryReflectiveCallUsingAccessibleObject(Object[] args, Method subscriptionMethod, Object obj, IllegalAccessException e, String message)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

veto

protected boolean veto
Constructor Detail

AbstractProxySubscriber

protected AbstractProxySubscriber(Object proxiedSubscriber,
                                  Method subscriptionMethod,
                                  ReferenceStrength referenceStrength,
                                  EventService es,
                                  boolean veto)

AbstractProxySubscriber

protected AbstractProxySubscriber(Object proxiedSubscriber,
                                  Method subscriptionMethod,
                                  ReferenceStrength referenceStrength,
                                  int priority,
                                  EventService es,
                                  boolean veto)
Method Detail

getProxiedSubscriber

public Object getProxiedSubscriber()
Specified by:
getProxiedSubscriber in interface ProxySubscriber
Returns:
the object this proxy is subscribed on behalf of

getSubscriptionMethod

public Method getSubscriptionMethod()
Returns:
the subscriptionMethod passed in the constructor

getEventService

public EventService getEventService()
Returns:
the EventService passed in the constructor

getReferenceStrength

public ReferenceStrength getReferenceStrength()
Specified by:
getReferenceStrength in interface ProxySubscriber
Returns:
the ReferenceStrength passed in the constructor

getPriority

public int getPriority()
Specified by:
getPriority in interface Prioritized
Returns:
the priority, no effect if priority is 0 (the default value)

proxyUnsubscribed

public void proxyUnsubscribed()
Called by EventServices to inform the proxy that it is unsubscribed. The ProxySubscriber should perform any necessary cleanup.

Overriding classes must call super.proxyUnsubscribed() or risk things not being cleanup up properly.

Specified by:
proxyUnsubscribed in interface ProxySubscriber

hashCode

public final int hashCode()
Overrides:
hashCode in class Object

retryReflectiveCallUsingAccessibleObject

protected boolean retryReflectiveCallUsingAccessibleObject(Object[] args,
                                                           Method subscriptionMethod,
                                                           Object obj,
                                                           IllegalAccessException e,
                                                           String message)

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2011 Bushe Enterprises, Inc.. All Rights Reserved.