net.jini.discovery
Class LookupLocatorDiscovery.LocatorReg

java.lang.Object
  extended by net.jini.discovery.LookupLocatorDiscovery.LocatorReg
Enclosing class:
LookupLocatorDiscovery

private class LookupLocatorDiscovery.LocatorReg
extends Object

Wrapper class in which each instance corresponds to a lookup service to discover via unicast discovery.


Field Summary
private  int cnt
           
private  boolean discarded
           
private  int id
           
 LookupLocator l
           
 String[] memberGroups
           
private static long MIN_RETRY
           
private  long nextTryTime
           
 ServiceRegistrar proxy
           
private  long[] sleepTime
           
private  long time
           
private  int tryIndx
           
 
Constructor Summary
LookupLocatorDiscovery.LocatorReg(LookupLocator l)
           
 
Method Summary
 void calcNextTryTime()
          Computes the time (in milliseconds) used to determine when it is allowable -- after a previous failure -- to again attempt unicast discovery of the lookup service referenced in this class.
 void delayNextTryTime()
          This method gets called only from the public discard() method.
private  void doUnicastDiscovery(LookupLocator locator, InvocationConstraints ic)
          This method employs the unicast discovery protocol to discover the registrar having LookupLocator equal to the value contained in the locator parameter of this class.
 boolean equals(Object obj)
          Returns true if the locators are equal.
 long getNextTryTime()
          Accessor that returns the absolute time at which the next discovery attempt should be made after the previous attempt has failed to find the desired lookup service.
 int hashCode()
          Returns the hash code of the locator referenced in this class.
private  void queueDiscoveryTask()
           
 boolean tryGetProxy()
          Initiates unicast discovery of the lookup service referenced in this class.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

proxy

public ServiceRegistrar proxy

l

public final LookupLocator l

memberGroups

public String[] memberGroups

discarded

private boolean discarded

cnt

private int cnt

MIN_RETRY

private static final long MIN_RETRY
See Also:
Constant Field Values

sleepTime

private final long[] sleepTime

tryIndx

private int tryIndx

nextTryTime

private long nextTryTime

id

private final int id

time

private long time
Constructor Detail

LookupLocatorDiscovery.LocatorReg

public LookupLocatorDiscovery.LocatorReg(LookupLocator l)
Method Detail

getNextTryTime

public long getNextTryTime()
Accessor that returns the absolute time at which the next discovery attempt should be made after the previous attempt has failed to find the desired lookup service.


calcNextTryTime

public void calcNextTryTime()
Computes the time (in milliseconds) used to determine when it is allowable -- after a previous failure -- to again attempt unicast discovery of the lookup service referenced in this class. Since this method is called multiple times for a particular lookup service only when there is difficulty discovering that lookup service, the value computed by this method increases in a graduated manner - increasing the amount of time to wait before the next discovery attempt should be made - upon each invocation, eventually reaching a maximum time interval over which discovery is re-tried. In this way, the network is not flooded with unicast discovery requests referencing a lookup service that may not be available for quite some time (if ever).


delayNextTryTime

public void delayNextTryTime()
This method gets called only from the public discard() method. The purpose of this method is to delay the next discovery attempt.


tryGetProxy

public boolean tryGetProxy()
Initiates unicast discovery of the lookup service referenced in this class.


doUnicastDiscovery

private void doUnicastDiscovery(LookupLocator locator,
                                InvocationConstraints ic)
                         throws IOException,
                                ClassNotFoundException
This method employs the unicast discovery protocol to discover the registrar having LookupLocator equal to the value contained in the locator parameter of this class.

Throws:
IOException
ClassNotFoundException

queueDiscoveryTask

private void queueDiscoveryTask()

equals

public boolean equals(Object obj)
Returns true if the locators are equal.

Overrides:
equals in class Object

hashCode

public int hashCode()
Returns the hash code of the locator referenced in this class.

Overrides:
hashCode in class Object


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