net.jini.lookup
Class ServiceDiscoveryManager.LookupCacheImpl.NewOldServiceTask

java.lang.Object
  extended by net.jini.lookup.ServiceDiscoveryManager.CacheTask
      extended by net.jini.lookup.ServiceDiscoveryManager.ServiceIdTask
          extended by net.jini.lookup.ServiceDiscoveryManager.LookupCacheImpl.NewOldServiceTask
All Implemented Interfaces:
TaskManager.Task, Runnable
Enclosing class:
ServiceDiscoveryManager.LookupCacheImpl

private final class ServiceDiscoveryManager.LookupCacheImpl.NewOldServiceTask
extends ServiceDiscoveryManager.ServiceIdTask

Task class used to asynchronously process the service state ("snapshot"), matching this cache's template, that was retrieved from the given lookup service. After retrieving the snapshot S, the LookupTask queues an instance of this task for each service referenced in S. This task determines if the given service is an already-discovered service (is currently in this cache's serviceIdMap), or is a new service. This task handles the service differently, depending on whether the service is a new or old. a. if the item is old, then this task will: - compare the given item from the snapshot to the UN-filtered item in given itemReg if(same version but attributes have changed) send changed event else if( version has changed ) send removed event followed by added event else do nothing - apply the filter to the given item if(filter fails) send removed event else if(filter passes) set the filtered item in the itemReg in the map else if (filter is indefinite) discard item send removed event queue another filter attempt for later b. if the given item is newly discovered, then this task will: - create a new ServiceItemReg containing the given item - place the new itemReg in the serviceIdMap - apply the filter to the given item if(filter fails) remove the item from the map but send NO removed event else if(filter passes) send added event for the FILTERED item else if (filter is indefinite) discard item queue another filter attempt for later but send NO removed event


Field Summary
private  boolean matchMatchEvent
           
private  ServiceItem srvcItem
           
 
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.NewOldServiceTask(ServiceDiscoveryManager.ProxyReg reg, ServiceItem item, boolean matchMatchEvent, 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

srvcItem

private ServiceItem srvcItem

matchMatchEvent

private boolean matchMatchEvent
Constructor Detail

ServiceDiscoveryManager.LookupCacheImpl.NewOldServiceTask

public ServiceDiscoveryManager.LookupCacheImpl.NewOldServiceTask(ServiceDiscoveryManager.ProxyReg reg,
                                                                 ServiceItem item,
                                                                 boolean matchMatchEvent,
                                                                 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.