|
Foundation |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.services.discovery.LookupPolicyAttempts
public class LookupPolicyAttempts
A service discovery policy that will re-attempt to lookup services for a specified number of attempts.
An instance of this class may be passed to the ServiceLoader to
cause a lookup to be repeated for a specified number of times until
either it succeeds or until the maximum number of attempts is met.
Refer to
ServiceLoader.lookupRemoteDiscoveryServices(com.sas.services.deployment.MetadataSourceInterface, DiscoveryServiceInterface, LookupPolicyInterface)
Constructor Summary | |
---|---|
LookupPolicyAttempts()
Constructs a service lookup timeout policy using a default timeout. |
|
LookupPolicyAttempts(int maxNumAttempts,
long attemptIntervalInMsec)
Constructs an instance of a service lookup timeout policy using the specified timeout. |
Method Summary | |
---|---|
boolean |
isOKToRetryLookup(java.lang.String serviceLookupRequestId)
In the event that a local service lookup fails to return any results, this method will be invoked to determine whether or not the service lookup should be re-attempted. |
void |
serviceLookupInitiated(java.lang.String serviceLookupRequestId)
Notifies the policy implementation that a service lookup has started. |
void |
serviceLookupTerminated(java.lang.String serviceLookupRequestId)
Notifies the policy implementation that a service lookup has been terminated. |
void |
setMaxNumAttempts(int maxNumAttempts)
Specifies the maximum number of attempts that should be made when looking up services. |
void |
setPauseInterval(long attemptIntervalInMsec)
Specifies the minimum amount of time in msec that should elapse between service discovery attempts. |
java.lang.String |
toString()
Gets a string representation of the state of this object. |
Constructor Detail |
---|
public LookupPolicyAttempts()
public LookupPolicyAttempts(int maxNumAttempts, long attemptIntervalInMsec)
maxNumAttempts
- The maximum number of attempts that should be performed to
find services before giving up.attemptIntervalInMsec
- The minimum amount of time that should elapse between attempts
in msec.
java.lang.IllegalArgumentException
- if an invalid timeout parameter is
specified.Method Detail |
---|
public final void setMaxNumAttempts(int maxNumAttempts)
maxNumAttempts
- The maximum number of attempts.public final void setPauseInterval(long attemptIntervalInMsec)
attemptIntervalInMsec
- The minimum amount of time that should elapse between attempts
in msec.public final void serviceLookupInitiated(java.lang.String serviceLookupRequestId)
serviceLookupInitiated
in interface LookupPolicyInterface
serviceLookupRequestId
- An ID that the policy control implementation can use to distinguish
between multiple service lookup requests. This value will be used
in future interactions between the local discovery service and
this policy implementation. Refer to the following methods for
additional details.
public final void serviceLookupTerminated(java.lang.String serviceLookupRequestId)
serviceLookupTerminated
in interface LookupPolicyInterface
serviceLookupRequestId
- An ID that the policy control implementation can use to distinguish
between multiple service lookup requests. This value was
originally provided to the policy implementation when it was
notified of the start of a service lookup via the
(String)
serviceLookupInitiated (serviceLookupRequestId)
method.public final boolean isOKToRetryLookup(java.lang.String serviceLookupRequestId)
isOKToRetryLookup
in interface LookupPolicyInterface
serviceLookupRequestId
- The ID associated with a particular service lookup request.
The policy control implementation can use to distinguish
between multiple service lookup requests. This value was
originally provided to the policy implementation when it was
notified of the start of a service lookup via the
(String)
serviceLookupInitiated (serviceLookupRequestId)
method.
true
if the service lookup should be re-attempted or
false
if it shouldn't.public final java.lang.String toString()
toString
in class java.lang.Object
|
Foundation |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |