Package wt.jmx.core.mbeans
Class MBeanLoader
java.lang.Object
javax.management.StandardMBean
wt.jmx.core.StandardMBean
wt.jmx.core.SelfAwareMBean
wt.jmx.core.mbeans.MBeanLoader
- All Implemented Interfaces:
DynamicMBean,MBeanRegistration,NotificationBroadcaster,NotificationEmitter,BaseObjectNamed,MBeanLoaderMBean,SelfEmailingMBean
public final class MBeanLoader
extends SelfAwareMBean
implements MBeanLoaderMBean, NotificationEmitter
This MBean provides
Supported API: true
Extendable: false
XMLEncoder/XMLDecoder based
persistence to/from files for MBeans and other objects.
Supported API: true
Extendable: false
-
Field Summary
Fields inherited from interface wt.jmx.core.mbeans.MBeanLoaderMBean
LOAD_FINISHED_NOTIF_TYPE, LOAD_STARTED_NOTIF_TYPE, SAVE_FINISHED_NOTIF_TYPE, SAVE_STARTED_NOTIF_TYPE, START_NOTIF_TYPE, STOP_NOTIF_TYPE, UNLOAD_FINISHED_NOTIF_TYPE, UNLOAD_STARTED_NOTIF_TYPE -
Method Summary
Modifier and TypeMethodDescription<T> voidaddAllInstancesOf(Class<T> objectClass, Collection<T> instances) Add all instances of 'objectClass' found in loader or its children to 'instances'.static MBeanLoadercreateAndRegisterMBeanLoader(String mbeanConfigFileRef) Create, register, and generally start up a new MBeanLoader instance, setting MBeanConfigFileCheckInterval to a reasonable default value and BaseObjectName to null.static MBeanLoadercreateAndRegisterMBeanLoader(String mbeanConfigFileRef, int mbeanConfigFileCheckInterval) Create, register, and generally start up a new MBeanLoader instance, setting MBeanConfigFileCheckInterval to a reasonable default value.static MBeanLoadercreateAndRegisterMBeanLoader(String mbeanConfigFileRef, int mbeanConfigFileCheckInterval, boolean registerDestroyOnShutdownHook, BaseObjectNamed baseObjectNamed) Create, register, and generally start up a new MBeanLoader instance and optionally register a shutdown hook to destroy the loader
Supported API: truestatic MBeanLoadercreateAndRegisterMBeanLoader(String mbeanConfigFileRef, int mbeanConfigFileCheckInterval, ObjectName baseObjectName) Create, register, and generally start up a new MBeanLoader instance
Supported API: truestatic MBeanLoadercreateAndRegisterMBeanLoader(String mbeanConfigFileRef, int mbeanConfigFileCheckInterval, ObjectName baseObjectName, boolean registerDestroyOnShutdownHook) Create, register, and generally start up a new MBeanLoader instance and optionally register a shutdown hook to destroy the loader
Supported API: true<T> TgetInstanceOf(Class<T> objectClass) Get first (by depth-first traversal ) instance of 'objectClass' found in loader or its children
Supported API: truestatic MBeanLoaderGet a root loader without any starting context.static MBeanLoadergetLoader(SelfAwareMBean mbean) Walk owner chain for 'mbean' and get most direct loader.static <T> TgetRelatedInstance(SelfAwareMBean mbeanContext, Class<T> objectClass) Get first instance of 'objectClass' found in the root loader that loaded 'mbeanContext'.static MBeanLoadergetRootLoader(SelfAwareMBean mbean) Walk owner chain for 'mbean' and get most top-most (root) loader.Methods inherited from class wt.jmx.core.SelfAwareMBean
deregister, destroy, getObjectName, getObjectNameOnPreRegister, getOwnerMBean, getSelfAwareMBean, init, isInited, isRegistered, isStarted, postDeregister, postRegister, preDeregister, preRegister, register, register, register, resetObjectName, setOwnerMBean, start, stopMethods inherited from class wt.jmx.core.StandardMBean
cacheMBeanInfo, cacheMBeanInfoInInstance, createMBeanInfo, emailThisMBean, getAttributes, getCachedInstanceMBeanInfo, getCachedMBeanInfo, getDescription, getDescription, getDescription, getDescription, getImpact, getMBeanInfo, getParameterName, setAttributesMethods inherited from class javax.management.StandardMBean
getAttribute, getClassName, getConstructors, getDescription, getDescription, getDescription, getImplementation, getImplementationClass, getMBeanInterface, getParameterName, invoke, setAttribute, setImplementationMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface wt.jmx.core.mbeans.MBeanLoaderMBean
isStarted, start, stopMethods inherited from interface wt.jmx.core.mbeans.SelfEmailingMBean
emailThisMBean
-
Method Details
-
createAndRegisterMBeanLoader
Create, register, and generally start up a new MBeanLoader instance, setting MBeanConfigFileCheckInterval to a reasonable default value and BaseObjectName to null.
Supported API: true- Parameters:
mbeanConfigFileRef- Reference (URL, file path, or resource path) of file from which MBeans will be loaded
-
createAndRegisterMBeanLoader
public static MBeanLoader createAndRegisterMBeanLoader(String mbeanConfigFileRef, int mbeanConfigFileCheckInterval) Create, register, and generally start up a new MBeanLoader instance, setting MBeanConfigFileCheckInterval to a reasonable default value.
Supported API: true- Parameters:
mbeanConfigFileRef- Reference (URL, file path, or resource path) of file from which MBeans will be loadedmbeanConfigFileCheckInterval- Interval (in seconds) at which MBeanConfigFileRef will be checked for updates; disabled if non-positive
-
createAndRegisterMBeanLoader
public static MBeanLoader createAndRegisterMBeanLoader(String mbeanConfigFileRef, int mbeanConfigFileCheckInterval, ObjectName baseObjectName) Create, register, and generally start up a new MBeanLoader instance
Supported API: true- Parameters:
mbeanConfigFileRef- Reference (URL, file path, or resource path) of file from which MBeans will be loadedmbeanConfigFileCheckInterval- Interval (in seconds) at which MBeanConfigFileRef will be checked for updates; disabled if non-positivebaseObjectName- Object name under which loaded (non-loader) objects will be located
-
createAndRegisterMBeanLoader
public static MBeanLoader createAndRegisterMBeanLoader(String mbeanConfigFileRef, int mbeanConfigFileCheckInterval, ObjectName baseObjectName, boolean registerDestroyOnShutdownHook) Create, register, and generally start up a new MBeanLoader instance and optionally register a shutdown hook to destroy the loader
Supported API: true- Parameters:
mbeanConfigFileRef- Reference (URL, file path, or resource path) of file from which MBeans will be loadedmbeanConfigFileCheckInterval- Interval (in seconds) at which MBeanConfigFileRef will be checked for updates; disabled if non-positivebaseObjectName- Object name under which loaded (non-loader) objects will be locatedregisterDestroyOnShutdownHook- Whether shutdown hook to destroy this loader should be registered with the JVM runtime
-
createAndRegisterMBeanLoader
public static MBeanLoader createAndRegisterMBeanLoader(String mbeanConfigFileRef, int mbeanConfigFileCheckInterval, boolean registerDestroyOnShutdownHook, BaseObjectNamed baseObjectNamed) Create, register, and generally start up a new MBeanLoader instance and optionally register a shutdown hook to destroy the loader
Supported API: true- Parameters:
mbeanConfigFileRef- Reference (URL, file path, or resource path) of file from which MBeans will be loadedmbeanConfigFileCheckInterval- Interval (in seconds) at which MBeanConfigFileRef will be checked for updates; disabled if non-positiveregisterDestroyOnShutdownHook- Whether shutdown hook to destroy this loader should be registered with the JVM runtimebaseObjectNamed- BaseObjectNamed object under which loaded (non-loader) objects will be located
-
getLoader
Walk owner chain for 'mbean' and get most direct loader. Returns null if no such loader is found.
Supported API: true -
getRootLoader
Walk owner chain for 'mbean' and get most top-most (root) loader. Returns null if no such loader is found.
Supported API: true -
getLoader
Get a root loader without any starting context. Returns null if none found.
Supported API: true -
getInstanceOf
Get first (by depth-first traversal ) instance of 'objectClass' found in loader or its children
Supported API: true -
addAllInstancesOf
Add all instances of 'objectClass' found in loader or its children to 'instances'.
Supported API: true -
getRelatedInstance
Get first instance of 'objectClass' found in the root loader that loaded 'mbeanContext'.
Supported API: true
-