| Modifier and Type | Field and Description |
|---|---|
| private Map | descriptors
The set of ManagedBean instances for the beans this registry knows about, keyed by name. |
| private Map | descriptorsByClass
List of managed beans, keyed by class name |
| private Object | |
| private final Hashtable | |
| private final Hashtable | |
| private static final Log | log
The Log instance to which we will write our log messages. |
| private static Registry | registry
The registry instance created by our factory method the first time it is called. |
| private Map | |
| private volatile MBeanServer | server
The |
| private final Object | |
| private static final StringManager |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public void | addManagedBean(ManagedBean
The managed bean to be added bean)Add a new bean metadata to the set of beans known to this registry. |
| public Object | Returns: Converted valueFully qualified class name of the resulting value type, String String value to be converted value)Convert a string to object, based on type. |
| public static synchronized void | |
| private void | findDescriptor(Class<?> beanClass, String type)
Lookup the component descriptor in the package and in the parent packages. |
| public ManagedBean | Returns: the managed beanName of the managed bean to be returned. Since 1.1, both
short names or the full name of the class can be used. name)Find and return the managed bean definition for the specified bean name,
if any; otherwise return |
| public ManagedBean | Returns: the managed beanThe bean bean, Class<?> The bean class beanClass, String The registry type type)Find or load metadata. |
| public synchronized int | Returns: A unique id for the domain:name combinationNamespace domain, String Type of the notification name)Implements org. Return an int ID for faster access. |
| public MBeanServer | Returns: the MBean serverFactory method to create (if necessary) and return our
|
| public MBeanOperationInfo | Returns: the operation info for the specified operationThe bean name oname, String The operation name opName)Find the operation info for a method |
| public MBeanOperationInfo | Returns: the operation info for the specified operationThe bean name oname, String The operation name opName, int The number of arguments to the method argCount)Find the operation info for a method. |
| private ModelerSource | |
| public static synchronized Registry | Returns: the registryUnused key, Object Prevent access to the registry by untrusted components guard)Factory method to create (if necessary) and return our
|
| public String | Returns: null if metadata about the attribute is not foundThe bean name oname, String The attribute name attName)Get the type of an attribute of the object, from the metadata. |
| public void | invoke(List<ObjectName>
list of ObjectName on which we'll invoke the operations mbeans, String Name of the operation ( init, start, stop, etc) operation, boolean If false, exceptions will be ignored failFirst)Implements org. Invoke a operation on a list of mbeans. |
| public List | |
| public void | loadDescriptors(String
The package name packageName, ClassLoader The class loader classLoader)Lookup the component descriptor in the package and in the parent packages. |
| public void | postDeregister()
Implements javax. Allows the MBean to perform any operations needed after having been unregistered in the MBean server. |
| public void | postRegister(Boolean
Indicates whether or not the MBean has
been successfully registered in the MBean server. The value
false means that the registration phase has failed. registrationDone)Implements javax. Allows the MBean to perform any operations needed after having been registered in the MBean server or after the registration has failed. |
| public void | preDeregister()
Implements javax. Allows the MBean to perform any operations it needs before being unregistered by the MBean server. |
| public ObjectName | preRegister(MBeanServer
The MBean Server in which the MBean will be registered. server, ObjectName The object name of the MBean. This name is null if
the name parameter to one of the name)createMBean or
registerMBean methods in the MBeanServer
interface is null. In that case, this method must return a
non-null ObjectName for the new MBean.Implements javax. Allows the MBean to perform any operations it needs before being registered in the MBean Server. |
| public void | registerComponent(Object
Object to be registered bean, String Name used for registration oname, String 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. type)Implements org. Register a bean by creating a modeler mbean and adding it to the MBeanServer. |
| public void | registerComponent(Object
The bean bean, ObjectName The object name oname, String The registry type type)Register a component |
| public void | stop()
Implements org. Lifecycle method - clean up the registry metadata. |
| public void | unregisterComponent(String
Name used for unregistration oname)Implements org. Unregister a component. |
| public void |
| descriptors | back to summary |
|---|---|
| private Map<String, ManagedBean> descriptors The set of ManagedBean instances for the beans this registry knows about, keyed by name. | |
| descriptorsByClass | back to summary |
|---|---|
| private Map<String, ManagedBean> descriptorsByClass List of managed beans, keyed by class name | |
| guard | back to summary |
|---|---|
| private Object guard | |
| idDomains | back to summary |
|---|---|
| private final Hashtable<String, Hashtable<String, Integer>> idDomains | |
| ids | back to summary |
|---|---|
| private final Hashtable<String, int[]> ids | |
| log | back to summary |
|---|---|
| private static final Log log The Log instance to which we will write our log messages. | |
| registry | back to summary |
|---|---|
| private static Registry registry The registry instance created by our factory method the first time it is called. | |
| searchedPaths | back to summary |
|---|---|
| private Map<String, URL> searchedPaths | |
| server | back to summary |
|---|---|
| private volatile MBeanServer server The | |
| serverLock | back to summary |
|---|---|
| private final Object serverLock | |
| sm | back to summary |
|---|---|
| private static final StringManager sm | |
| Registry | back to summary |
|---|---|
| protected Registry() | |
| addManagedBean | back to summary |
|---|---|
| public void addManagedBean(ManagedBean bean) Add a new bean metadata to the set of beans known to this registry. This is used by internal components.
| |
| convertValue | back to summary |
|---|---|
| public Object convertValue(String type, String value) Convert a string to object, based on type. Used by several components. We could provide some pluggability. It is here to keep things consistent and avoid duplication in other tasks | |
| disableRegistry | back to summary |
|---|---|
| public static synchronized void disableRegistry() | |
| findDescriptor | back to summary |
|---|---|
| private void findDescriptor(Class<?> beanClass, String type) Lookup the component descriptor in the package and in the parent packages. | |
| findManagedBean | back to summary |
|---|---|
| public ManagedBean findManagedBean(String name) Find and return the managed bean definition for the specified bean name,
if any; otherwise return
| |
| findManagedBean | back to summary |
|---|---|
| public ManagedBean findManagedBean(Object bean, Class<?> beanClass, String type) throws Exception Find or load metadata.
| |
| getId | back to summary |
|---|---|
| public synchronized int getId(String domain, String name) Implements org. Return an int ID for faster access. Will be used for notifications and for other operations we want to optimize. | |
| getMBeanServer | back to summary |
|---|---|
| public MBeanServer getMBeanServer() Factory method to create (if necessary) and return our
| |
| getMethodInfo | back to summary |
|---|---|
| public MBeanOperationInfo getMethodInfo(ObjectName oname, String opName) Find the operation info for a method
| |
| getMethodInfo | back to summary |
|---|---|
| public MBeanOperationInfo getMethodInfo(ObjectName oname, String opName, int argCount) throws InstanceNotFoundException Find the operation info for a method.
| |
| getModelerSource | back to summary |
|---|---|
| private ModelerSource getModelerSource(String type) throws Exception | |
| getRegistry | back to summary |
|---|---|
| public static synchronized Registry getRegistry(Object key, Object guard) Factory method to create (if necessary) and return our
| |
| getType | back to summary |
|---|---|
| public String getType(ObjectName oname, String attName) Get the type of an attribute of the object, from the metadata.
| |
| invoke | back to summary |
|---|---|
| public void invoke(List<ObjectName> mbeans, String operation, boolean failFirst) throws Exception Implements org. Invoke a operation on a list of mbeans. Can be used to implement lifecycle operations.
| |
| load | back to summary |
|---|---|
| public List Load descriptors. | |
| loadDescriptors | back to summary |
|---|---|
| public void loadDescriptors(String packageName, ClassLoader classLoader) Lookup the component descriptor in the package and in the parent packages.
| |
| postDeregister | back to summary |
|---|---|
| public void postDeregister() Implements javax. Doc from javax. Allows the MBean to perform any operations needed after having been unregistered in the MBean server. If the implementation of this method throws a This might be confusing for the code calling
| |
| postRegister | back to summary |
|---|---|
| public void postRegister(Boolean registrationDone) Implements javax. Doc from javax. Allows the MBean to perform any operations needed after having been registered in the MBean server or after the registration has failed. If the implementation of this method throws a This might be confusing for the code calling | |
| preDeregister | back to summary |
|---|---|
| public void preDeregister() throws Exception Implements javax. Doc from javax. Allows the MBean to perform any operations it needs before being unregistered by the MBean server.
| |
| preRegister | back to summary |
|---|---|
| public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception Implements javax. Doc from javax. Allows the MBean to perform any operations it needs before being registered in the MBean Server. If the name of the MBean is not specified, the MBean can provide a name for its registration. If any exception is raised, the MBean will not be registered in the MBean Server.
| |
| registerComponent | back to summary |
|---|---|
| public void registerComponent(Object bean, String oname, String type) throws Exception Implements org. Register 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.
| |
| registerComponent | back to summary |
|---|---|
| public void registerComponent(Object bean, ObjectName oname, String type) throws Exception Register a component
| |
| stop | back to summary |
|---|---|
| public void stop() Implements org. Lifecycle method - clean up the registry metadata. Called from resetMetadata().
| |
| unregisterComponent | back to summary |
|---|---|
| public void unregisterComponent(String oname) Implements org. Unregister a component. We'll first check if it is registered, and mask all errors. This is mostly a helper. | |
| unregisterComponent | back to summary |
|---|---|
| public void unregisterComponent(ObjectName oname) Unregister a component. This is just a helper that avoids exceptions by checking if the mbean is already registered
| |