public interface NamespaceManagementMBean
The NamespaceManagementMBean
interface defines methods for managing Rhino namespaces.
A namespace is a deployment environment isolated from every other namespace. It has its own independent set of installed deployable units and components, resource adaptor entities, profile tables, and environmental settings such as object pool configurations, security permissions, etc. A namespace also has its own SLEE activation state, so the components in a namespace can be started and stopped as if they were running in an independent SLEE.
Rhino always has a default namespace. User defined namespaces can be created and removed using the methods in this MBean.
Modifier and Type | Field and Description |
---|---|
static String |
OBJECT_NAME |
Modifier and Type | Method and Description |
---|---|
void |
createNamespace(String name)
Create a new user-defined namespace.
|
String |
getActiveNamespace()
Get the name of the currently active namespace.
|
String[] |
getNamespaces()
Get the names of the user-defined namespaces that currently exist.
|
void |
removeNamespace(String name)
Remove a user-defined namespace.
|
void |
setActiveNamespace(String name)
Set the currently active namespace for the authenticated client connection.
|
static final String OBJECT_NAME
void createNamespace(String name) throws NullPointerException, InvalidArgumentException, NamespaceAlreadyExistsException, ManagementException
Create a new user-defined namespace.
The namespace name must have at least one character. The names 'default' and 'global' (case insensitive) are reserved for internal use and cannot be used as the name of a user-defined namespace.
name
- the name of the namespace to create.NullPointerException
- if name
is null
.InvalidArgumentException
- if name
is zero-length or a reserved name is specified.NamespaceAlreadyExistsException
- if a namespace with the specified name already exists.ManagementException
- if the namespace creation failed due to a system-level error.void removeNamespace(String name) throws NullPointerException, UnrecognizedNamespaceException, InvalidStateException, ManagementException
Remove a user-defined namespace.
All user-installed components and profile tables must be removed from a namespace before the namespace can be removed.
name
- the name of the namespace to remove.NullPointerException
- if name
is null
.UnrecognizedNamespaceException
- if name
is not a recognised user-defined namespace name.InvalidStateException
- if user-installed components or profile tables still exist in the namespace.ManagementException
- if the namespace removal failed due to a system-level error.String[] getNamespaces() throws ManagementException
Get the names of the user-defined namespaces that currently exist.
ManagementException
- if the namespace names could not be obtained due to a system-level failure.void setActiveNamespace(String name) throws NoAuthenticatedSubjectException, UnrecognizedNamespaceException, ManagementException
Set the currently active namespace for the authenticated client connection. Future management operations will be applied to the specified namespace.
Each client connection thread is associated with its own active namespace. This means that if a client connection times out and reconnects and is handled by a different RMI connection thread, any previous active namespace association will be lost, and the client will need to reset the active namespace that it wishes to interact with.
name
- the name of the namespace to set as active.
May be null
to indicate the default namespace should be made active.NoAuthenticatedSubjectException
- if the current thread is not running with an authenticated Subject
.UnrecognizedNamespaceException
- if name
is not null
and is not a recognised user-defined namespace name.ManagementException
- if the active namespace could not be set due to a system-level failure.String getActiveNamespace() throws NoAuthenticatedSubjectException, ManagementException
Get the name of the currently active namespace.
null
indicates that the default namespace is currently active.NoAuthenticatedSubjectException
- if the current thread is not running with an authenticated Subject
.ManagementException
- if the active namespace could not be obtained due to a system-level failure.