GigaSpaces XAP 7.0 API

com.j_spaces.map
Class CacheFinder

java.lang.Object
  extended by com.j_spaces.core.client.SpaceFinder
      extended by com.j_spaces.map.CacheFinder

Deprecated. Use MapConfigurer instead.

@Deprecated
public class CacheFinder
extends SpaceFinder

  This utility class provides accessing to cache IMap API.

  The CacheFinder is designed to provide a unified interface for finding a
  cache in each of the mode specified.
  To provide a unified manager of accessing the cache use a url based interface
  which will provide the information of the protocol and the address of the
  cache 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 behind the cache. When choosing so
            one should specify in the query string one of three 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 .

  Query String: The query_string represents the cache type i.e.:

       > create - local cache
       jini://myHost/myContinaer/mySpace?uselocalcache

       > create - IMap based space interface
       jini://myHost/myContinaer/mySpace

  Examples of space url's:

  1. looking for a cache in rmi registry in a specific host and container.
      rmi://my_container_host/my_containername/myspace?uselocalcache

  2. Looking for a cache using JINI Unicast protocol.
     jini://mylookuphost/mycontainername/myspace?uselocalcache
   Or
     jini://mylookuphost/*/myspace?uselocalcache

  3. Looking for a cache using the JINI multicast protocol.
     jini://*/*/containername/myspace?uselocalcache
   Or
     jini://*/*/myspace?uselocalcache
 

Since:
5.0
Version:
1.0
Author:
Guy Korland
See Also:
SpaceURL

Field Summary
 
Fields inherited from class com.j_spaces.core.client.SpaceFinder
spaceFinder
 
Method Summary
static Object find(SpaceURL spaceURL, IJSpace spaceProxy, com.sun.jini.start.LifeCycle lifeCycle)
          Deprecated. Find a cache using the space provided.
static Object find(SpaceURL spaceURL, IJSpace spaceProxy, com.sun.jini.start.LifeCycle lifeCycle, UserDetails userDetails)
          Deprecated. Find a cache using the space provided.
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. CacheFinder.find multiple URL provides ability to define cache search order.
static Object find(String urls, IJSpace spaceProxy)
          Deprecated. Find a cache using the space provided.
static Object find(String urls, Properties customProperties)
          Deprecated. Find a cache using the custom Properties provided which overwrites the space/container/cluster configurations.
protected  Object findService(SpaceURL su, IJSpace space, Properties customProps, com.sun.jini.start.LifeCycle lifeCycle, UserDetails userDetails)
          Deprecated. internal find.
protected  com.gigaspaces.internal.client.spaceproxy.ISpaceProxy initCacheProperties(com.gigaspaces.internal.client.spaceproxy.ISpaceProxy spaceProxy, Properties customProps, SpaceURL spaceURL)
          Deprecated. CacheFinder with/without "useLocalCache" parameter will initialize with cache properties.
static void main(String[] args)
          Deprecated.  This main provides the following options: 1.
 
Methods inherited from class com.j_spaces.core.client.SpaceFinder
find, find, find, find, find, find, find, findService, findService, findService, loadCacheConfig, verifyURL
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

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 | WS ]
  This method also supports multiple urls separate by ";",
  e.i. rmi://localhost/containerName/SpaceName?uselocalcache;
  jini://localhost/containerName/SpaceName?uselocalcache;
  It is useful when Jini URL for locating services on the network is not available.
    If the first URL is unavailable, CacheFinder will try the next one until a live cache will be found.
  If all URLs are unavailable this method throws FinderException
 

Parameters:
urls - the space url
Returns:
Returns single cache.
Throws:
FinderException - During finding cache.

find

public static Object find(String[] urls)
                   throws FinderException
Deprecated. 
CacheFinder.find multiple URL provides ability to define cache search order. It is useful when Jini URL for locating services on the network is not available. If the first URL is unavailable, CacheFinder will try the next one until a live cache will be found. If all URLs are unavailable this method throws FinderException

Parameters:
urls - Array of CacheFinder urls.
Returns:
Returns single found cache.
Throws:
FinderException - Failed to found proxy.All urls are unavailable.
See Also:
for more information on the URL structre

find

public static Object find(String urls,
                          Properties customProperties)
                   throws FinderException
Deprecated. 
Find a cache using the custom Properties provided which overwrites the space/container/cluster configurations.

Parameters:
urls - cache URL
customProperties - Custom Properties object which overwrites the space/container/cluster configurations.
Returns:
Returns single cache
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)
                   throws FinderException
Deprecated. 
Find a cache using the space provided. This method will not create any embedded space or space proxy but only uses the provided url properties to create cache the uses the provided space.

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

find

public static Object find(SpaceURL spaceURL,
                          IJSpace spaceProxy,
                          com.sun.jini.start.LifeCycle lifeCycle)
                   throws FinderException
Deprecated. 
Find a cache using the space provided. This method will not create any embedded space or space proxy but only uses the provided url properties to create cache the uses the provided space.

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

find

public static Object find(SpaceURL spaceURL,
                          IJSpace spaceProxy,
                          com.sun.jini.start.LifeCycle lifeCycle,
                          UserDetails userDetails)
                   throws FinderException
Deprecated. 
Find a cache using the space provided. This method will not create any embedded space or space proxy but only uses the provided url properties to create cache the uses the provided space.

Parameters:
spaceURL - cache URL
spaceProxy - proxy to the space
userDetails - user details (credentials) to be used for authentication against a remote secured space; may be null.
Returns:
Returns single cache
Throws:
FinderException - During finding space or container.
See Also:
for more information on the URL structre

findService

protected final Object findService(SpaceURL su,
                                   IJSpace space,
                                   Properties customProps,
                                   com.sun.jini.start.LifeCycle lifeCycle,
                                   UserDetails userDetails)
                            throws FinderException
Deprecated. 
internal find.

Overrides:
findService in class SpaceFinder
Parameters:
su - The valid SpaceFinder URL to Container or Space.
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. 
CacheFinder with/without "useLocalCache" parameter will initialize with cache properties.

Overrides:
initCacheProperties in class SpaceFinder
Parameters:
spaceProxy - space proxy
customProps - custom properties
spaceURL - SpaceURL instance
Returns:
an initialized proxy.
Throws:
IOException
ParserConfigurationException
SAXException
FinderException
Exception

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 CacheFinder 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.
 compression = Integer.parseInt( JProperties.
                         getSpaceProperty( fullDCacheSpaceName,
                                         Constants.DCache.COMPRESSION_PROP,
                                         Constants.DCache.COMPRESSION_DEFUALT));

         return new GSMapImpl(space, compression);
 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.

GigaSpaces XAP 7.0 API

Copyright © GigaSpaces.