Allows the MBean to perform any operations it needs before
being registered in the MBean server. If the name of the MBean
is not specified, the MBean can provide a name for its
registration. If any exception is raised, the MBean will not be
registered in the MBean server.
Returns:
The name under which the MBean is to be registered.
This value must not be null. If the
name
parameter is not null, it will usually but not necessarily be
the returned value.
Parameters:
-
server - The MBean server in which the MBean will be registered.
-
name - The object name of the MBean. This name is null if
the name parameter to one of the
createMBean
or
registerMBean
methods in the {@link MBeanServer}
interface is null. In that case, this method must return a
non-null ObjectName for the new MBean.
Throws:
-
java.lang.Exception - This exception will be caught by
the MBean server and re-thrown as an {@link
MBeanRegistrationException}.