SpaceFinder Class Reference

List of all members.

Detailed Description

Provides an interface to obtain a proxy to a space (SpaceProxy).

There are 2 ways to retrieve a SpaceProxy:

When using multiple threads that need to work with the same space, it is advised to use find only once to create the proxy, and then do attach to this proxy for each additional thread.

The general format for the space URL is as follows:


Protocol: [ rmi | jini | java ]

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

See also:

Public Member Functions

SpaceProxyPtr attach (long long proxyId, bool clustered, SpaceProxyPtr originalProxy=NULL_PROXY)
SpaceProxyPtr attach (SpaceProxyPtr pSpaceProxy)
 Adds a reference to an existing space proxy and return that proxy.
SpaceProxyPtr find (const std::string &url)
 Returns a new space proxy (SpaceProxy) using the given space URL.
const SpaceFinderoperator= (const SpaceFinder &src)
 SpaceFinder (const SpaceFinder &src)
 SpaceFinder (void)
virtual ~SpaceFinder (void)

Constructor & Destructor Documentation

SpaceFinder::SpaceFinder ( void   ) 

SpaceFinder. Constructor

SpaceFinder::~SpaceFinder ( void   )  [virtual]

SpaceFinder. Destructor

Member Function Documentation

SpaceProxyPtr SpaceFinder::attach ( long long  proxyId,
bool  clustered,
SpaceProxyPtr  originalProxy = NULL_PROXY 

atach - find a space by its spaceId.

worker space worker host container (optional)
Returns single Space or Container proxy.
FinderException During finding space or container.

SpaceProxyPtr SpaceFinder::attach ( SpaceProxyPtr  pSpaceProxy  ) 

Adds a reference to an existing space proxy and return that proxy.

pSpaceProxy - An existing space proxy
Smart pointer to the SpaceProxy

SpaceProxyPtr SpaceFinder::find ( const std::string &  url  ) 

Returns a new space proxy (SpaceProxy) using the given space URL.

Sample usage:

 SpaceFinder spaceFinder;
 SpaceProxyPtr spaceProxy = spaceFinder.find("jini://lookup-host/container-name/space-name");

url - Space URL
worker - Interanl
Smart pointer to a new SpaceProxy
FinderException - Failed to find proxy of desired url.

Generated on Wed Sep 16 16:59:14 2009 for GigaSpaces XAP 7.0.1 C++ by  doxygen 1.5.3