Class MbeansSource
java.lang.Object
org.apache.commons.modeler.modules.ModelerSource
org.apache.commons.modeler.modules.MbeansSource
- All Implemented Interfaces:
MbeansSourceMBean
This will create mbeans based on a config file.
The format is an extended version of MLET.
Classloading. We don't support any explicit classloader tag.
A ClassLoader is just an mbean ( it can be the standard MLetMBean or
a custom one ).
XXX add a special attribute to reference the loader mbean,
XXX figure out how to deal with private loaders
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Document
(package private) long
(package private) static boolean
(package private) boolean
private static org.apache.commons.logging.Log
(package private) List
private HashMap
(package private) Registry
(package private) String
(package private) long
Fields inherited from class org.apache.commons.modeler.modules.ModelerSource
location, source
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
void
execute()
Return the list of mbeans created by this source.void
init()
Call the init method on all mbeans.void
load()
Load the mbeans from the source.loadDescriptors
(Registry registry, String location, String type, Object source) Load data, returns a list of items.private MbeansSource.ArgsInfo
processArg
(Node mbeanN) private void
processAttribute
(MBeanServer server, Node descN, String objectName) void
save()
Store the mbeans.void
setLocation
(String loc) void
setRegistry
(Registry reg) void
Set the source to be used to load the mbeansvoid
Used if a single component is loadedvoid
start()
void
stop()
void
updateField
(ObjectName oname, String name, Object value) Callback from the BaseMBean to notify that an attribute has changed.Methods inherited from class org.apache.commons.modeler.modules.ModelerSource
getInputStream, store
-
Field Details
-
Constructor Details
-
MbeansSource
public MbeansSource()
-
-
Method Details
-
setRegistry
-
setLocation
-
setType
Used if a single component is loaded- Parameters:
type
-
-
setSource
Description copied from interface:MbeansSourceMBean
Set the source to be used to load the mbeans- Specified by:
setSource
in interfaceMbeansSourceMBean
- Parameters:
source
- File or URL
-
getSource
- Specified by:
getSource
in interfaceMbeansSourceMBean
-
getLocation
-
getMBeans
Return the list of mbeans created by this source. It can be used to implement runtime services.- Specified by:
getMBeans
in interfaceMbeansSourceMBean
- Returns:
- List of ObjectName
-
loadDescriptors
public List loadDescriptors(Registry registry, String location, String type, Object source) throws Exception Description copied from class:ModelerSource
Load data, returns a list of items.- Overrides:
loadDescriptors
in classModelerSource
source
- Introspected object or some other source- Throws:
Exception
-
start
- Throws:
Exception
-
stop
- Throws:
Exception
-
init
Description copied from interface:MbeansSourceMBean
Call the init method on all mbeans. Will call load if not done already- Specified by:
init
in interfaceMbeansSourceMBean
- Throws:
Exception
-
destroy
- Throws:
Exception
-
load
Description copied from interface:MbeansSourceMBean
Load the mbeans from the source. Called automatically on init()- Specified by:
load
in interfaceMbeansSourceMBean
- Throws:
Exception
-
execute
- Throws:
Exception
-
updateField
Description copied from class:ModelerSource
Callback from the BaseMBean to notify that an attribute has changed. Can be used to implement persistence.- Overrides:
updateField
in classModelerSource
-
save
public void save()Store the mbeans. XXX add a background thread to store it periodically- Specified by:
save
in interfaceMbeansSourceMBean
-
processAttribute
-
processArg
-