GigaSpaces XAP 7.0 API

com.j_spaces.core.client
Class SpaceFinder

java.lang.Object
  extended by com.j_spaces.core.client.SpaceFinder
Direct Known Subclasses:
CacheFinder

Deprecated. Use UrlSpaceConfigurer instead.

@Deprecated
public class SpaceFinder
extends Object

 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
  Or
    jini://*/*/myspace

 3. Looking for a space using the JINI multicast protocol.
    jini://*/containername/myspace
  Or
    jini://*/*/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 see SpaceURL
 

Version:
1.0
Author:
Igor Goldenberg
See Also:
SpaceURL

Field Summary
protected static SpaceFinder spaceFinder
          Deprecated.  
 
Constructor Summary
protected SpaceFinder()
          Deprecated. Singleton.
 
Method Summary
static Object find(SpaceURL spaceURL)
          Deprecated.  The general format for this URL is as follows: Protocol://[host]:[port]/[container_name]/[space_name]?
static Object find(SpaceURL[] spaceURLs)
          Deprecated.  SpaceFinder.find multiple URL provides ability to define space search order.
static Object find(SpaceURL[] spaceURLs, Properties customProperties)
          Deprecated.  
static Object find(SpaceURL spaceURL, IJSpace spaceProxy, com.sun.jini.start.LifeCycle lifeCycle)
          Deprecated.  The general format for this URL is as follows: Protocol://[host]:[port]/[container_name]/[space_name]?
static Object find(SpaceURL spaceURL, IJSpace spaceProxy, Properties customProperties, com.sun.jini.start.LifeCycle lifeCycle, UserDetails userDetails)
          Deprecated.  The general format for this URL is as follows: Protocol://[host]:[port]/[container_name]/[space_name]?
static Object find(String urls)
          Deprecated.  The general format for this URL is as follows: Protocol://[host]:[port]/[container_name]/[space_name]?
static Object find(String[] urls)
          Deprecated. SpaceFinder.find multiple URL provides ability to define space search order.
static Object find(String urls, IJSpace spaceProxy)
          Deprecated. Finds a space using the space provided.
static Object find(String urls, IJSpace spaceProxy, com.sun.jini.start.LifeCycle lifeCycle)
          Deprecated. Finds or creates an instance of a GigaSpace based on the specified spaceURL.
static Object find(String urls, IJSpace spaceProxy, Properties customProperties, com.sun.jini.start.LifeCycle lifeCycle)
          Deprecated. Finds or creates an instance of a GigaSpace based on the specified spaceURL.
static Object find(String urls, IJSpace spaceProxy, Properties customProperties, com.sun.jini.start.LifeCycle lifeCycle, UserDetails userDetails)
          Deprecated. Finds or creates an instance of a GigaSpace based on the specified spaceURL.
static Object find(String urls, Properties customProperties)
          Deprecated.  The general format for this URL is as follows: Protocol://[host]:[port]/[container_name]/[space_name]?
protected  Object findService(SpaceURL[] spaceURLs, IJSpace spaceProxy, Properties customProperties, com.sun.jini.start.LifeCycle lifeCycle, UserDetails userDetails)
          Deprecated.  
protected  Object findService(SpaceURL spaceURL, IJSpace spaceProxy, Properties customProperties, com.sun.jini.start.LifeCycle lifeCycle, UserDetails userDetails)
          Deprecated. The main method of SpaceFinder to find single Space or Container proxy.
protected  Object findService(String[] urls)
          Deprecated.  
protected  Object findService(String url, IJSpace spaceProxy, Properties customProperties, com.sun.jini.start.LifeCycle lifeCycle, UserDetails userDetails)
          Deprecated.  
protected  com.gigaspaces.internal.client.spaceproxy.ISpaceProxy initCacheProperties(com.gigaspaces.internal.client.spaceproxy.ISpaceProxy spaceProxy, Properties customProps, SpaceURL spaceURL)
          Deprecated.  
protected static void loadCacheConfig(SpaceURL spaceURL, com.gigaspaces.internal.client.spaceproxy.ISpaceProxy spaceProxy, Properties customProperties)
          Deprecated.  
static void main(String[] args)
          Deprecated. This main provides the following options: 1.
static SpaceURL verifyURL(String url)
          Deprecated. 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

spaceFinder

protected static final SpaceFinder spaceFinder
Deprecated. 
Constructor Detail

SpaceFinder

protected SpaceFinder()
Deprecated. 
Singleton.

Method Detail

verifyURL

public static SpaceURL verifyURL(String url)
                          throws MalformedURLException
Deprecated. 
Verifies for validation if the specified url is valid and returns SpaceURL object that contains all information about specified url. This method also support multiple URLs separate by ";"

Parameters:
url - The url to verify.
Returns:
Returns SpaceURL object that contains all information about specified url.
Throws:
MalformedURLException - Throws exception if specified url is not valid.

find

public static Object find(String[] urls)
                   throws FinderException
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

public static Object find(String urls)
                   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. 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
 

Parameters:
urls - Space URL
Returns:
Returns single Space or Container proxy.
Throws:
FinderException - During finding space or container.

find

public static Object find(String urls,
                          Properties customProperties)
                   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. 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
 

Parameters:
urls - Space URL
customProperties - 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,
                          IJSpace spaceProxy)
                   throws FinderException
Deprecated. 
Finds a space using the space provided. This method will not creates any space but only uses the provided url properties.

Parameters:
urls - cache URL
spaceProxy - proxy to the space
Returns:
Returns single found proxy.
Throws:
FinderException - During finding space or container.
See Also:
for more information on the URL structre

find

public static Object find(String urls,
                          IJSpace spaceProxy,
                          com.sun.jini.start.LifeCycle lifeCycle)
                   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 null
spaceProxy - proxy
lifeCycle - 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.
Returns:
The proxy to a newly created GigaSpaces instance or to an instance that matches the specification of the spaceURL parameter.
Throws:
FinderException - If there are exception creating or finding the GigaSpaces instance
NullPointerException - if the spaceURL parameter is null

find

public static Object find(String urls,
                          IJSpace spaceProxy,
                          Properties customProperties,
                          com.sun.jini.start.LifeCycle lifeCycle)
                   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 null
spaceProxy - proxy
customProperties - Optional custom Properties object which overwrites the space/container/cluster configurations, used when creating a new instance
lifeCycle - 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.
Returns:
The proxy to a newly created GigaSpaces instance or to an instance that matches the specification of the spaceURL parameter.
Throws:
FinderException - If there are exception creating or finding the GigaSpaces instance
NullPointerException - if the spaceURL parameter is null

find

public static Object find(String urls,
                          IJSpace spaceProxy,
                          Properties customProperties,
                          com.sun.jini.start.LifeCycle lifeCycle,
                          UserDetails userDetails)
                   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 null
spaceProxy - proxy
customProperties - Optional custom Properties object which overwrites the space/container/cluster configurations, used when creating a new instance
lifeCycle - 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.
userDetails - user details (credentials) to be used for authentication against a remote secured space; may be null.
Returns:
The proxy to a newly created GigaSpaces instance or to an instance that matches the specification of the spaceURL parameter.
Throws:
FinderException - If there are exception creating or finding the GigaSpaces instance
NullPointerException - if the spaceURL parameter is null

find

public static Object find(SpaceURL spaceURL)
                   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. 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
 

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,
                          IJSpace spaceProxy,
                          com.sun.jini.start.LifeCycle lifeCycle)
                   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. 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
 

Parameters:
spaceURL - Space URL
spaceProxy - proxy
Returns:
Returns single Space or Container proxy.
Throws:
FinderException - During finding space or container.

find

public static Object find(SpaceURL spaceURL,
                          IJSpace spaceProxy,
                          Properties customProperties,
                          com.sun.jini.start.LifeCycle lifeCycle,
                          UserDetails userDetails)
                   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. 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
 

Parameters:
spaceURL -
spaceProxy -
customProperties -
lifeCycle -
userDetails - user details (credentials) to be used for authentication against a remote secured space; may be null.
Returns:
Returns single Space or Container proxy.
Throws:
FinderException - During finding space or container.

find

public static Object find(SpaceURL[] spaceURLs)
                   throws FinderException
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:
spaceURLs - Array of SpaceFinder URLs.
Returns:
Returns single found proxy.
Throws:
FinderException - Failed to found proxy.All URLs are unavailable.

find

public static Object find(SpaceURL[] spaceURLs,
                          Properties customProperties)
                   throws FinderException
Deprecated. 
Throws:
FinderException

findService

protected Object findService(String url,
                             IJSpace spaceProxy,
                             Properties customProperties,
                             com.sun.jini.start.LifeCycle lifeCycle,
                             UserDetails userDetails)
                      throws FinderException
Deprecated. 
Throws:
FinderException

findService

protected Object findService(String[] urls)
                      throws FinderException
Deprecated. 
Throws:
FinderException

findService

protected Object findService(SpaceURL[] spaceURLs,
                             IJSpace spaceProxy,
                             Properties customProperties,
                             com.sun.jini.start.LifeCycle lifeCycle,
                             UserDetails userDetails)
                      throws FinderException
Deprecated. 
Throws:
FinderException

findService

protected Object findService(SpaceURL spaceURL,
                             IJSpace spaceProxy,
                             Properties customProperties,
                             com.sun.jini.start.LifeCycle lifeCycle,
                             UserDetails userDetails)
                      throws FinderException
Deprecated. 
The main method of SpaceFinder to find single Space or Container proxy. If the proxy is not found throws FinderException.

Parameters:
spaceURL - The valid SpaceFinder URL to Container or Space.
spaceProxy -
customProperties -
lifeCycle -
userDetails - security user details to be used for authentication in case of a secured space; may be null.
Returns:
Returns single found proxy.
Throws:
FinderException - Failed to find proxy of desired url.

initCacheProperties

protected com.gigaspaces.internal.client.spaceproxy.ISpaceProxy initCacheProperties(com.gigaspaces.internal.client.spaceproxy.ISpaceProxy spaceProxy,
                                                                                    Properties customProps,
                                                                                    SpaceURL spaceURL)
                                                                             throws FinderException,
                                                                                    SAXException,
                                                                                    ParserConfigurationException,
                                                                                    IOException
Deprecated. 
Throws:
FinderException
SAXException
ParserConfigurationException
IOException

loadCacheConfig

protected static void loadCacheConfig(SpaceURL spaceURL,
                                      com.gigaspaces.internal.client.spaceproxy.ISpaceProxy spaceProxy,
                                      Properties customProperties)
                               throws FinderException,
                                      SAXException,
                                      ParserConfigurationException,
                                      IOException
Deprecated. 
Throws:
FinderException
SAXException
ParserConfigurationException
IOException

main

public static void main(String[] args)
                 throws FinderException
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 3. This main is defined in the gs-runtime.jar Class-Path manifest file, therefore you may run the following command: java -jar gs-runtime.jar

Parameters:
args - args[0] should be the space url
Throws:
FinderException - During finding space or container.

GigaSpaces XAP 7.0 API

Copyright © GigaSpaces.