|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.j_spaces.core.client.LookupFinder
public class LookupFinder
LookupFinder is a generalized concept of the SpaceFinder utility. It simplifies the process of service lookup and acquiring a proxy of this service. The lookup performed on three criterions: service name, service class and service attributes. Any one of the above criterion can be null.
Nested Class Summary | |
---|---|
static class |
LookupFinder.LookupEntriesComparator
|
Field Summary | |
---|---|
static long |
DEFAULT_TIMEOUT
Default service lookup timeout Default value is 5 seconds |
Fields inherited from interface com.j_spaces.core.Constants.Client |
---|
CLIENT_RETRY_CONNECTION_DEFAULT, CLIENT_RETRY_CONNECTION_PROP, FULL_CLIENT_RETRY_CONNECTION_PROP, FULL_NUMBER_OF_IMPLICIT_INDEXES_PROP, NUMBER_OF_IMPLICIT_INDEXES_DEFAULT, NUMBER_OF_IMPLICIT_INDEXES_PROP |
Constructor Summary | |
---|---|
LookupFinder()
|
Method Summary | |
---|---|
static Object |
find(Class[] classes,
Entry[] srvAttr,
String lookupHost,
long timeout,
Properties customProps)
Finds specified service according to service classes and service attributes. |
static Object |
find(String serviceName,
Class[] classes,
Entry[] serviceAttributes,
String lookupHost,
String groups,
long timeout)
Finds specified server using all the criterion: service name, service classes and service attributes. |
static Object |
find(String serviceName,
Class[] classes,
Entry[] serviceAttributes,
String lookupHost,
String groups,
long timeout,
long timeoutInterval,
Properties customProps)
Finds specified server using all the criterions: service name, service classes and service attributes. |
static Object |
find(String serviceName,
Class[] classes,
Entry[] serviceAttributes,
String lookupHost,
String groups,
long timeout,
Properties customProps)
Finds specified server using all the criterions: service name, service classes and service attributes. |
static Object |
find(String serviceName,
Class srvClass,
String lookupHost,
long timeout,
Properties customProps)
Finds specified service according to service name and service class only. |
static boolean |
waitForLookupService(String[] groups,
LookupLocator[] locators,
long timeout,
long intervalTimeout)
Creates (or reuses) the lookup service and waits for at least one LUS to be discovered. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final long DEFAULT_TIMEOUT
Constructor Detail |
---|
public LookupFinder()
Method Detail |
---|
public static Object find(String serviceName, Class[] classes, Entry[] serviceAttributes, String lookupHost, String groups, long timeout, Properties customProps) throws FinderException
serviceName
- Service name. Can be null.classes
- Array of service class. Can be nullserviceAttributes
- Array of service attributes. Can be nulllookupHost
- A hostname of the computer running the Jini Lookup service where the search to be done
If null then the search is issued on any available Jini Lookup service using multicast protocol.groups
- Comma separated string of groups that the service belongs totimeout
- lookup timeoutcustomProps
- The custom properties object which might contain overwrites to the configuration.
In our case, it can include the unicast list of hosts which we will lookup upon using unicast discovery.
FinderException
- Failed to find desired serviceName
.public static Object find(String serviceName, Class[] classes, Entry[] serviceAttributes, String lookupHost, String groups, long timeout, long timeoutInterval, Properties customProps) throws FinderException
serviceName
- Service name. Can be null.classes
- Array of service class. Can be nullserviceAttributes
- Array of service attributes. Can be nulllookupHost
- A hostname of the computer running the Jini Lookup service where the search to be done
If null then the search is issued on any available Jini Lookup service using multicast protocol.groups
- Comma separated string of groups that the service belongs totimeout
- lookup timeouttimeoutInterval
- The interval we use in order to poll the SDM for lookup itemscustomProps
- The custom properties object which might contain overwrites to the configuration.
In our case, it can include the unicast list of hosts which we will lookup upon using unicast discovery.
FinderException
- Failed to find desired serviceName
.public static boolean waitForLookupService(String[] groups, LookupLocator[] locators, long timeout, long intervalTimeout) throws Exception
true
if the LUS was discovered within the given timeout.
groups
- The groups to use to find the LUSlocators
- The locators to use to find the LUStimeout
- The time to wait in order to find a LUSintervalTimeout
- The interval (in millis) at which the finder polls for LUS
true
if a LUS was found. false
otherwise.
Exception
public static Object find(String serviceName, Class[] classes, Entry[] serviceAttributes, String lookupHost, String groups, long timeout) throws FinderException
serviceName
- Service name. Can be null.classes
- Array of service class. Can be nullserviceAttributes
- Array of service attributes. Can be nulllookupHost
- A hostname of the computer running the Jini Lookup service where the search to be done
If null then the search is issued on any available Jini Lookup service using multicast protocol.groups
- Comma separated string of groups that the service belongs totimeout
- lookup timeout
FinderException
- Failed to find desired serviceName
.public static Object find(String serviceName, Class srvClass, String lookupHost, long timeout, Properties customProps) throws FinderException
serviceName
- Service name. Can be null.srvClass
- Service classes. Can be nulllookupHost
- A hostname of the computer running the Jini Lookup service where the search to be done
If null then the search is issued on any available Jini Lookup servicetimeout
- lookup timeoutcustomProps
- The custom properties object which might contain overwrites to the configuration.
In our case, it might include the unicast list of hosts which we will lookup upon using unicast discovery.
FinderException
- Failed to find desired serviceName
.public static Object find(Class[] classes, Entry[] srvAttr, String lookupHost, long timeout, Properties customProps) throws FinderException
classes
- Array of service classes. Can be nullsrvAttr
- Array of service attributes. Can be nulllookupHost
- A hostname of the computer running the Jini Lookup service where the search to be done
If null then the search is issued on any available Jini Lookup servicetimeout
- lookup timeoutcustomProps
- The custom properties object which might contain overwrites to the configuration.
In our case, it can include the unicast list of hosts which we will lookup upon using unicast discovery.
FinderException
- Failed to find desired serviceName
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |