Class MbeansDescriptorsIntrospectionSource
- java.lang.Object
-
- org.apache.commons.modeler.modules.ModelerSource
-
- org.apache.commons.modeler.modules.MbeansDescriptorsIntrospectionSource
-
public class MbeansDescriptorsIntrospectionSource extends ModelerSource
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.lang.Stringlocationprivate static org.apache.commons.logging.Loglog(package private) java.util.Listmbeansprivate static javax.management.ObjectName[]objNameArray(package private) Registryregistry(package private) java.lang.Objectsource(package private) static java.util.HashtablespecialMethodsprivate static java.lang.String[]strArrayprivate static java.lang.Class[]supportedTypes(package private) java.lang.Stringtype
-
Constructor Summary
Constructors Constructor Description MbeansDescriptorsIntrospectionSource()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ManagedBeancreateManagedBean(Registry registry, java.lang.String domain, java.lang.Class realClass, java.lang.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 constructorsvoidexecute()private voidinitMethods(java.lang.Class realClass, java.lang.reflect.Method[] methods, java.util.Hashtable attMap, java.util.Hashtable getAttMap, java.util.Hashtable setAttMap, java.util.Hashtable invokeAttMap)Process the methods and extract 'attributes', methods, etcprotected booleanisBeanCompatible(java.lang.Class javaType)Check if this class conforms to JavaBeans specifications.java.util.ListloadDescriptors(Registry registry, java.lang.String location, java.lang.String type, java.lang.Object source)Load data, returns a list of items.voidsetLocation(java.lang.String loc)voidsetRegistry(Registry reg)voidsetSource(java.lang.Object source)voidsetType(java.lang.String type)Used if a single component is loadedprivate booleansupportedType(java.lang.Class ret)Check if this class is one of the supported types.private static java.lang.StringunCapitalize(java.lang.String name)Converts the first character of the given String into lower-case.-
Methods inherited from class org.apache.commons.modeler.modules.ModelerSource
getInputStream, store, updateField
-
-
-
-
Field Detail
-
log
private static org.apache.commons.logging.Log log
-
registry
Registry registry
-
location
java.lang.String location
-
type
java.lang.String type
-
source
java.lang.Object source
-
mbeans
java.util.List mbeans
-
specialMethods
static java.util.Hashtable specialMethods
-
strArray
private static java.lang.String[] strArray
-
objNameArray
private static javax.management.ObjectName[] objNameArray
-
supportedTypes
private static java.lang.Class[] supportedTypes
-
-
Method Detail
-
setRegistry
public void setRegistry(Registry reg)
-
setLocation
public void setLocation(java.lang.String loc)
-
setType
public void setType(java.lang.String type)
Used if a single component is loaded- Parameters:
type-
-
setSource
public void setSource(java.lang.Object source)
-
loadDescriptors
public java.util.List loadDescriptors(Registry registry, java.lang.String location, java.lang.String type, java.lang.Object source) throws java.lang.Exception
Description copied from class:ModelerSourceLoad data, returns a list of items.- Overrides:
loadDescriptorsin classModelerSourcesource- Introspected object or some other source- Throws:
java.lang.Exception
-
execute
public void execute() throws java.lang.Exception- Throws:
java.lang.Exception
-
supportedType
private boolean supportedType(java.lang.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
-
isBeanCompatible
protected boolean isBeanCompatible(java.lang.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.
-
initMethods
private void initMethods(java.lang.Class realClass, java.lang.reflect.Method[] methods, java.util.Hashtable attMap, java.util.Hashtable getAttMap, java.util.Hashtable setAttMap, java.util.Hashtable invokeAttMap)Process the methods and extract 'attributes', methods, etc- Parameters:
realClass- The class to processmethods- The methods to processattMap- The attribute map (complete)getAttMap- The readable attributess mapsetAttMap- The settable attributes mapinvokeAttMap- The invokable attributes map
-
createManagedBean
public ManagedBean createManagedBean(Registry registry, java.lang.String domain, java.lang.Class realClass, java.lang.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 analyzetype- The bean type- Returns:
- ManagedBean The create MBean
-
unCapitalize
private static java.lang.String unCapitalize(java.lang.String name)
Converts the first character of the given String into lower-case.- Parameters:
name- The string to convert- Returns:
- String
-
-