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
    • 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:

        createNamespace(name, new NamespaceOptions())

        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 - 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, 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 - if name is null.
        InvalidArgumentException - if name 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
      • 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 be null to indicate the default namespace should be made active.
        Throws:
        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.
        Since:
        Rhino 2.5.0