createNamespace(name, new NamespaceOptions())
Interface NamespaceManagementMBean
-
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.
User-defined namespaces are not supported when using the pool clustering mode.
- Since:
- Rhino 2.5.0
-
-
Field Summary
Fields Modifier and Type Field Description static String
OBJECT_NAME
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
createNamespace(String name)
Create a new user-defined namespace.void
createNamespace(String name, NamespaceOptions options)
Create a new user-defined namespace with parameters.String
getActiveNamespace()
Get the name of the currently active namespace.NamespaceOptions
getNamespaceOptions(String name)
Get the options that a namespace was created with.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.
-
-
-
Field Detail
-
OBJECT_NAME
static final String OBJECT_NAME
- Since:
- Rhino 2.5.0
- See Also:
- Constant Field Values
-
-
Method Detail
-
createNamespace
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.
This method is equivalent to:
If the pool clustering mode is being used, this method will always throw a
ManagementException
as user-defined namespaces are unsupported in this configuration.- Parameters:
name
- the name of the namespace to create.- Throws:
NullPointerException
- ifname
isnull
.InvalidArgumentException
- ifname
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, or if the node is configured to use the pool clustering mode.- Since:
- Rhino 2.5.0
-
createNamespace
void createNamespace(String name, NamespaceOptions options) throws NullPointerException, InvalidArgumentException, NamespaceAlreadyExistsException, ManagementException
Create a new user-defined namespace with parameters.
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.
If the pool clustering mode is being used, this method will always throw a
ManagementException
as user-defined namespaces are unsupported in this configuration.- Parameters:
name
- the name of the namespace to create.options
- options that parameterise how the namespace will be created.- Throws:
NullPointerException
- ifname
isnull
.InvalidArgumentException
- ifname
is zero-length or a reserved name is specified, or invalid options are provided, eg. a non-existent replicated storage resource is specified.NamespaceAlreadyExistsException
- if a namespace with the specified name already exists.ManagementException
- if the namespace creation failed due to a system-level error, or if the node is configured to use the pool clustering mode.- Since:
- Rhino 2.6.1
-
removeNamespace
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.
- Parameters:
name
- the name of the namespace to remove.- Throws:
NullPointerException
- ifname
isnull
.UnrecognizedNamespaceException
- ifname
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.- Since:
- Rhino 2.5.0
-
getNamespaces
String[] getNamespaces() throws ManagementException
Get the names of the user-defined namespaces that currently exist.
- Returns:
- the names of the user-defined namespaces.
- Throws:
ManagementException
- if the namespace names could not be obtained due to a system-level failure.- Since:
- Rhino 2.5.0
-
setActiveNamespace
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.
- Parameters:
name
- the name of the namespace to set as active. May benull
to indicate the default namespace should be made active.- Throws:
NoAuthenticatedSubjectException
- if the current thread is not running with an authenticatedSubject
.UnrecognizedNamespaceException
- ifname
is notnull
and is not a recognised user-defined namespace name.ManagementException
- if the active namespace could not be set due to a system-level failure.- Since:
- Rhino 2.5.0
-
getNamespaceOptions
NamespaceOptions getNamespaceOptions(String name) throws UnrecognizedNamespaceException, ManagementException
Get the options that a namespace was created with.
- Parameters:
name
- the name of the namespace. May benull
to indicate the default namespace.- Returns:
- the namespace options.
- Throws:
UnrecognizedNamespaceException
- ifname
is not a recognised user-defined namespace name.ManagementException
- if the options could not be obtained due to a system-level failure.- Since:
- Rhino 2.6.1
-
getActiveNamespace
String getActiveNamespace() throws NoAuthenticatedSubjectException, ManagementException
Get the name of the currently active namespace.
- Returns:
- the name of the currently active namespace.
A return value of
null
indicates that the default namespace is currently active. - Throws:
NoAuthenticatedSubjectException
- if the current thread is not running with an authenticatedSubject
.ManagementException
- if the active namespace could not be obtained due to a system-level failure.- Since:
- Rhino 2.5.0
-
-