java.lang.Object
org.monte.media.beans.WeakPropertyChangeListener
- All Implemented Interfaces:
PropertyChangeListener,EventListener
Property change listener that holds weak reference to a
target property change listener. If the weak reference
becomes null (meaning the delegate has been GC'ed) then this
listener will remove itself from any beans that it receives
events from. It isn't perfect, but it's a lot better than
nothing... and presumably beans that no longer send out events
probably don't care if their listeners weren't properly cleaned
up.
Design pattern: Proxy.
- Author:
- Paul Speed
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the target of this proxy.voidprotected voidMethod that can be subclassed to provide additional remove support.toString()
-
Constructor Details
-
WeakPropertyChangeListener
-
-
Method Details
-
removeFromSource
Method that can be subclassed to provide additional remove support. Default implementation only supports StandardBeans. -
propertyChange
- Specified by:
propertyChangein interfacePropertyChangeListener
-
getTarget
Returns the target of this proxy. Returns null if the target has been garbage collected.- Returns:
- The target or null.
-
toString
-