As mentioned in Chapter 2, TIBCO ActiveSpaces Fundamentals, there are two modes of connection to a metaspace—as a full peer or as a remote client. Regardless of the connection mode, the API calls to use to connect to a Metaspace are the same.
The Metaspace.connect() method—or, in C, the
tibasMetaspace_Connect() call—has two input parameters:
The tibasMetaspace_Connect() function returns a metaspace object that you can use to define a space or join a space. The input parameters are explained in more detail in the sections that follow.
The metaspace name is a string containing the name of a particular metaspace instance. The name can not start with a $ or
_, and cannot contain the special characters
.,
>, or
*. If null or an empty string is given as argument to the connect call, the default metaspace name of
ms will be used.
The MemberDef object contains the attributes of the connection to the metaspace:
For example, if two metaspace members attempt to connect to the same metaspace using different discovery protocols, two different metaspaces are created and the two members are in different metaspaces. For example, if one application connects to a metaspace named ms using
tibrv as its discovery URL, and another connects to a metaspace named
ms using
tibpgm as its discovery URL, since
tibrv and
tibpgm are two incompatible discovery protocols, two independent metaspaces, with the same name, are created instead of a single one.
The syntax indicates that Rendezvous is used as the discovery transport, and that the optional service,
network, and
daemon Rendezvous transport creation arguments can be specified, separated by slashes, as shown.
If not specified, ActiveSpaces uses the default interface and discovery group address 239.8.8.9 (so the URL will be equivalent to
tibrv://7889/;239.8.8.9/). If an interface is specified (by IP address, hostname, or by interface name) do not forget to also specify a discovery group address otherwise Rendezvous will revert to using broadcast rather than discovery (for example, to specify usage of the interface identified by IP address
192.168.1.1 use the URL:
tibrv:///192.168.1.1;239.8.8.9/).
Regardless of the mechanism used for the initial metaspace member discovery phase, the members of the metaspace always establish TCP connections to each other. The listen attribute lets the user specify the interface and the TCP port that the process will use to listen for incoming connections from new members to the metaspace, and specified in the form of a URL.
A successful connection to the metaspace will return a valid instance of a Metaspace object, which can then be used to define, join or leave spaces.
See the entry for Metaspace in the
TIBCO ActiveSpaces Java API Reference for more information about transport arguments.
The MemberName attribute specifies a string that indicates the member name. Each member must have a unique name in the metaspace.