Class ControllerHashtableChangeListener.WeakReferenceAdapter

java.lang.Object
com.illumon.iris.controller.ControllerHashtableChangeListener.Adapter
com.illumon.iris.controller.ControllerHashtableChangeListener.WeakReferenceAdapter
All Implemented Interfaces:
ControllerHashtableEventHandler
Enclosing interface:
ControllerHashtableChangeListener

public static class ControllerHashtableChangeListener.WeakReferenceAdapter extends ControllerHashtableChangeListener.Adapter
Converts ControllerHashtableEventHandler.handleEvent(ControllerHashtableEvent) calls into ControllerHashtableChangeListener.handleAdd(Long, PersistentQueryInfo), ControllerHashtableChangeListener.handleRemove(Long, PersistentQueryInfo), and ControllerHashtableChangeListener.handleChange(Long, PersistentQueryInfo, PersistentQueryInfo) calls.

Maintains a hard reference to the source, in order to allow for automatic removal on the next notification after the listener is collected. This is used for removal only - adding the event handler is left to the caller, in order to preserve choice between addEventHandler() and addEventHandlerAndGetData().

Code using this almost certainly needs to maintain its own hard reference to the listener, in order to avoid losing the event handler unexpectedly.