org.apache.tomcat.util.modeler
public class Registry extends Object implements RegistryMBean, MBeanRegistration
Constructor Summary | |
---|---|
Registry() |
Method Summary | |
---|---|
void | addManagedBean(ManagedBean bean)
Add a new bean metadata to the set of beans known to this registry.
|
Object | convertValue(String type, String value) EXPERIMENTAL Convert a string to object, based on type. |
ManagedBean | findManagedBean(String name)
Find and return the managed bean definition for the specified
bean name, if any; otherwise return null .
|
ManagedBean | findManagedBean(Object bean, Class beanClass, String type) Find or load metadata. |
ManagedBean | findManagedBean(Class beanClass, String type) |
String[] | findManagedBeans()
Return the set of bean names for all managed beans known to
this registry.
|
String[] | findManagedBeans(String group)
Return the set of bean names for all managed beans known to
this registry that belong to the specified group.
|
int | getId(String domain, String name) Return an int ID for faster access. |
MBeanServer | getMBeanServer()
Factory method to create (if necessary) and return our
MBeanServer instance.
|
MBeanOperationInfo | getMethodInfo(ObjectName oname, String opName) Find the operation info for a method
|
static Registry | getRegistry(Object key, Object guard)
Factory method to create (if necessary) and return our
Registry instance.
|
static Registry | getRegistry() Get a "singelton" registry, or one per thread if setUseContextLoader
was called
|
static MBeanServer | getServer()
Factory method to create (if necessary) and return our
MBeanServer instance.
|
String | getType(ObjectName oname, String attName) Get the type of an attribute of the object, from the metadata.
|
void | invoke(List mbeans, String operation, boolean failFirst) Invoke a operation on a list of mbeans. |
List | load(String sourceType, Object source, String param) Experimental.
|
void | loadCachedDescriptors(Object source)
Load the registry from a cached .ser file. |
void | loadDescriptors(String packageName, ClassLoader classLoader) Lookup the component descriptor in the package and
in the parent packages.
|
void | loadDescriptors(String sourceType, Object source, String param) Experimental. |
void | loadDescriptors(Object source)
Load the registry from the XML input found in the specified input
stream.
|
List | loadMBeans(Object source, ClassLoader cl)
Load an extended mlet file. |
void | loadMetadata(Object source) Load descriptors. |
static void | loadRegistry(InputStream stream)
Load the registry from the XML input found in the specified input
stream.
|
void | postDeregister() |
void | postRegister(Boolean registrationDone) |
void | preDeregister() |
ObjectName | preRegister(MBeanServer server, ObjectName name) |
void | registerComponent(Object bean, String oname, String type) Register a bean by creating a modeler mbean and adding it to the
MBeanServer.
|
void | registerComponent(Object bean, ObjectName oname, String type) Register a component
XXX make it private
|
void | registerComponent(Object bean, String domain, String type, String name) |
void | removeManagedBean(ManagedBean bean)
Remove an existing bean from the set of beans known to this registry.
|
void | resetMetadata() |
void | setMBeanServer(MBeanServer server)
Set the MBeanServer to be utilized for our
registered management beans.
|
static void | setServer(MBeanServer mbeanServer)
Set the MBeanServer to be utilized for our
registered management beans.
|
static void | setUseContextClassLoader(boolean enable)
Allow containers to isolate apps. |
void | stop() Lifecycle method - clean up the registry metadata.
|
void | unregisterComponent(String oname) Unregister a component. |
void | unregisterComponent(ObjectName oname) Unregister a component. |
void | unregisterComponent(String domain, String name) |
void | unregisterRegistry(ClassLoader loader) Called by a registry or by the container to unload a loader |
Parameters: bean The managed bean to be added
Since: 1.0
Parameters: type Fully qualified class name of the resulting value value String value to be converted
Returns: Converted value
null
.
Parameters: name Name of the managed bean to be returned. Since 1.1, both short names or the full name of the class can be used.
Since: 1.0
Since: 1.0
Parameters: group Name of the group of interest, or null
to select beans that do not belong to a group
Since: 1.0
Parameters: domain Namespace name Type of the notification
Returns: An unique id for the domain:name combination
Since: 1.1
MBeanServer
instance.
Parameters: oname opName
Returns: the operation info for the specified operation
Registry
instance.
Use this method to obtain a Registry - all other static methods
are deprecated and shouldn't be used.
The current version uses a static - future versions could use
the thread class loader.
Parameters: key Support for application isolation. If null, the context class loader will be used ( if setUseContextClassLoader is called ) or the default registry is returned. guard Prevent access to the registry by untrusted components
Since: 1.1
Deprecated: Not enough info - use the method that takes CL and domain
Get a "singelton" registry, or one per thread if setUseContextLoader was calledSince: 1.0
Deprecated: Use the instance method
Factory method to create (if necessary) and return ourMBeanServer
instance.
Since: 1.0
Parameters: oname attName
Returns: null if metadata about the attribute is not found
Since: 1.1
Parameters: mbeans list of ObjectName on which we'll invoke the operations operation Name of the operation ( init, start, stop, etc) failFirst If false, exceptions will be ignored
Throws: Exception
Since: 1.1
Deprecated: bad interface, mixing of metadata and mbeans
Experimental.Parameters: sourceType source param
Returns: List of descriptors
Throws: Exception
Deprecated: Loaded automatically or using a File or Url ending in .ser
Load the registry from a cached .ser file. This is typically 2-3 times faster than parsing the XML.Parameters: source Source to be used to load. Can be an InputStream or URL.
Throws: Exception if any parsing or processing error occurs
Parameters: packageName
Deprecated:
Experimental. Will become private, some code may still use itParameters: sourceType source param
Throws: Exception
Parameters: source Source to be used to load. Can be an InputStream or URL.
Throws: Exception if any parsing or processing error occurs
Parameters: source InputStream or URL of the file cl ClassLoader to be used to load the mbeans, or null to use the default JMX mechanism ( i.e. all registered loaders )
Returns: List of ObjectName for the loaded mbeans
Throws: Exception
Since: 1.1
Parameters: source
Deprecated: use normal class method instead
Load the registry from the XML input found in the specified input stream.Parameters: stream InputStream containing the registry configuration information
Throws: Exception if any parsing or processing error occurs
Since: 1.0
Parameters: bean Object to be registered oname Name used for registration type The type of the mbean, as declared in mbeans-descriptors. If null, the name of the class will be used. This can be used as a hint or by subclasses.
Since: 1.1
Parameters: bean oname type
Throws: Exception
Deprecated: - may still be used in code using pre-1.1 builds
Parameters: bean The managed bean to be removed
Since: 1.0
MBeanServer
to be utilized for our
registered management beans.
Parameters: server The new MBeanServer
instance
Deprecated: Use the instance method
Set theMBeanServer
to be utilized for our
registered management beans.
Parameters: mbeanServer The new MBeanServer
instance
Since: 1.0
Parameters: enable
Since: 1.1
Since: 1.1
Parameters: oname
Since: 1.1
Parameters: oname
Parameters: loader