- All Implemented Interfaces:
- TaskManager.Task, Runnable
- Enclosing class:
- ServiceDiscoveryManager.LookupCacheImpl
private final class ServiceDiscoveryManager.LookupCacheImpl.UnmapProxyTask
extends ServiceDiscoveryManager.ServiceIdTask
Task class used to asynchronously disassociate the given lookup
service proxy from the given ServiceItemReg. This task is created
and queued in both the LookupTask, and the ProxyRegDropTask.
When the LookupTask determines that the service referenced by the
given ServiceItemReg is an "orphan", the LookupTask queues an
instance of this task. A service is an orphan if it is referenced
in the serviceIdMap, but is no longer registered in any of the
lookup service(s) to which it is mapped in the serviceIdMap.
Note that the existence of orphans is possible when events from
a particular lookup service are missed; that is, there is a "gap"
in the event sequence numbers.
When a previously discovered lookup service is discarded, the
ProxyRegDropTask is initiated, and that task creates and queues
an instance of this task for each mapping in this cache's
serviceIdMap.
This task removes the given lookup service proxy from the set
associated with the service item referenced in the given
ServiceItemReg, and determines whether that service is still
associated with at least one lookup service. If the service is
no longer associated with any other lookup service in the managed
set of lookup services, the mapping that references the given
ServiceItemReg is removed from the serviceIdMap, and a
serviceRemoved event is sent.
In this way, other tasks from this cache operating on the same
service will not concurrently modify any state related to that
service.