Package com.j_spaces.core.client
Class SpaceFinder
java.lang.Object
com.j_spaces.core.client.SpaceFinder
- Direct Known Subclasses:
CacheFinder
Deprecated.
This utility class provides accessing to Container proxy or Space proxy (IJSpace). The SpaceFinder is designed to provide a unified interface for finding a space/container in each of the mode specified. In addition to the lookup option there is another option of finding the space via its container. To provide a unified manager of accessing the space in any of the above modes we will use a url based interface which will provide the information of the protocol and the address of the space that should be found. The general format for this URL is as follows:Protocol://[host]:[port]/[container_name]/[space_name]?[query_string]Protocol: [ rmi | jini | java ] The "java" protocol enables working with an embedded space. When choosing so one should specify in the query string one of three space operations: > create - to create a new space example of "mySpace" space creation:java://myHost/myContinaer/mySpace?create> open - To open an existing space in an embedded mode: example of opening "mySpace" space:java://myHost/myContinaer/mySpace?open> destroy - for destroy an existing space: example of destroying "mySpace" space:java://myHost/myContinaer/mySpace?destroyHost: The host name. Can be '*', when JINI is used as a protocol, the host value determines whether to use Unicast or Multicast. Port: the registry or lookup port. If the port is not specified, the default port 10098 will be used. Container Name: The name of the container, which holds the space. If the container name is '*' then the container attribute will be ignored and the space will be looked for directly regardless of the container that holds it . Examples of space url's: 1. Looking for a space using JINI Unicast protocol.jini://mylookuphost/mycontainername/myspaceOrjini://*/*/myspace2. Looking for a space using the JINI multicast protocol.jini://*/containername/myspaceOrjini://*/*/myspace3. looking for a container regardless of the space it contains in any of the above methods:jini://mylookuphost/mycontainernamejini://*/mycontainernameFor more details, examples and options seeSpaceURL
- Version:
- 1.0
- Author:
- Igor Goldenberg
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectDeprecated.The general format for this URL is as follows: Protocol://[host]:[port]/[container_name]/[space_name]?[query_string] Protocol: [ RMI | JINI | JAVA ] This method also supports multiple URLs separate by ";", e.i.static Objectfind(SpaceURL[] spaceURLs, CredentialsProvider credentialsProvider) Deprecated.static Objectfind(SpaceURL spaceURL, CredentialsProvider credentialsProvider) Deprecated.The general format for this URL is as follows: Protocol://[host]:[port]/[container_name]/[space_name]?[query_string] Protocol: [ RMI | JINI | JAVA ] This method also supports multiple URLs separate by ";", e.i.static Objectfind(SpaceURL spaceURL, CredentialsProvider credentialsProvider, long timeout, LookupType lookupType) Deprecated.static ObjectDeprecated.The general format for this URL is as follows: Protocol://[host]:[port]/[container_name]/[space_name]?[query_string] Protocol: [ RMI | JINI | JAVA ] This method also supports multiple URLs separate by ";", e.i.static ObjectDeprecated.SpaceFinder.find multiple URL provides ability to define space search order.static Objectfind(String urls, Properties customProperties) Deprecated.The general format for this URL is as follows: Protocol://[host]:[port]/[container_name]/[space_name]?[query_string] Protocol: [ RMI | JINI | JAVA ] This method also supports multiple URLs separate by ";", e.i.static Objectfind(String urls, Properties customProperties, LifeCycle lifeCycle, CredentialsProvider credentialsProvider) Deprecated.Finds or creates an instance of a GigaSpace based on the specified spaceURL.static IRemoteSpacefindJiniSpace(SpaceURL url, String spaceUuid, Properties customProperties, long timeout, LookupType lookupType) Deprecated.Returns Either LRMISpaceImpl or SpaceProxyImpl.protected ObjectfindService(SpaceURL[] spaceURLs, Properties customProperties, LifeCycle lifeCycle, CredentialsProvider credentialsProvider) Deprecated.protected ObjectfindService(SpaceURL url, Properties customProperties, LifeCycle lifeCycle, CredentialsProvider credentialsProvider, long timeout, LookupType lookupType) Deprecated.The main method of SpaceFinder to find single Space or Container proxy.protected ObjectfindService(String[] urls) Deprecated.protected ObjectfindService(String url, Properties customProperties, LifeCycle lifeCycle, CredentialsProvider credentialsProvider) Deprecated.static voidDeprecated.This main provides the following options: 1.static SpaceURLDeprecated.Verifies for validation if the specifiedurlis valid and returnsSpaceURLobject that contains all information about specifiedurl.
-
Field Details
-
_logger
protected final org.slf4j.Logger _loggerDeprecated.
-
-
Constructor Details
-
SpaceFinder
protected SpaceFinder()Deprecated.Singleton.
-
-
Method Details
-
verifyURL
Deprecated.Verifies for validation if the specifiedurlis valid and returnsSpaceURLobject that contains all information about specifiedurl. This method also support multiple URLs separate by ";"- Parameters:
url- Theurlto verify.- Returns:
- Returns
SpaceURLobject that contains all information about specifiedurl. - Throws:
MalformedURLException- Throws exception if specifiedurlis not valid.
-
find
Deprecated.SpaceFinder.find multiple URL provides ability to define space search order. It is useful when Jini URL for locating services on the network is not available. If the first space URL is unavailable, SpaceFinder will try the next one until a live proxy will be found. If all URLs are unavailable this method throws FinderException- Parameters:
urls- Array of SpaceFinder URLs.- Returns:
- Returns single found proxy.
- Throws:
FinderException- Failed to found proxy.All URLs are unavailable.
-
find
Deprecated.The general format for this URL is as follows: Protocol://[host]:[port]/[container_name]/[space_name]?[query_string] Protocol: [ RMI | JINI | JAVA ] This method also supports multiple URLs separate by ";", e.i. jini://localhost/containerName/SpaceName;jini://'*'/containerName/SpaceName; It is useful when Jini URL for locating services on the network is not available. If the first space URL is unavailable, SpaceFinder will try the next one until a live proxy will be found. If all URLs are unavailable this method throws FinderException- Parameters:
urls- Space URL- Returns:
- Returns single Space or Container proxy.
- Throws:
FinderException- During finding space or container.
-
find
Deprecated.The general format for this URL is as follows: Protocol://[host]:[port]/[container_name]/[space_name]?[query_string] Protocol: [ RMI | JINI | JAVA ] This method also supports multiple URLs separate by ";", e.i. jini://localhost/containerName/SpaceName;jini://'*'/containerName/SpaceName; It is useful when Jini URL for locating services on the network is not available. If the first space URL is unavailable, SpaceFinder will try the next one until a live proxy will be found. If all URLs are unavailable this method throws FinderException- Parameters:
urls- Space URLcustomProperties- Custom Properties object which overwrites the space/container/cluster configurations.- Returns:
- Returns single Space or Container proxy.
- Throws:
FinderException- During finding space or container.
-
find
public static Object find(String urls, Properties customProperties, LifeCycle lifeCycle, CredentialsProvider credentialsProvider) throws FinderException Deprecated.Finds or creates an instance of a GigaSpace based on the specified spaceURL.- Parameters:
urls- The general format for this URL is as follows: Protocol://[host]:[port]/[container_name]/[space_name]. Must not be nullcustomProperties- Optional customPropertiesobject which overwrites the space/container/cluster configurations, used when creating a new instancelifeCycle- Optional reference for hosting environment. This parameter is passed as theLifeCycleargument to the implementation's constructor if the GigaSpaces instance is created. If this argument isnull, then a default, no-op LifeCycle object will be assigned. If the GigaSpaces instance already exists, this parameter is ignored.credentialsProvider- credentials to be used for authentication against a remote secured space; may benull.- Returns:
- The proxy to a newly created GigaSpaces instance or to an instance that matches the
specification of the
spaceURLparameter. - Throws:
FinderException- If there are exception creating or finding the GigaSpaces instanceNullPointerException- if the spaceURL parameter is null
-
find
Deprecated.The general format for this URL is as follows: Protocol://[host]:[port]/[container_name]/[space_name]?[query_string] Protocol: [ RMI | JINI | JAVA ] This method also supports multiple URLs separate by ";", e.i. jini://localhost/containerName/SpaceName;jini://'*'/containerName/SpaceName; It is useful when Jini URL for locating services on the network is not available. If the first space URL is unavailable, SpaceFinder will try the next one until a live proxy will be found. If all URLs are unavailable this method throws FinderException- Parameters:
spaceURL- Space URL- Returns:
- Returns single Space or Container proxy.
- Throws:
FinderException- During finding space or container.
-
find
public static Object find(SpaceURL spaceURL, CredentialsProvider credentialsProvider) throws FinderException Deprecated.The general format for this URL is as follows: Protocol://[host]:[port]/[container_name]/[space_name]?[query_string] Protocol: [ RMI | JINI | JAVA ] This method also supports multiple URLs separate by ";", e.i. jini://localhost/containerName/SpaceName;jini://'*'/containerName/SpaceName; It is useful when Jini URL for locating services on the network is not available. If the first space URL is unavailable, SpaceFinder will try the next one until a live proxy will be found. If all URLs are unavailable this method throws FinderException- Parameters:
credentialsProvider- credentials to be used for authentication against a remote secured space; may benull.- Returns:
- Returns single Space or Container proxy.
- Throws:
FinderException- During finding space or container.
-
find
public static Object find(SpaceURL spaceURL, CredentialsProvider credentialsProvider, long timeout, LookupType lookupType) throws FinderException Deprecated.- Throws:
FinderException
-
find
public static Object find(SpaceURL[] spaceURLs, CredentialsProvider credentialsProvider) throws FinderException Deprecated.- Throws:
FinderException
-
findService
protected Object findService(String url, Properties customProperties, LifeCycle lifeCycle, CredentialsProvider credentialsProvider) throws FinderException Deprecated.- Throws:
FinderException
-
findService
Deprecated.- Throws:
FinderException
-
findService
protected Object findService(SpaceURL[] spaceURLs, Properties customProperties, LifeCycle lifeCycle, CredentialsProvider credentialsProvider) throws FinderException Deprecated.- Throws:
FinderException
-
findService
protected Object findService(SpaceURL url, Properties customProperties, LifeCycle lifeCycle, CredentialsProvider credentialsProvider, long timeout, LookupType lookupType) throws FinderException Deprecated.The main method of SpaceFinder to find single Space or Container proxy. If the proxy is not found throwsFinderException.- Parameters:
url- The valid SpaceFinder URL to Container or Space.credentialsProvider- security credentials to be used for authentication in case of a secured space; may benull.- Returns:
- Returns single found proxy.
- Throws:
FinderException- Failed to find proxy of desiredurl.
-
findJiniSpace
public static IRemoteSpace findJiniSpace(SpaceURL url, String spaceUuid, Properties customProperties, long timeout, LookupType lookupType) throws FinderException Deprecated.Returns Either LRMISpaceImpl or SpaceProxyImpl.- Throws:
FinderException
-
main
Deprecated.This main provides the following options: 1. Starts container or container with an embedded space. i.e. java SpaceFinder java://localhost:10098/containerName or java://localhost:10098/containerName/mySpace or /./mySpace (which translates to java://localhost:10098/containerName/mySpace?schema=default) or /./mySpace?schema=cache (which translates to java://localhost:10098/containerName/mySpace?schema=cache) For more options see usage printouts.2. Verify if a Space/Container running. i.e. java SpaceFinder rmi://hostname/containerName/SpaceName
- Parameters:
args- args[0] should be the space url- Throws:
FinderException- During finding space or container.
-
UrlSpaceConfigurerinstead.