|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.j_spaces.core.client.SpaceFinder
public class SpaceFinder
This utility class provides accessing to Container proxy (IJSpaceContainer
) 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?destroy
Host: 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 in rmi registry in a specific host and container.rmi://my_container_host/my_containername/myspace
2. Looking for a space using JINI Unicast protocol.jini://mylookuphost/mycontainername/myspace
Orjini://*/*/myspace
3. Looking for a space using the JINI multicast protocol.jini://*/containername/myspace
Orjini://*/*/myspace
4. looking for a container regardless of the space it contains in any of the above methods:rmi://mycontainerhost/mycontaineraname
rmi://*/mycontainername
jini://mylookuphost/mycontainername
jini://*/mycontainername
For more details, examples and options seeSpaceURL
SpaceURL
Method Summary | |
---|---|
static Object |
find(SpaceURL spaceURL)
The general format for this URL is as follows: Protocol://[host]:[port]/[container_name]/[space_name]? |
static Object |
find(SpaceURL[] urls)
SpaceFinder.find multiple URL provides ability to define space search order. |
static Object |
find(SpaceURL spaceURL,
IJSpace space,
LifeCycle lifeCycle)
The general format for this URL is as follows: Protocol://[host]:[port]/[container_name]/[space_name]? |
static Object |
find(String url)
The general format for this URL is as follows: Protocol://[host]:[port]/[container_name]/[space_name]? |
static Object |
find(String[] urls)
SpaceFinder.find multiple URL provides ability to define space search order. |
static Object |
find(String urls,
IJSpace space)
Finds a space using the space provided. |
static Object |
find(String urls,
IJSpace space,
LifeCycle lifeCycle)
Finds or creates an instance of a GigaSpace based on the specified spaceURL. |
static Object |
find(String spaceURLs,
IJSpace space,
Properties customProperties,
LifeCycle lifeCycle)
Finds or creates an instance of a GigaSpace based on the specified spaceURL. |
static Object |
find(String spaceURLs,
IJSpace space,
Properties customProperties,
LifeCycle lifeCycle,
SecurityContext securityContext)
Finds or creates an instance of a GigaSpace based on the specified spaceURL. |
static Object |
find(String url,
Properties customProps)
The general format for this URL is as follows: Protocol://[host]:[port]/[container_name]/[space_name]? |
static void |
main(String[] args)
This main provides the following options: 1. |
static SpaceURL |
verifyURL(String url)
Verifies for validation if the specified url is valid and
returns SpaceURL object that contains all information about
specified url . |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static SpaceURL verifyURL(String url) throws MalformedURLException
url
is valid and
returns SpaceURL
object that contains all information about
specified url
.
This method also support multiple URLs separate by ";"
url
- The url
to verify.
SpaceURL
object that contains all information about
specified url
.
MalformedURLException
- Throws exception if specified url
is not valid.public static Object find(String[] urls) throws FinderException
urls
- Array of SpaceFinder URLs.
FinderException
- Failed to found proxy.All URLs are unavailable.public static Object find(SpaceURL[] urls) throws FinderException
urls
- Array of SpaceFinder URLs.
FinderException
- Failed to found proxy.All URLs are unavailable.public static Object find(String urls, IJSpace space) throws FinderException
urls
- cache URLspace
- proxy to the space
FinderException
- During finding space or container.for more information on the URL structre
public static Object find(String urls, IJSpace space, LifeCycle lifeCycle) throws FinderException
urls
- The general format for this URL is as follows:
Protocol://[host]:[port]/[container_name]/[space_name]. Must not be nullspace
- proxylifeCycle
- Optional reference for hosting environment. This parameter is passed as the
LifeCycle
argument to the implementation's constructor if the
GigaSpaces instance is created. If this argument is null
, then a default,
no-op LifeCycle object will be assigned. If the GigaSpaces instance already exists, this
parameter is ignored.
spaceURL
parameter.
FinderException
- If there are exception creating or finding the GigaSpaces instance
NullPointerException
- if the spaceURL parameter is nullpublic static Object find(String spaceURLs, IJSpace space, Properties customProperties, LifeCycle lifeCycle) throws FinderException
spaceURLs
- The general format for this URL is as follows:
Protocol://[host]:[port]/[container_name]/[space_name]. Must not be nullspace
- proxycustomProperties
- Optional custom Properties
object which overwrites the
space/container/cluster configurations, used when creating a new instancelifeCycle
- Optional reference for hosting environment. This parameter is passed as the
LifeCycle
argument to the implementation's constructor if the
GigaSpaces instance is created. If this argument is null
, then a default,
no-op LifeCycle object will be assigned. If the GigaSpaces instance already exists, this
parameter is ignored.
spaceURL
parameter.
FinderException
- If there are exception creating or finding the GigaSpaces instance
NullPointerException
- if the spaceURL parameter is nullpublic static Object find(String spaceURLs, IJSpace space, Properties customProperties, LifeCycle lifeCycle, SecurityContext securityContext) throws FinderException
spaceURLs
- The general format for this URL is as follows:
Protocol://[host]:[port]/[container_name]/[space_name]. Must not be nullspace
- proxycustomProperties
- Optional custom Properties
object which overwrites the
space/container/cluster configurations, used when creating a new instancelifeCycle
- Optional reference for hosting environment. This parameter is passed as the
LifeCycle
argument to the implementation's constructor if the
GigaSpaces instance is created. If this argument is null
, then a default,
no-op LifeCycle object will be assigned. If the GigaSpaces instance already exists, this
parameter is ignored.securityContext
- the SecurityContext for the generated proxy (null can be passed).
spaceURL
parameter.
FinderException
- If there are exception creating or finding the GigaSpaces instance
NullPointerException
- if the spaceURL parameter is nullpublic static Object find(SpaceURL spaceURL, IJSpace space, LifeCycle lifeCycle) throws FinderException
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. rmi://localhost/containerName/SpaceName;jini://localhost/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
spaceURL
- Space URLspace
- proxy
FinderException
- During finding space or container.public static Object find(SpaceURL spaceURL) throws FinderException
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. rmi://localhost/containerName/SpaceName;jini://localhost/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
spaceURL
- Space URL
FinderException
- During finding space or container.public static Object find(String url) throws FinderException
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. rmi://localhost/containerName/SpaceName;jini://localhost/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
url
- Space URL
FinderException
- During finding space or container.public static Object find(String url, Properties customProps) throws FinderException
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. rmi://localhost/containerName/SpaceName;jini://localhost/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
url
- Space URLcustomProps
- Custom Properties object which overwrites the space/container/cluster configurations.
FinderException
- During finding space or container.public static void main(String[] args) throws FinderException
args
- args[0] should be the space url
FinderException
- During finding space or container.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |