Package org.apache.tomcat.util.modeler
Class NoDescriptorRegistry
java.lang.Object
org.apache.tomcat.util.modeler.Registry
org.apache.tomcat.util.modeler.NoDescriptorRegistry
- All Implemented Interfaces:
- MBeanRegistration,- RegistryMBean
An implementation of the MBean registry that effectively disables MBean
 registration. This is typically used when low memory footprint is a primary
 concern.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddManagedBean(ManagedBean bean) Add a new bean metadata to the set of beans known to this registry.findManagedBean(Object bean, Class<?> beanClass, String type) Find or load metadata.findManagedBean(String name) Find and return the managed bean definition for the specified bean name, if any; otherwise returnnull.intReturn an int ID for faster access.Factory method to create (if necessary) and return ourMBeanServerinstance.getMethodInfo(ObjectName oname, String opName) Find the operation info for a methodgetType(ObjectName oname, String attName) Get the type of an attribute of the object, from the metadata.voidinvoke(List<ObjectName> mbeans, String operation, boolean failFirst) Invoke a operation on a list of mbeans.Load descriptors.voidloadDescriptors(String packageName, ClassLoader classLoader) Lookup the component descriptor in the package and in the parent packages.voidregisterComponent(Object bean, String oname, String type) Register a bean by creating a modeler mbean and adding it to the MBeanServer.voidregisterComponent(Object bean, ObjectName oname, String type) Register a componentvoidunregisterComponent(String oname) Unregister a component.voidunregisterComponent(ObjectName oname) Unregister a component.Methods inherited from class org.apache.tomcat.util.modeler.RegistryconvertValue, disableRegistry, getMethodInfo, getRegistry, postDeregister, postRegister, preDeregister, preRegister, stop
- 
Constructor Details- 
NoDescriptorRegistrypublic NoDescriptorRegistry()
 
- 
- 
Method Details- 
registerComponentDescription copied from class:RegistryRegister a bean by creating a modeler mbean and adding it to the MBeanServer. If metadata is not loaded, we'll look up and read a file named "mbeans-descriptors.ser" or "mbeans-descriptors.xml" in the same package or parent. If the bean is an instance of DynamicMBean. it's metadata will be converted to a model mbean and we'll wrap it - so modeler services will be supported If the metadata is still not found, introspection will be used to extract it automatically. If an mbean is already registered under this name, it'll be first unregistered. If the component implements MBeanRegistration, the methods will be called. If the method has a method "setRegistry" that takes a RegistryMBean as parameter, it'll be called with the current registry.- Specified by:
- registerComponentin interface- RegistryMBean
- Overrides:
- registerComponentin class- Registry
- 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.
- Throws:
- Exception- if a registration error occurred
 
- 
unregisterComponentDescription copied from class:RegistryUnregister a component. We'll first check if it is registered, and mask all errors. This is mostly a helper.- Specified by:
- unregisterComponentin interface- RegistryMBean
- Overrides:
- unregisterComponentin class- Registry
- Parameters:
- oname- Name used for unregistration
 
- 
invokeDescription copied from class:RegistryInvoke a operation on a list of mbeans. Can be used to implement lifecycle operations.- Specified by:
- invokein interface- RegistryMBean
- Overrides:
- invokein class- Registry
- 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- Error invoking operation
 
- 
getIdDescription copied from class:RegistryReturn an int ID for faster access. Will be used for notifications and for other operations we want to optimize.- Specified by:
- getIdin interface- RegistryMBean
- Overrides:
- getIdin class- Registry
- Parameters:
- domain- Namespace
- name- Type of the notification
- Returns:
- A unique id for the domain:name combination
 
- 
addManagedBeanDescription copied from class:RegistryAdd a new bean metadata to the set of beans known to this registry. This is used by internal components.- Overrides:
- addManagedBeanin class- Registry
- Parameters:
- bean- The managed bean to be added
 
- 
findManagedBeanDescription copied from class:RegistryFind and return the managed bean definition for the specified bean name, if any; otherwise returnnull.- Overrides:
- findManagedBeanin class- Registry
- 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.
- Returns:
- the managed bean
 
- 
getTypeDescription copied from class:RegistryGet the type of an attribute of the object, from the metadata.
- 
getMethodInfoDescription copied from class:RegistryFind the operation info for a method- Overrides:
- getMethodInfoin class- Registry
- Parameters:
- oname- The bean name
- opName- The operation name
- Returns:
- the operation info for the specified operation
 
- 
findManagedBeanDescription copied from class:RegistryFind or load metadata.- Overrides:
- findManagedBeanin class- Registry
- Parameters:
- bean- The bean
- beanClass- The bean class
- type- The registry type
- Returns:
- the managed bean
- Throws:
- Exception- An error occurred
 
- 
loadDescription copied from class:RegistryLoad descriptors.
- 
loadDescriptorsDescription copied from class:RegistryLookup the component descriptor in the package and in the parent packages.- Overrides:
- loadDescriptorsin class- Registry
- Parameters:
- packageName- The package name
- classLoader- The class loader
 
- 
registerComponentDescription copied from class:RegistryRegister a component- Overrides:
- registerComponentin class- Registry
- Parameters:
- bean- The bean
- oname- The object name
- type- The registry type
- Throws:
- Exception- Error registering component
 
- 
unregisterComponentDescription copied from class:RegistryUnregister a component. This is just a helper that avoids exceptions by checking if the mbean is already registered- Overrides:
- unregisterComponentin class- Registry
- Parameters:
- oname- The bean name
 
- 
getMBeanServerDescription copied from class:RegistryFactory method to create (if necessary) and return ourMBeanServerinstance.- Overrides:
- getMBeanServerin class- Registry
- Returns:
- the MBean server
 
 
-