Top Fields Constructors Methods
org.apache.tomcat.util.modeler.modules

public Class MbeansDescriptorsIntrospectionSource

extends ModelerSource
Class Inheritance
Imports
java.lang.reflect.Method, .Modifier, java.math.BigDecimal, .BigInteger, java.util.ArrayList, .HashMap, .HashSet, .List, .Map, .Set, javax.management.ObjectName, org.apache.juli.logging.Log, .LogFactory, org.apache.tomcat.util.modeler.AttributeInfo, .ManagedBean, .OperationInfo, .ParameterInfo, .Registry, org.apache.tomcat.util.res.StringManager

Field Summary

Modifier and TypeField and Description
private static final Log
private final List<ObjectName>
private Registry
private static final StringManager
private static final Map<String, String>
private static final Class<?>[]
private String
Inherited from org.apache.tomcat.util.modeler.modules.ModelerSource:
source

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public ManagedBean

Returns:

ManagedBean The create MBean
createManagedBean
(Registry
The Bean registry (not used)
registry
,
String
The bean domain (not used)
domain
,
Class<?>
The class to analyze
realClass
,
String
The bean type
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

public void
private void
initMethods(Class<?>
The class to process
realClass
,
Set<String>
The attribute name (complete)
attNames
,
Map<String, Method>
The readable attributes map
getAttMap
,
Map<String, Method>
The settable attributes map
setAttMap
,
List<Method>
The invokable attributes list
invokeAttList
)

Process the methods and extract 'attributes', methods, etc.

private boolean

Returns:

boolean True if the class is compatible.
isBeanCompatible
(Class<?>
The class to check
javaType
)

Check if this class conforms to JavaBeans specifications.

public List<ObjectName>
loadDescriptors(Registry
The registry
registry
,
String
The bean registry type
type
,
Object
Introspected object or some other source
source
)

Implements abstract org.apache.tomcat.util.modeler.modules.ModelerSource.loadDescriptors.

Load data, returns a list of items.

public void
public void
setSource(Object source)

public void
setType(String
The type
type
)

Used if a single component is loaded

private boolean

Returns:

boolean True if class is supported
supportedType
(Class<?>
The class to check
ret
)

Check if this class is one of the supported types.

private static String

Returns:

String
unCapitalize
(String
The string to convert
name
)

Converts the first character of the given String into lower-case.

Field Detail

logback to summary
private static final Log log
mbeansback to summary
private final List<ObjectName> mbeans
registryback to summary
private Registry registry
smback to summary
private static final StringManager sm

Hides org.apache.tomcat.util.modeler.modules.ModelerSource.sm.

specialMethodsback to summary
private static final Map<String, String> specialMethods
supportedTypesback to summary
private static final Class<?>[] supportedTypes
typeback to summary
private String type

Constructor Detail

MbeansDescriptorsIntrospectionSourceback to summary
public MbeansDescriptorsIntrospectionSource()

Method Detail

createManagedBeanback to summary
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:Registry

The Bean registry (not used)

domain:String

The bean domain (not used)

realClass:Class<?>

The class to analyze

type:String

The bean type

Returns:ManagedBean

ManagedBean The create MBean

executeback to summary
public void execute() throws Exception
initMethodsback to summary
private void initMethods(Class<?> realClass, Set<String> attNames, Map<String, Method> getAttMap, Map<String, Method> setAttMap, List<Method> invokeAttList)

Process the methods and extract 'attributes', methods, etc.

Parameters
realClass:Class<?>

The class to process

attNames:Set<String>

The attribute name (complete)

getAttMap:Map<String, Method>

The readable attributes map

setAttMap:Map<String, Method>

The settable attributes map

invokeAttList:List<Method>

The invokable attributes list

isBeanCompatibleback to summary
private boolean isBeanCompatible(Class<?> javaType)

Check if this class conforms to JavaBeans specifications. If the class is conformant, returns true.

Parameters
javaType:Class<?>

The class to check

Returns:boolean

boolean True if the class is compatible.

loadDescriptorsback to summary
public List<ObjectName> loadDescriptors(Registry registry, String type, Object source) throws Exception

Implements abstract org.apache.tomcat.util.modeler.modules.ModelerSource.loadDescriptors.

Doc from org.apache.tomcat.util.modeler.modules.ModelerSource.loadDescriptors.

Load data, returns a list of items.

Parameters
registry:Registry

The registry

type:String

The bean registry type

source:Object

Introspected object or some other source

Returns:List<ObjectName>

a list of object names

Annotations
@Override
Exceptions
Exception:
Error loading descriptors
setRegistryback to summary
public void setRegistry(Registry reg)
setSourceback to summary
public void setSource(Object source)
setTypeback to summary
public void setType(String type)

Used if a single component is loaded

Parameters
type:String

The type

supportedTypeback to summary
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:Class<?>

The class to check

Returns:boolean

boolean True if class is supported

unCapitalizeback to summary
private static String unCapitalize(String name)

Converts the first character of the given String into lower-case.

Parameters
name:String

The string to convert

Returns:String

String