org.apache.commons.modeler.modules

Class MbeansSource

public class MbeansSource extends ModelerSource implements 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
static classMbeansSource.ArgsInfo
Field Summary
Documentdocument
longlastUpdate
static booleanloaderLoaded
booleanloading
static Loglog
Listmbeans
HashMapobject2Node
Registryregistry
Stringtype
longupdateInterval
Method Summary
voiddestroy()
voidexecute()
StringgetLocation()
ListgetMBeans()
Return the list of mbeans created by this source.
ObjectgetSource()
voidinit()
voidload()
ListloadDescriptors(Registry registry, String location, String type, Object source)
MbeansSource.ArgsInfoprocessArg(Node mbeanN)
voidprocessAttribute(MBeanServer server, Node descN, String objectName)
voidsave()
Store the mbeans.
voidsetLocation(String loc)
voidsetRegistry(Registry reg)
voidsetSource(Object source)
voidsetType(String type)
Used if a single component is loaded
voidstart()
voidstop()
voidupdateField(ObjectName oname, String name, Object value)

Field Detail

document

private Document document

lastUpdate

long lastUpdate

loaderLoaded

static boolean loaderLoaded

loading

boolean loading

log

private static Log log

mbeans

List mbeans

object2Node

private HashMap object2Node

registry

Registry registry

type

String type

updateInterval

long updateInterval

Method Detail

destroy

public void destroy()

execute

public void execute()

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.

getSource

public Object getSource()

init

public void init()

load

public void load()

loadDescriptors

public List loadDescriptors(Registry registry, String location, String type, Object source)

processArg

private MbeansSource.ArgsInfo 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

setLocation

public void setLocation(String loc)

setRegistry

public void setRegistry(Registry reg)

setSource

public void setSource(Object source)

setType

public void setType(String type)
Used if a single component is loaded

Parameters: type

start

public void start()

stop

public void stop()

updateField

public void updateField(ObjectName oname, String name, Object value)
Copyright (c) 2001-2003 - Apache Software Foundation