net.jini.lookup
Class ServiceDiscoveryManager.LookupCacheImpl.NewOldServiceTask
java.lang.Object
net.jini.lookup.ServiceDiscoveryManager.CacheTask
net.jini.lookup.ServiceDiscoveryManager.ServiceIdTask
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
Method Summary |
void |
run()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
srvcItem
private ServiceItem srvcItem
matchMatchEvent
private boolean matchMatchEvent
ServiceDiscoveryManager.LookupCacheImpl.NewOldServiceTask
public ServiceDiscoveryManager.LookupCacheImpl.NewOldServiceTask(ServiceDiscoveryManager.ProxyReg reg,
ServiceItem item,
boolean matchMatchEvent,
long seqN)
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.