Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 3 Performing Basic TIBCO ActiveSpaces Tasks : Disconnecting from the Metaspace

Disconnecting from the Metaspace
When your application terminates or no longer needs to use the spaces in a particular metaspace, it should disconnect from it using the metaspace’s close method. The close method causes the application to properly leave all of the spaces to which it may still be joined in that metaspace, destroys any listeners or space browsers that may still exist on those spaces, and ultimately severs all network connections with the other members of the metaspace.
Each getSpace() function call increments the use count on an object. This use count ensures that a metaspace leave does not happen when there is a valid user space/browser/listener active. The user needs to leave/stop all these space/browsers/listeners to ensure that when Metaspace.close is used, metaspace disconnect happens as expected. This is the case both for Java and for C APIs.
You can forcibly close a metaspace connection even if there are still valid Space objects by using the closeAll method instead of the close method.
Metaspace Membership
The Member object is returned by the Metaspace object’s getSelfMember method. The Member object has only two methods: getName and getRole. The getName method returns a string representing a globally unique name for that particular member. One of the members of the metaspace takes on the role of the membership manager for that member in the metaspace. The getRole method returns the role of that member in the metaspace (MEMBER or MANAGER) for metaspace group membership management purposes.
Getting the Connection’s Self Member Object
When connecting to a metaspace, each application is automatically assigned (or provides) a unique member name within that metaspace. Your application can determine this name by invoking the metaspace’s getSelfMember method, which returns a Member object.
Getting the List of User-defined Space Names
The list of names of the user spaces that are currently defined in the metaspace can be retrieved using the metaspace’s getUserSpaceNames method, which in Java returns a String[] and in C returns a StringList object (tibasStringList *).
Setting or Getting the Log Level
The amount of logging produced by the ActiveSpaces core library can be adjusted and retrieved using the metaspace’s setLogLevel and getLogLevel methods respectively. ERROR is the lowest level, followed by WARN, and INFO (the highest level).
The default log level is INFO.

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved