org.apache.commons.modeler.modules

Class MbeansDescriptorsIntrospectionSource

public class MbeansDescriptorsIntrospectionSource extends ModelerSource

Field Summary
Stringlocation
static Loglog
Listmbeans
static ObjectName[]objNameArray
Registryregistry
Objectsource
static HashtablespecialMethods
static String[]strArray
static Class[]supportedTypes
Stringtype
Method Summary
ManagedBeancreateManagedBean(Registry registry, String domain, Class realClass, String type)
XXX Find if the 'className' is the name of the MBean or the real class ( I suppose first ) XXX Read (optional) descriptions from a .properties, generated from source XXX Deal with constructors
voidexecute()
voidinitMethods(Class realClass, Method[] methods, Hashtable attMap, Hashtable getAttMap, Hashtable setAttMap, Hashtable invokeAttMap)
Process the methods and extract 'attributes', methods, etc
protected booleanisBeanCompatible(Class javaType)
Check if this class conforms to JavaBeans specifications.
ListloadDescriptors(Registry registry, String location, String type, Object source)
voidsetLocation(String loc)
voidsetRegistry(Registry reg)
voidsetSource(Object source)
voidsetType(String type)
Used if a single component is loaded
booleansupportedType(Class ret)
Check if this class is one of the supported types.
static StringunCapitalize(String name)
Converts the first character of the given String into lower-case.

Field Detail

location

String location

log

private static Log log

mbeans

List mbeans

objNameArray

private static ObjectName[] objNameArray

registry

Registry registry

source

Object source

specialMethods

static Hashtable specialMethods

strArray

private static String[] strArray

supportedTypes

private static Class[] supportedTypes

type

String type

Method Detail

createManagedBean

public ManagedBean createManagedBean(Registry registry, String domain, Class realClass, String type)
XXX Find if the 'className' is the name of the MBean or the real class ( I suppose first ) XXX Read (optional) descriptions from a .properties, generated from source XXX Deal with constructors

Parameters: registry The Bean registry (not used) domain The bean domain (not used) realClass The class to analyze type The bean type

Returns: ManagedBean The create MBean

execute

public void execute()

initMethods

private void initMethods(Class realClass, Method[] methods, Hashtable attMap, Hashtable getAttMap, Hashtable setAttMap, Hashtable invokeAttMap)
Process the methods and extract 'attributes', methods, etc

Parameters: realClass The class to process methods The methods to process attMap The attribute map (complete) getAttMap The readable attributess map setAttMap The settable attributes map invokeAttMap The invokable attributes map

isBeanCompatible

protected boolean isBeanCompatible(Class javaType)
Check if this class conforms to JavaBeans specifications. If the class is conformant, returns true.

Parameters: javaType The class to check

Returns: boolean True if the class is compatible.

loadDescriptors

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

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

supportedType

private boolean supportedType(Class ret)
Check if this class is one of the supported types. If the class is supported, returns true. Otherwise, returns false.

Parameters: ret The class to check

Returns: boolean True if class is supported

unCapitalize

private static String unCapitalize(String name)
Converts the first character of the given String into lower-case.

Parameters: name The string to convert

Returns: String

Copyright (c) 2001-2003 - Apache Software Foundation