org.bushe.swing.event
Interface ProxySubscriber

All Known Implementing Classes:
AbstractProxySubscriber, BaseProxySubscriber, ProxyTopicPatternSubscriber, ProxyTopicSubscriber

public interface ProxySubscriber

An interface that can be implemented when proxies are used for subscription, not needed in normal usage. When an unsubscribe method is called on an EventService, the EventService is required to check if any of subscribed objects are ProxySubscribers and if the object to be unsubscribed is the ProxySubscriber's proxiedSubscriber. If so, the EventService proxy is unsubscribed and the ProxySubscriber's proxyUnsubscribed() method is called to allow the proxy to perform any cleanup if necessary. ProxySubscribers should set their references to their proxied objects to null for strong subscriptions to allow garbage collection.


Method Summary
 Object getProxiedSubscriber()
           
 ReferenceStrength getReferenceStrength()
           
 void proxyUnsubscribed()
          Called by EventServices to inform the proxy that it is unsubscribed.
 

Method Detail

getProxiedSubscriber

Object getProxiedSubscriber()
Returns:
the object this proxy is subscribed on behalf of

proxyUnsubscribed

void proxyUnsubscribed()
Called by EventServices to inform the proxy that it is unsubscribed. The ProxySubscriber should null the reference to it's proxied subscriber


getReferenceStrength

ReferenceStrength getReferenceStrength()
Returns:
the reference strength from this proxy to the proxied subscriber


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