org.apache.commons.modeler.modules
Class MbeansSource
- MbeansSourceMBean
public class MbeansSource
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
document
private Document document
lastUpdate
(package private) long lastUpdate
loaderLoaded
(package private) static boolean loaderLoaded
loading
(package private) boolean loading
log
private static Log log
mbeans
(package private) List mbeans
object2Node
private HashMap object2Node
registry
(package private) Registry registry
type
(package private) String type
updateInterval
(package private) long updateInterval
destroy
public void destroy()
throws Exception
execute
public void execute()
throws Exception
getLocation
public String getLocation()
getMBeans
public List getMBeans()
Return the list of mbeans created by this source.
It can be used to implement runtime services.
- getMBeans in interface MbeansSourceMBean
loadDescriptors
public List loadDescriptors(Registry registry,
String location,
String type,
Object source)
throws Exception
Load data, returns a list of items.
- loadDescriptors in interface ModelerSource
registry
- location
- type
- source
- Introspected object or some other source
processArg
private void processArg(Node mbeanN)
processAttribute
private void processAttribute(MBeanServer server,
Node descN,
String objectName)
save
public void save()
Store the mbeans.
XXX add a background thread to store it periodically
- save in interface MbeansSourceMBean
setLocation
public void setLocation(String loc)
setRegistry
public void setRegistry(Registry reg)
setType
public void setType(String type)
Used if a single component is loaded
start
public void start()
throws Exception
stop
public void stop()
throws Exception
updateField
public void updateField(ObjectName oname,
String name,
Object value)
Callback from the BaseMBean to notify that an attribute has changed.
Can be used to implement persistence.
- updateField in interface ModelerSource
Copyright (c) 2001-2003 - Apache Software Foundation