Generic superclass for registration objects that may have a listener Handles invalidation and pending delivery consistently to enable subclass to call listener callback without holding any library locks, yet avoid delivery to a cancelled listener. More...
Public Member Functions | |
abstract void | deliver () |
void | invalidate () |
This is called when removing interest or content handlers. | |
void | run () |
Calls the client handler. | |
boolean | equals (Object obj) |
Equality based on listener if present, so multiple objects can have the same interest registered without colliding. | |
int | hashCode () |
Public Attributes | |
Semaphore | sema = null |
Object | owner = null |
Protected Attributes | |
Object | listener |
CCNNetworkManager | manager |
boolean | deliveryPending = false |
long | id |
Generic superclass for registration objects that may have a listener Handles invalidation and pending delivery consistently to enable subclass to call listener callback without holding any library locks, yet avoid delivery to a cancelled listener.
void org.ccnx.ccn.impl.CCNNetworkManager.ListenerRegistration.invalidate | ( | ) |
This is called when removing interest or content handlers.
It's purpose is to insure that once the remove call begins it completes atomically without more handlers being triggered. Note that there is still not full atomicity here because a dispatch to handler might be in progress and we don't hold locks throughout the dispatch to avoid deadlocks.