net.jini.lookup
Class ServiceDiscoveryManager.LookupCacheImpl.UnmapProxyTask

java.lang.Object
  extended by net.jini.lookup.ServiceDiscoveryManager.CacheTask
      extended by net.jini.lookup.ServiceDiscoveryManager.ServiceIdTask
          extended by net.jini.lookup.ServiceDiscoveryManager.LookupCacheImpl.UnmapProxyTask
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.


Field Summary
private  ServiceDiscoveryManager.ServiceItemReg itemReg
           
 
Fields inherited from class net.jini.lookup.ServiceDiscoveryManager.ServiceIdTask
thisTaskSid
 
Fields inherited from class net.jini.lookup.ServiceDiscoveryManager.CacheTask
reg, thisTaskSeqN
 
Constructor Summary
ServiceDiscoveryManager.LookupCacheImpl.UnmapProxyTask(ServiceDiscoveryManager.ProxyReg reg, ServiceDiscoveryManager.ServiceItemReg itemReg, ServiceID srvcId, long seqN)
           
 
Method Summary
 void run()
           
 
Methods inherited from class net.jini.lookup.ServiceDiscoveryManager.ServiceIdTask
getServiceID, runAfter
 
Methods inherited from class net.jini.lookup.ServiceDiscoveryManager.CacheTask
getProxyReg, getSeqN, isFromProxy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

itemReg

private ServiceDiscoveryManager.ServiceItemReg itemReg
Constructor Detail

ServiceDiscoveryManager.LookupCacheImpl.UnmapProxyTask

public ServiceDiscoveryManager.LookupCacheImpl.UnmapProxyTask(ServiceDiscoveryManager.ProxyReg reg,
                                                              ServiceDiscoveryManager.ServiceItemReg itemReg,
                                                              ServiceID srvcId,
                                                              long seqN)
Method Detail

run

public void run()
Specified by:
run in interface Runnable
Specified by:
run in class ServiceDiscoveryManager.CacheTask


Copyright 2007-2010, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.