net.jini.lookup
Class ServiceDiscoveryManager.LookupCacheImpl

java.lang.Object
  extended by net.jini.lookup.ServiceDiscoveryManager.LookupCacheImpl
All Implemented Interfaces:
LookupCache
Enclosing class:
ServiceDiscoveryManager

private final class ServiceDiscoveryManager.LookupCacheImpl
extends Object
implements LookupCache

Internal implementation of the LookupCache interface. Instances of this class are used in the blocking versions of lookup() and are returned by createLookupCache.


Nested Class Summary
private  class ServiceDiscoveryManager.LookupCacheImpl.DiscardServiceTask
          Task class used to asynchronously notify service discard.
private  class ServiceDiscoveryManager.LookupCacheImpl.LookupListener
           
private  class ServiceDiscoveryManager.LookupCacheImpl.LookupTask
          This class requests a "snapshot" of the given registrar's state.
private  class ServiceDiscoveryManager.LookupCacheImpl.NewOldServiceTask
          Task class used to asynchronously process the service state ("snapshot"), matching this cache's template, that was retrieved from the given lookup service.
private  class ServiceDiscoveryManager.LookupCacheImpl.NotifyEventTask
          Task class used to asynchronously notify all registered service discovery listeners of serviceAdded/serviceRemoved/serviceChanged events.
private  class ServiceDiscoveryManager.LookupCacheImpl.ProxyRegDropTask
          When the given registrar is discarded, this Task class is used to remove the registrar from the various maps maintained by this cache.
private  class ServiceDiscoveryManager.LookupCacheImpl.RegisterListenerTask
          This task class, when executed, first registers to receive ServiceEvents from the given ServiceRegistrar.
private  class ServiceDiscoveryManager.LookupCacheImpl.ServiceDiscardTimerTask
          Task class used to determine whether or not to "commit" a service discard request, increasing the chances that the service will eventually be re-discovered.
private  class ServiceDiscoveryManager.LookupCacheImpl.UnmapProxyTask
          Task class used to asynchronously disassociate the given lookup service proxy from the given ServiceItemReg.
 
Field Summary
private  boolean bCacheTerminated
           
private  TaskManager cacheTaskMgr
          Task manager for the various tasks executed by this LookupCache
private  HashMap eventRegMap
           
private  ServiceItemFilter filter
           
private static int ITEM_ADDED
           
private static int ITEM_CHANGED
           
private static int ITEM_REMOVED
           
private  long leaseDuration
           
private  ServiceDiscoveryManager.LookupCacheImpl.LookupListener lookupListener
           
private  Exporter lookupListenerExporter
           
private  RemoteEventListener lookupListenerProxy
           
private  Object serviceDiscardMutex
           
private  TaskManager serviceDiscardTimerTaskMgr
          For tasks waiting on verification events after service discard
private  HashMap serviceIdMap
           
private  ArrayList sItemListeners
           
private  long startTime
           
private  long taskSeqN
          Whenever a ServiceIdTask is created in this cache, it is assigned a unique sequence number to allow such tasks associated with the same ServiceID to be executed in the order in which they were queued in the TaskManager.
private  ServiceTemplate tmpl
           
 
Constructor Summary
ServiceDiscoveryManager.LookupCacheImpl(ServiceTemplate tmpl, ServiceItemFilter filter, ServiceDiscoveryListener sListener, long leaseDuration)
           
 
Method Summary
private  void addFilteredItemToMap(ServiceItem item, ServiceItem filteredItem)
          Convenience method called by filterMaybeDiscard and ServiceDiscardTimerTask.run that finds the ServiceItemReg element in the serviceIdMap that corresponds to the given ServiceItem and, if such an element is found, replaces the item field of that element with the given item parameter; and sets the filteredItem field of that element to the value contained in the filteredItem parameter.
 void addListener(ServiceDiscoveryListener listener)
          Registers a ServiceDiscoveryListener object with the event mechanism of a LookupCache.
 void addProxyReg(ServiceDiscoveryManager.ProxyReg reg)
          Add a new ProxyReg to the lookupCache.
private  void addServiceNotify(ServiceItem item)
          Sends a notification to all listeners when a ServiceItem has been added.
private  void addServiceNotify(ServiceItem item, ServiceDiscoveryListener srvcListener)
          Sends a notification to the given listener when a ServiceItem has been added.
private  void cancelDiscardTask(ServiceID sid)
          Wake up service discard task if running, else remove from mgr.
private  void changeServiceNotify(ServiceItem newItem, ServiceItem oldItem)
          Sends a notification when a ServiceItem has been changed, but still matches.
private  void checkCacheTerminated()
           
 void discard(Object serviceReference)
          Deletes a service reference from the cache and causes a notification to be sent to all registered listeners indicating that the service has been discarded.
private  void discardRetryLater(ServiceItem item, ServiceRegistrar proxy, boolean sendEvent)
          Convenience method called by filterMaybeDiscard that finds in the serviceIdMap, the ServiceItemReg element corresponding to the given ServiceItem, sets a service removed event, and queues a ServiceDiscardTimerTask to retry the filter at a later time.
private  ServiceItem filterMaybeDiscard(ServiceItem item, ServiceRegistrar proxy, boolean sendEvent)
          Applies the first-stage filter associated with the current instance of LookupCache to the given item and returns the resulting filtered item if the filter is passed (or is null); otherwise, returns null and sends a service removed event if the sendEvent parameter is true.
private  ServiceItem findItem(ServiceID sid, ServiceItem[] items)
          Returns the element in the given items array having the given ServiceID.
 long getLeaseDuration()
          Gets the remaining time left on the current cache's "lifespan".
private  Iterator getServiceIdMapEntrySetIterator()
           
private  ServiceItem[] getServiceItems(ServiceItemFilter filter2)
          This method returns a ServiceItem array containing elements that satisfy the following conditions: - is referenced by one of the itemReg elements contained in the serviceIdMap - is not currently discarded - satisfies the given ServiceItemFilter Note that the filter parameter is a "2nd stage" filter.
private  void handleMatchNoMatch(ServiceRegistrar proxy, ServiceID srvcID, ServiceItem item)
          Convenience method called by NotifyEventTask.run (only when a TRANSITION_MATCH_NOMATCH event is received) that removes the given item from the serviceIdMap and wakes up the ServiceDiscardTimerTask if the given item is discarded; otherwise, sends a removed event.
private  void initCache()
           
private  void itemMatchMatchChange(ServiceRegistrar proxy, ServiceItem newItem, ServiceDiscoveryManager.ServiceItemReg itemReg, boolean matchMatchEvent)
          With respect to a given service (referenced by both the parameter newItem and the parameter itemReg), if either an event has been received from the given lookup service (referenced by the proxy parameter), or a snapshot of the given lookup service's state has been retrieved, this method determines whether the service's attributes have changed, or whether a new version of the service has been registered.
 ServiceItem lookup(ServiceItemFilter myFilter)
          Finds a ServiceItem object that satisfies the given filter parameter.
 ServiceItem[] lookup(ServiceItemFilter myFilter, int maxMatches)
          Finds an array of instances of ServiceItem that each satisfy the given filter parameter.
private  void notifyServiceMap(Object eventSource, long eventID, long seqNo, ServiceID sid, ServiceItem item, int transition)
          Called by the lookupListener's notify() method.
 void removeListener(ServiceDiscoveryListener listener)
          Removes a ServiceDiscoveryListener object from the set of listeners currently registered with the LookupCache.
 void removeProxyReg(ServiceDiscoveryManager.ProxyReg reg)
          Remove a ProxyReg from the lookupCache.
private  void removeServiceIdMap(ServiceID sid, ServiceItem item)
          Removes an entry from the serviceIdMap, and sends a notification.
private  void removeServiceIdMapSendNoEvent(ServiceID sid)
          Removes an entry in the serviceIdMap, but sends no notification.
private  void removeServiceNotify(ServiceItem item)
          Sends a notification when a ServiceItem has been removed.
private  void removeUselessTask(ServiceDiscoveryManager.ProxyReg reg)
          Removes from the cache's task manager, all pending tasks associated with the given ProxyReg.
private  boolean sameVersion(ServiceItem item0, ServiceItem item1)
          Convenience method that performs a byte-wise comparison, including codebases, of the services referenced by the given service items, and returns the result.
private  void serviceNotifyDo(ServiceItem oldItem, ServiceItem item, int action)
          Common code for performing service notification to all listeners.
private  void serviceNotifyDo(ServiceItem oldItem, ServiceItem item, int action, ServiceDiscoveryListener sl)
          Common code for performing service notification to one listener.
 void terminate()
          Performs cleanup duties related to the termination of the processing being performed by a particular instance of LookupCache.
private  void terminateTaskMgr(TaskManager taskMgr)
          For the given TaskManager, this method removes all pending and active tasks.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ITEM_ADDED

private static final int ITEM_ADDED
See Also:
Constant Field Values

ITEM_REMOVED

private static final int ITEM_REMOVED
See Also:
Constant Field Values

ITEM_CHANGED

private static final int ITEM_CHANGED
See Also:
Constant Field Values

lookupListener

private ServiceDiscoveryManager.LookupCacheImpl.LookupListener lookupListener

lookupListenerExporter

private Exporter lookupListenerExporter

lookupListenerProxy

private RemoteEventListener lookupListenerProxy

cacheTaskMgr

private TaskManager cacheTaskMgr
Task manager for the various tasks executed by this LookupCache


bCacheTerminated

private boolean bCacheTerminated

sItemListeners

private final ArrayList sItemListeners

serviceIdMap

private final HashMap serviceIdMap

eventRegMap

private final HashMap eventRegMap

tmpl

private ServiceTemplate tmpl

filter

private ServiceItemFilter filter

leaseDuration

private long leaseDuration

startTime

private final long startTime

serviceDiscardTimerTaskMgr

private TaskManager serviceDiscardTimerTaskMgr
For tasks waiting on verification events after service discard


serviceDiscardMutex

private Object serviceDiscardMutex

taskSeqN

private long taskSeqN
Whenever a ServiceIdTask is created in this cache, it is assigned a unique sequence number to allow such tasks associated with the same ServiceID to be executed in the order in which they were queued in the TaskManager. This field contains the value of the sequence number assigned to the most recently created ServiceIdTask.

Constructor Detail

ServiceDiscoveryManager.LookupCacheImpl

public ServiceDiscoveryManager.LookupCacheImpl(ServiceTemplate tmpl,
                                               ServiceItemFilter filter,
                                               ServiceDiscoveryListener sListener,
                                               long leaseDuration)
                                        throws RemoteException
Throws:
RemoteException
Method Detail

terminate

public void terminate()
Description copied from interface: LookupCache
Performs cleanup duties related to the termination of the processing being performed by a particular instance of LookupCache. For that instance, this method cancels all event leases granted by the lookup services that supplied the contents of the cache, and un-exports all remote listener objects registered with those lookup services. The terminate method is typically called when the entity is no longer interested in the contents of the LookupCache.

Specified by:
terminate in interface LookupCache

lookup

public ServiceItem lookup(ServiceItemFilter myFilter)
Description copied from interface: LookupCache
Finds a ServiceItem object that satisfies the given filter parameter.

The service item returned must have been previously discovered to be both registered with one or more of the lookup services in the managed set, and to match criteria defined by the entity.

The semantics of the filter argument are identical to those of the filter argument specified for a number of the methods defined in the interface of the ServiceDiscoveryManager utility class. This argument is intended to allow an entity to separate its filtering into two steps: an initial filter applied during the discovery phase, and a finer resolution filter applied upon retrieval from the cache. As with the methods of the ServiceDiscoveryManager, if null is the value of this argument, then no additional filtering will be performed.

Specified by:
lookup in interface LookupCache
Parameters:
myFilter - used for matching ServiceItems. A null value means no additional filtering should be applied.
Returns:
ServiceItem that satisfies the filter, and that was previously discovered to be registered with one or more lookup services in the managed set. A null value will be returned if no ServiceItem is found that matches the criteria or if the cache is empty.

lookup

public ServiceItem[] lookup(ServiceItemFilter myFilter,
                            int maxMatches)
Description copied from interface: LookupCache
Finds an array of instances of ServiceItem that each satisfy the given filter parameter.

Each service item contained in the returned array must have been previously discovered to be both registered with one or more of the lookup services in the managed set, and to match criteria defined by the entity.

The semantics of the filter argument are identical to those of the filter argument specified for a number of the methods defined in the interface of the ServiceDiscoveryManager utility class. This argument is intended to allow an entity to separate its filtering into two steps: an initial filter applied during the discovery phase, and a finer resolution filter applied upon retrieval from the cache. As with the methods of the ServiceDiscoveryManager, if null is the value of this argument, then no additional filtering will be performed.

Specified by:
lookup in interface LookupCache
Parameters:
myFilter - used for matching ServiceItems. A null value means no additional filtering should be applied.
maxMatches - maximum number of matches to return. If this value is set to Integer.MAX_VALUE then all elements in the cache that match the criteria will be returned.
Returns:
ServiceItem[] array whose elements each satisfy the filter, and that were previously discovered to be registered with one or more lookup services in the managed set. An empty array will be returned if no ServiceItem is found that matches the criteria or if the cache is empty.

discard

public void discard(Object serviceReference)
Description copied from interface: LookupCache
Deletes a service reference from the cache and causes a notification to be sent to all registered listeners indicating that the service has been discarded.

Specified by:
discard in interface LookupCache
Parameters:
serviceReference - the service reference to discard.

getServiceIdMapEntrySetIterator

private Iterator getServiceIdMapEntrySetIterator()

getServiceItems

private ServiceItem[] getServiceItems(ServiceItemFilter filter2)
This method returns a ServiceItem array containing elements that satisfy the following conditions: - is referenced by one of the itemReg elements contained in the serviceIdMap - is not currently discarded - satisfies the given ServiceItemFilter Note that the filter parameter is a "2nd stage" filter. That is, for each itemReg element in the serviceIdMap, the "1st stage" filter corresponding to the current instance of LookupCache has already been applied to the ServiceItem referenced in that itemReg. The ServiceItemFilter applied here is supplied by the entity interacting with the cache, and provides a second filtering process. Thus, this method applies the given filter parameter to the filteredItem field (not the item field) of each non-discarded itemReg element in the serviceIdMap. This method returns all the instances of ServiceItem that pass the given filter; and it discards all the items that produce an indefinite result when that filter is applied.


addListener

public void addListener(ServiceDiscoveryListener listener)
Description copied from interface: LookupCache
Registers a ServiceDiscoveryListener object with the event mechanism of a LookupCache. The listener object will receive a ServiceDiscoveryEvent upon the discovery, removal, or modification of one of the cache's services. Once a listener is registered, it will be notified of all service references discovered to date, and will be notified as new services are discovered and existing services are modified or discarded. If the parameter value duplicates (using equals) another element in the set of listeners, no action is taken. If the parameter value is null, a NullPointerException is thrown.

Specified by:
addListener in interface LookupCache
Parameters:
listener - the ServiceDiscoveryListener object to register.
See Also:
LookupCache.removeListener(net.jini.lookup.ServiceDiscoveryListener)

removeListener

public void removeListener(ServiceDiscoveryListener listener)
Description copied from interface: LookupCache
Removes a ServiceDiscoveryListener object from the set of listeners currently registered with the LookupCache. Once all listeners are removed from the cache's set of listeners, the cache will send no more ServiceDiscoveryEvent notifications. If the parameter value is null, or if the parameter value does not exist in the managed set of listeners, no action is taken.

Specified by:
removeListener in interface LookupCache
Parameters:
listener - the ServiceDiscoveryListener object to remove.
See Also:
LookupCache.addListener(net.jini.lookup.ServiceDiscoveryListener)

addProxyReg

public void addProxyReg(ServiceDiscoveryManager.ProxyReg reg)
Add a new ProxyReg to the lookupCache. Called by the constructor and the DiscMgrListener's discovered() method.

Parameters:
reg - a ProxyReg to add.

removeProxyReg

public void removeProxyReg(ServiceDiscoveryManager.ProxyReg reg)
Remove a ProxyReg from the lookupCache. Called by DiscMgrListener's discarded() method.

Parameters:
reg - a ProxyReg to remove.

checkCacheTerminated

private void checkCacheTerminated()

notifyServiceMap

private void notifyServiceMap(Object eventSource,
                              long eventID,
                              long seqNo,
                              ServiceID sid,
                              ServiceItem item,
                              int transition)
Called by the lookupListener's notify() method. Checks the event sequence number and, based on whether or not a "gap" is found in in the event sequence, creates and places on the queue, either a LookupTask (if a gap was found) or a NotifyTask. Recall that the Event specification states that if the sequence numbers of two successive events differ by only 1, then one can be assured that no events were missed. On the other hand, if the difference is greater than 1 (the sequence contains a "gap"), then one or more events may -- or may not -- have been missed. Thus, if a gap is found in the events, although it's possible that no events were missed, this method takes the conservative approach by assuming events were missed. When this method determines that an event may have been missed, it requests a current "snapshot" of the given ServiceRegistrar's state by queueing the execution of a LookupTask. Since this method can safely assume that no events have been missed if it finds no gaps in the event sequence, this method queues the notification of the entity by requesting the execution of a NotifyEventTask. Note that when a lookup service is discovered, this utility registers with that lookup service's event mechanism for service events related to the services of interest. Upon registering with the event mechanism, a data structure (of type EventReg) containing information about that registration is placed in a Map for later processing when events do arrive. If the timing is right, it is possible that a service event may arrive between the time the registration is made and the time the EventReg is stored in the map. Thus, this method may find that the eventRegMap does not contain an element corresponding to the event this method is currently processing. In that case, this method will do nothing. It will simply return so that the service referenced in the event can be discovered using the snapshot returned by the LookupTask that is ultimately queued by the RegisterListenerTask (whose listener registration caused this method to be invoked in the first place).


removeUselessTask

private void removeUselessTask(ServiceDiscoveryManager.ProxyReg reg)
Removes from the cache's task manager, all pending tasks associated with the given ProxyReg. This method is called when the given ProxyReg has been discarded.


terminateTaskMgr

private void terminateTaskMgr(TaskManager taskMgr)
For the given TaskManager, this method removes all pending and active tasks.


removeServiceIdMap

private void removeServiceIdMap(ServiceID sid,
                                ServiceItem item)
Removes an entry from the serviceIdMap, and sends a notification.


removeServiceIdMapSendNoEvent

private void removeServiceIdMapSendNoEvent(ServiceID sid)
Removes an entry in the serviceIdMap, but sends no notification.


findItem

private ServiceItem findItem(ServiceID sid,
                             ServiceItem[] items)
Returns the element in the given items array having the given ServiceID.


itemMatchMatchChange

private void itemMatchMatchChange(ServiceRegistrar proxy,
                                  ServiceItem newItem,
                                  ServiceDiscoveryManager.ServiceItemReg itemReg,
                                  boolean matchMatchEvent)
With respect to a given service (referenced by both the parameter newItem and the parameter itemReg), if either an event has been received from the given lookup service (referenced by the proxy parameter), or a snapshot of the given lookup service's state has been retrieved, this method determines whether the service's attributes have changed, or whether a new version of the service has been registered. After the appropriate determination has been made, this method applies the filter associated with the current cache and sends the appropriate local ServiceDiscoveryEvent(s). This method is called under the following conditions: - when a new lookup service is discovered, this method will be called for each previously discovered service - when a gap in the events from a previously discovered lookup service is discovered, this method will be called for each previously discovered service - when a MATCH_MATCH event is received, this method will be called for each previously discovered service - when a NOMATCH_MATCH event is received, this method will be called for each previously discovered service Note that this method is never called when a MATCH_NOMATCH event is received; such an event is always handled in NotifyEventTask. When this method is called, it may send one of the following events or combination of events: - a service changed event - a service removed event followed by a service added event - a service removed event A service removed event is sent when the service either fails the filter, or the filter produces an indefinite result; in which case, the service is also discarded. A service changed event is sent when the service passes the filter, and it is determined that the service's attributes have changed. In this case, the old and new service proxies are treated as the same if one of the following conditions is met: - this method was called because of the receipt of a MATCH_MATCH event - the old and new service proxies are byte-wise fully equal (Note that the lookup service specification guarantees that the proxies are the same when a MATCH_MATCH event is received.) A service removed event followed by a service added event is sent when the service passes the filter, and the conditions for which a service changed event would be considered are not met; that is, this method was not called because of the receipt of a MATCH_MATCH event; or the old and new service proxies are not byte-wise fully equal. The if-else-block contained in this method implements the logic just described. The parameter matchMatchEvent reflects the pertinent event state that causes this method to be called. That is, either a MATCH_MATCH event was received, or it wasn't, (and if it wasn't, then a full byte-wise comparison is performed to determine whether the proxies are still the same). To understand when the 'else' part of the if-else-block is executed, consider the following conditions: - there is more than one lookup service with which the service registers (ex. LUS-0 and LUS-1) - after the service registers with LUS-0, a NOMATCH_MATCH event is received and handled (so the service is now known to the cache) - before the service registers with LUS-1, the service is replaced with a new version - the NOMATCH_MATCH event resulting from the service's registration with LUS-1 is received BEFORE receiving the MATCH_NOMATCH/NOMATCH_MATCH event sequence that will ultimately result from the re-registration of that new version with LUS-0 When the above conditions occur, the NOMATCH_MATCH event that resulted from the service's registration with LUS-1 will cause this method to be invoked and the proxies to be fully compared (because the event was not a MATCH_MATCH event); and since the old service proxy and the new service proxy will not be fully equal, the else part of the if-else-block will be executed. This method applies the filter only after the above comparisons and determinations have been completed.


sameVersion

private boolean sameVersion(ServiceItem item0,
                            ServiceItem item1)
Convenience method that performs a byte-wise comparison, including codebases, of the services referenced by the given service items, and returns the result. If the services cannot be compared, it is assumed that the versions are not the same, and false is returned.


getLeaseDuration

public long getLeaseDuration()
Gets the remaining time left on the current cache's "lifespan".


addServiceNotify

private void addServiceNotify(ServiceItem item)
Sends a notification to all listeners when a ServiceItem has been added.


addServiceNotify

private void addServiceNotify(ServiceItem item,
                              ServiceDiscoveryListener srvcListener)
Sends a notification to the given listener when a ServiceItem has been added.


removeServiceNotify

private void removeServiceNotify(ServiceItem item)
Sends a notification when a ServiceItem has been removed.


changeServiceNotify

private void changeServiceNotify(ServiceItem newItem,
                                 ServiceItem oldItem)
Sends a notification when a ServiceItem has been changed, but still matches.


serviceNotifyDo

private void serviceNotifyDo(ServiceItem oldItem,
                             ServiceItem item,
                             int action)
Common code for performing service notification to all listeners.


serviceNotifyDo

private void serviceNotifyDo(ServiceItem oldItem,
                             ServiceItem item,
                             int action,
                             ServiceDiscoveryListener sl)
Common code for performing service notification to one listener.


initCache

private void initCache()
                throws RemoteException
Throws:
RemoteException

filterMaybeDiscard

private ServiceItem filterMaybeDiscard(ServiceItem item,
                                       ServiceRegistrar proxy,
                                       boolean sendEvent)
Applies the first-stage filter associated with the current instance of LookupCache to the given item and returns the resulting filtered item if the filter is passed (or is null); otherwise, returns null and sends a service removed event if the sendEvent parameter is true.

This method is called only when the item to be filtered corresponds to an element that currently exists in the serviceIdMap.

As described in the ServiceItemFilter specification, when the item passes the filter, the service field of the item is replaced with the filtered form of the object previously contained in that field. In this case, the filteredItem field of the corresponding ServiceItemReg element of the serviceIdMap is set to this new filtered item.

If the filter returns indefinite, then that specification states that the service field is replaced with null. In this case, the filteredItem field of the corresponding ServiceItemReg element of the serviceIdMap is left unchanged.


addFilteredItemToMap

private void addFilteredItemToMap(ServiceItem item,
                                  ServiceItem filteredItem)
Convenience method called by filterMaybeDiscard and ServiceDiscardTimerTask.run that finds the ServiceItemReg element in the serviceIdMap that corresponds to the given ServiceItem and, if such an element is found, replaces the item field of that element with the given item parameter; and sets the filteredItem field of that element to the value contained in the filteredItem parameter.


discardRetryLater

private void discardRetryLater(ServiceItem item,
                               ServiceRegistrar proxy,
                               boolean sendEvent)
Convenience method called by filterMaybeDiscard that finds in the serviceIdMap, the ServiceItemReg element corresponding to the given ServiceItem, sets a service removed event, and queues a ServiceDiscardTimerTask to retry the filter at a later time. If the serviceIdMap does not contain a ServiceItemReg corresponding to the given ServiceItem, then this method simply returns.


handleMatchNoMatch

private void handleMatchNoMatch(ServiceRegistrar proxy,
                                ServiceID srvcID,
                                ServiceItem item)
Convenience method called by NotifyEventTask.run (only when a TRANSITION_MATCH_NOMATCH event is received) that removes the given item from the serviceIdMap and wakes up the ServiceDiscardTimerTask if the given item is discarded; otherwise, sends a removed event.


cancelDiscardTask

private void cancelDiscardTask(ServiceID sid)
Wake up service discard task if running, else remove from mgr.



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