| java.lang.Object org.apache.commons.modeler.BaseModelMBean org.apache.commons.modeler.JndiJmx
JndiJmx | public class JndiJmx extends BaseModelMBean implements NotificationListener(Code) | | Link between JNDI and JMX. JNDI can be used for persistence ( it is
an API for storing hierarchical data and a perfect fit for that ), as
well as an alternate view of the MBean registry.
If this component is enabled, all MBeans will be registered in JNDI, and
all attributes that are set via JMX can be stored in a DirContext.
This acts as a "recorder" for creation of mbeans and attribute changes
done via JMX.
XXX How can we control ( filter ) which mbeans will be registere ? Or
attributes ?
XXX How can we get the beans and attributes loaded before jndijmx ?
The intended use:
- do whatever you want to start the application
- load JndiJmx as an mbean
- make changes via JMX. All changes are recorded
- you can use JndiJmx to save the changes in a Jndi context.
- you can use JndiJmx to load changes from a JndiContext and replay them.
The main benefit is that only changed attributes are saved, and the Jndi
layer can preserve most of the original structure of the config file. The
alternative is to override the config files with config info extracted
from the live objects - but it's very hard to save only what was actually
changed and preserve structure and comments.
author: Costin Manolache |
Constructor Summary | |
public | JndiJmx() Protected constructor to require use of the factory create method. |
JndiJmx | public JndiJmx() throws MBeanException(Code) | | Protected constructor to require use of the factory create method.
|
setComponentContext | public void setComponentContext(Context ctx)(Code) | | If a JNDI context is set, all components
will be registered in the context.
Parameters: ctx - |
setConfigContext | public void setConfigContext(Context ctx)(Code) | | JNDI context where attributes will be stored for persistence
|
setDescriptorContext | public void setDescriptorContext(Context ctx)(Code) | | JNDI context for component descriptors ( metadata ).
Parameters: ctx - |
Methods inherited from org.apache.commons.modeler.BaseModelMBean | public void addAttributeChangeNotificationListener(NotificationListener listener, String name, Object handback) throws IllegalArgumentException(Code)(Java Doc) public void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws IllegalArgumentException(Code)(Java Doc) protected ModelMBeanInfo createDefaultModelMBeanInfo()(Code)(Java Doc) protected void createResource()(Code)(Java Doc) public Object getAttribute(String name) throws AttributeNotFoundException, MBeanException, ReflectionException(Code)(Java Doc) public AttributeList getAttributes(String names)(Code)(Java Doc) public String getClassName()(Code)(Java Doc) public ObjectName getJmxName()(Code)(Java Doc) public MBeanInfo getMBeanInfo()(Code)(Java Doc) public Object getManagedResource() throws InstanceNotFoundException, InvalidTargetObjectTypeException, MBeanException, RuntimeOperationsException(Code)(Java Doc) public String getModelerType()(Code)(Java Doc) public MBeanNotificationInfo[] getNotificationInfo()(Code)(Java Doc) public String getObjectName()(Code)(Java Doc) public Registry getRegistry()(Code)(Java Doc) protected void initModelInfo(String type)(Code)(Java Doc) public Object invoke(String name, Object params, String signature) throws MBeanException, ReflectionException(Code)(Java Doc) protected boolean isModelMBeanInfoValid(ModelMBeanInfo info)(Code)(Java Doc) public void load() throws InstanceNotFoundException, MBeanException, RuntimeOperationsException(Code)(Java Doc) public void postDeregister()(Code)(Java Doc) public void postRegister(Boolean registrationDone)(Code)(Java Doc) public void preDeregister() throws Exception(Code)(Java Doc) public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception(Code)(Java Doc) public void removeAttributeChangeNotificationListener(NotificationListener listener, String name) throws ListenerNotFoundException(Code)(Java Doc) public void removeAttributeChangeNotificationListener(NotificationListener listener, String attributeName, Object handback) throws ListenerNotFoundException(Code)(Java Doc) public void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException(Code)(Java Doc) public void removeNotificationListener(NotificationListener listener, Object handback) throws ListenerNotFoundException(Code)(Java Doc) public void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException(Code)(Java Doc) public void sendAttributeChangeNotification(AttributeChangeNotification notification) throws MBeanException, RuntimeOperationsException(Code)(Java Doc) public void sendAttributeChangeNotification(Attribute oldValue, Attribute newValue) throws MBeanException, RuntimeOperationsException(Code)(Java Doc) public void sendNotification(Notification notification) throws MBeanException, RuntimeOperationsException(Code)(Java Doc) public void sendNotification(String message) throws MBeanException, RuntimeOperationsException(Code)(Java Doc) public void setAttribute(Attribute attribute) throws AttributeNotFoundException, MBeanException, ReflectionException(Code)(Java Doc) public AttributeList setAttributes(AttributeList attributes)(Code)(Java Doc) public void setManagedResource(Object resource, String type) throws InstanceNotFoundException, InvalidTargetObjectTypeException, MBeanException, RuntimeOperationsException(Code)(Java Doc) public void setModelMBeanInfo(ModelMBeanInfo info) throws MBeanException, RuntimeOperationsException(Code)(Java Doc) public void setModeledType(String type)(Code)(Java Doc) public void setRegistry(Registry registry)(Code)(Java Doc) public void store() throws InstanceNotFoundException, MBeanException, RuntimeOperationsException(Code)(Java Doc) public String toString()(Code)(Java Doc)
|
|
|