Summary: Finding a space or a cluster of spaces using Space Url

Overview

Finding a space refers to creating an ISpaceProxy to a space or a cluster of spaces.
A single proxy is created and used for a single space or a cluster of spaces, that space or spaces can be in a differnt process, a different machine or even colocated with the proxy in the same. Creating a proxy to a space is done using SpaceProxyProviderFactory.FindSpace and a Space Url.

Lookup Process

The space lookup process has two main approaches

  • Multicast
  • Unicast

Multicast

The most commonly used is the multicast which searches in the network for lookup services (Each space is usally started with an embedded lookup service), and is usally used in conjuctions with a lookup group.
When a space starts it is registered with in a specific lookup group, this space will be found when a space of that name is being looked for with the same lookup group.

The following code find a space named mySpace with lookup group named myGroup and returns a proxy to that space:

ISpaceProxy proxy = SpaceProxyProviderFactory.Instance.FindSpace("jini://*/*/mySpace?groups=myGroup");

Let's examine the space url that is used to find this space:
"jini:////mySpace?groups=myGroup"

jini:/ - Indicates jini protocol which is used to find spaces.
/*/*/ - The first '*' indicates that the multicast protocol should be used, the second '*' indicates the space container name to look for, which in this case means any container. (Container names are rarely used, see Space Url for more details).
mySpace - The space/cluster name, in a cluster of spaces all the spaces share the same name, hence creating a proxy to a single space or a cluster of space is exactly the same.
groups=myGroup - Search for spaces that are registered under the lookup groups named "myGroup".

For details about space url refer to Space Url page.

If you have problems working with multicast refer to How to Configure Multicast page.

Unicast

Unicast is using a specific lookup service, when using unicast lookup groups are ignored, which means if two spaces are registered within the lookup service under the same name but different lookup group, either one is a legitimet result. This behavior can be very confusing and therefore using unicast is discouraged.T

ISpaceProxy proxy = SpaceProxyProviderFactory.Instance.FindSpace("jini://localhost:10098/*/mySpace");

Remote and Embedded Space

When creating a proxy to a space there are two possible scenario:

  • Remote - which means the space is not in the same process as the proxy
  • Embedded - which means the space coexist with the proxy in the same process.

This property of the proxy can be retrieved from ISpaceProxy.Embedded property.

GigaSpaces.com - Legal Notice - 3rd Party Licenses - Site Map - API Docs - Forum - Downloads - Blog - White Papers - Contact Tech Writing - Gen. by Atlassian Confluence