org.bushe.swing.event.annotation
Class BaseProxySubscriber

java.lang.Object
  extended by org.bushe.swing.event.annotation.AbstractProxySubscriber
      extended by org.bushe.swing.event.annotation.BaseProxySubscriber
All Implemented Interfaces:
EventSubscriber, ProxySubscriber

public class BaseProxySubscriber
extends AbstractProxySubscriber
implements EventSubscriber

A class is subscribed to an EventService on behalf of another object.


Constructor Summary
BaseProxySubscriber(java.lang.Object proxiedSubscriber, java.lang.reflect.Method subscriptionMethod, ReferenceStrength referenceStrength, EventService es, java.lang.Class subscription)
          Creates a proxy.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 void onEvent(java.lang.Object event)
          Handles the event publication by pushing it to the real subscriber's subcription Method.
 java.lang.String toString()
           
 
Methods inherited from class org.bushe.swing.event.annotation.AbstractProxySubscriber
getEventService, getProxiedSubscriber, getReferenceStrength, getSubscriptionMethod, hashCode, proxyUnsubscribed
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BaseProxySubscriber

public BaseProxySubscriber(java.lang.Object proxiedSubscriber,
                           java.lang.reflect.Method subscriptionMethod,
                           ReferenceStrength referenceStrength,
                           EventService es,
                           java.lang.Class subscription)
Creates a proxy. This does not subscribe it.

Parameters:
proxiedSubscriber - the subscriber that the proxy will call when an event is publixhed
subscriptionMethod - the method the proxy will call, must have an Object as it's first and only parameter
referenceStrength - if the subscription is weak, the reference from the proxy to the real subscriber should be too
es - the EventService we will be subscribed to, since we may need to unsubscribe when weak refs no longer exist
subscription - the class to subscribe to, used for unsubscription only
Method Detail

onEvent

public void onEvent(java.lang.Object event)
Handles the event publication by pushing it to the real subscriber's subcription Method.

Specified by:
onEvent in interface EventSubscriber
Parameters:
event - The Object that is being published.

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class AbstractProxySubscriber

toString

public java.lang.String toString()
Overrides:
toString in class AbstractProxySubscriber