Provides MBean server references. There are no instances of this class.
Since JMX 1.2 this class makes it possible to replace the default
MBeanServer implementation. This is done using the
javax. class.
The class of the initial MBeanServerBuilder to be
instantiated can be specified through the
javax.management.builder.initial system property.
The specified class must be a public subclass of
javax., and must have a public
empty constructor.
By default, if no value for that property is specified, an instance of
javax.
is created. Otherwise, the MBeanServerFactory attempts to load the
specified class using
Thread., or if that is null,
Class.. Then
it creates an initial instance of that Class using
java.. If any checked exception
is raised during this process (e.g.
java.,
java.) the MBeanServerFactory
will propagate this exception from within a RuntimeException.
The javax.management.builder.initial system property is consulted every time a new MBeanServer needs to be created, and the class pointed to by that property is loaded. If that class is different from that of the current MBeanServerBuilder, then a new MBeanServerBuilder is created. Otherwise, the MBeanServerFactory may create a new MBeanServerBuilder or reuse the current one.
If the class pointed to by the property cannot be loaded, or does not correspond to a valid subclass of MBeanServerBuilder then an exception is propagated, and no MBeanServer can be created until the javax.management.builder.initial system property is reset to valid value.
The MBeanServerBuilder makes it possible to wrap the MBeanServers returned by the default MBeanServerBuilder implementation, for the purpose of e.g. adding an additional security layer.
| Modifier and Type | Field and Description |
|---|---|
| private static MBeanServerBuilder | builder
The builder that will be used to construct MBeanServers. |
| private static final ArrayList |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static synchronized void | |
| private static synchronized void | checkMBeanServerBuilder()
Instantiate a new builder according to the javax.management.builder.initial System property - if needed. |
| public static MBeanServer | Returns: the newly created MBeanServer.Return a new object implementing the MBeanServer interface with a standard default domain name. |
| public static MBeanServer | Returns: the newly created MBeanServer.the default domain name for the created
MBeanServer. This is the value that will be returned by domain)MBeanServer#getDefaultDomain.Return a new object implementing the |
| public static synchronized ArrayList | Returns: A list of MBeanServer objects.The agent identifier of the MBeanServer to
retrieve. If this parameter is null, all registered
MBeanServers in this JVM are returned. Otherwise, only
MBeanServers whose id is equal to agentId)agentId are
returned. The id of an MBeanServer is the
MBeanServerId attribute of its delegate MBean.Return a list of registered MBeanServer objects. |
| public static ClassLoaderRepository | Returns: The Class Loader Repository used by the given MBeanServer.The MBeanServer under examination. Since JMX 1.2,
if server)server is null, the result is a
NullPointerException. This behavior differs from what
was implemented in JMX 1.1 - where the possibility to use
null was deprecated.Return the ClassLoaderRepository used by the given MBeanServer. |
| private static synchronized MBeanServerBuilder | Returns: the new currentjavax..Get the current |
| private static Class | loadBuilderClass(String
The name of the builder class. builderClassName)Load the builder class through the context class loader. |
| private static String | |
| private static MBeanServerBuilder | newBuilder(Class<?> builderClass)
Creates the initial builder according to the javax.management.builder.initial System property - if specified. |
| public static MBeanServer | Returns: the newly created MBeanServer.Return a new object implementing the MBeanServer interface with a standard default domain name, without keeping an internal reference to this new object. |
| public static MBeanServer | Returns: the newly created MBeanServer.the default domain name for the created
MBeanServer. This is the value that will be returned by domain)MBeanServer#getDefaultDomain.Return a new object implementing the MBeanServer interface with the specified default domain name, without keeping an internal reference to this new object. |
| public static void | releaseMBeanServer(MBeanServer
the MBeanServer object to remove. mbeanServer)Remove internal MBeanServerFactory references to a created MBeanServer. |
| private static synchronized void |
| builder | back to summary |
|---|---|
| private static MBeanServerBuilder builder The builder that will be used to construct MBeanServers. | |
| mBeanServerList | back to summary |
|---|---|
| private static final ArrayList<MBeanServer> mBeanServerList | |
| MBeanServerFactory | back to summary |
|---|---|
| private MBeanServerFactory() | |
| addMBeanServer | back to summary |
|---|---|
| private static synchronized void addMBeanServer(MBeanServer mbs) | |
| checkMBeanServerBuilder | back to summary |
|---|---|
| private static synchronized void checkMBeanServerBuilder() Instantiate a new builder according to the javax.management.builder.initial System property - if needed. | |
| createMBeanServer | back to summary |
|---|---|
| public static MBeanServer createMBeanServer() Return a new object implementing the MBeanServer interface with a standard default domain name. The default domain name is used as the domain part in the ObjectName of MBeans when the domain is specified by the user is null. The standard default domain name is
The MBeanServer reference is internally kept. This will
allow This method is equivalent to
| |
| createMBeanServer | back to summary |
|---|---|
| public static MBeanServer createMBeanServer(String domain) Return a new object implementing the The MBeanServer reference is internally kept. This will
allow
| |
| findMBeanServer | back to summary |
|---|---|
| public static synchronized ArrayList Return a list of registered MBeanServer objects. A
registered MBeanServer object is one that was created by one of
the
| |
| getClassLoaderRepository | back to summary |
|---|---|
| public static ClassLoaderRepository getClassLoaderRepository(MBeanServer server) Return the ClassLoaderRepository used by the given MBeanServer.
This method is equivalent to
| |
| getNewMBeanServerBuilder | back to summary |
|---|---|
| private static synchronized MBeanServerBuilder getNewMBeanServerBuilder() Get the current
| |
| loadBuilderClass | back to summary |
|---|---|
| private static Class Load the builder class through the context class loader.
| |
| mBeanServerId | back to summary |
|---|---|
| private static String mBeanServerId(MBeanServer mbs) | |
| newBuilder | back to summary |
|---|---|
| private static MBeanServerBuilder newBuilder(Class<?> builderClass) Creates the initial builder according to the javax.management.builder.initial System property - if specified. If any checked exception needs to be thrown, it is embedded in a JMRuntimeException. | |
| newMBeanServer | back to summary |
|---|---|
| public static MBeanServer newMBeanServer() Return a new object implementing the MBeanServer interface with a standard default domain name, without keeping an internal reference to this new object. The default domain name is used as the domain part in the ObjectName of MBeans when the domain is specified by the user is null. The standard default domain name is
No reference is kept. This method is equivalent to
| |
| newMBeanServer | back to summary |
|---|---|
| public static MBeanServer newMBeanServer(String domain) Return a new object implementing the MBeanServer interface with the specified default domain name, without keeping an internal reference to this new object. The given domain name is used as the domain part in the ObjectName of MBeans when the domain is specified by the user is null. No reference is kept.
| |
| releaseMBeanServer | back to summary |
|---|---|
| public static void releaseMBeanServer(MBeanServer mbeanServer) Remove internal MBeanServerFactory references to a created MBeanServer. This allows the garbage collector to remove the MBeanServer object.
| |
| removeMBeanServer | back to summary |
|---|---|
| private static synchronized void removeMBeanServer(MBeanServer mbs) | |