There are 2 ways to retrieve a SpaceProxy:
find
- Find a space given its URL and return a new proxy (SpaceProxy) to it. attach
- Add a reference to an existing space proxy (SpaceProxy).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://[host]:[port]/[container_name]/[space_name]?[query_string]
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://
Or *
/containername/myspacejini://
*
/*
/myspace
4. looking for a container regardless of the space it contains in any of the above methods: rmi://mycontainerhost/mycontaineraname
rmi://
*
/mycontainernamejini://mylookuphost/mycontainername
jini://
*
/mycontainername
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 SpaceFinder & | operator= (const SpaceFinder &src) |
SpaceFinder (const SpaceFinder &src) | |
SpaceFinder (void) | |
virtual | ~SpaceFinder (void) |
SpaceFinder::SpaceFinder | ( | void | ) |
SpaceFinder. Constructor
SpaceFinder::~SpaceFinder | ( | void | ) | [virtual] |
SpaceFinder. Destructor
SpaceProxyPtr SpaceFinder::attach | ( | long long | proxyId, | |
bool | clustered, | |||
SpaceProxyPtr | originalProxy = NULL_PROXY | |||
) |
atach - find a space by its spaceId.
proxyId | ||
clustered | ||
worker | space worker host container (optional) |
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 |
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 |
FinderException | - Failed to find proxy of desired url . |