net.jini.lookup
Class ServiceDiscoveryManager.ServiceIdTask

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

private abstract static class ServiceDiscoveryManager.ServiceIdTask
extends ServiceDiscoveryManager.CacheTask

Abstract base class for controlling the order-of-execution of tasks corresponding to a particular serviceID associated with a particular lookup service.


Field Summary
protected  ServiceID thisTaskSid
           
 
Fields inherited from class net.jini.lookup.ServiceDiscoveryManager.CacheTask
reg, thisTaskSeqN
 
Constructor Summary
ServiceDiscoveryManager.ServiceIdTask(ServiceID srvcId, ServiceDiscoveryManager.ProxyReg reg, long seqN)
           
 
Method Summary
 ServiceID getServiceID()
          Returns the ServiceID associated with this task.
 boolean runAfter(List tasks, int size)
          Returns true if the current instance of this task must be run after at least one task in task manager queue.
 
Methods inherited from class net.jini.lookup.ServiceDiscoveryManager.CacheTask
getProxyReg, getSeqN, isFromProxy, run
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

thisTaskSid

protected ServiceID thisTaskSid
Constructor Detail

ServiceDiscoveryManager.ServiceIdTask

ServiceDiscoveryManager.ServiceIdTask(ServiceID srvcId,
                                      ServiceDiscoveryManager.ProxyReg reg,
                                      long seqN)
Method Detail

runAfter

public boolean runAfter(List tasks,
                        int size)
Returns true if the current instance of this task must be run after at least one task in task manager queue. The criteria for determining what value to return is as follows: If there is at least one task in the given task list that is associated with the same serviceID as this task, and that task has a sequence number less than the sequence number of this task, then run this task *after* the task in the list (return true); otherwise run this task now (return false).

Specified by:
runAfter in interface TaskManager.Task
Overrides:
runAfter in class ServiceDiscoveryManager.CacheTask
Parameters:
tasks - the tasks to consider.
size - elements with index less than size are considered.

getServiceID

public ServiceID getServiceID()
Returns the ServiceID associated with this task.



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