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.
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.
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).