public class RuntimeConfiguration extends RequiredModelMBean implements NotificationEmitter, Constants
| Modifier and Type | Field and Description |
|---|---|
protected ConfigurationCategory |
mCategory |
protected List<NotificationListenerInfo> |
mListeners |
protected PlatformContext |
mPlatformCtx
Context information
|
protected String |
mTarget |
protected static MessageBuilder |
sMsgBuilder
Message Builder
|
protected static MBeanNotificationInfo[] |
sNotificationInfo |
protected static HashMap<String,String> |
sTypeMap
Primitive types to their class object mapping
|
ADMIN_RUNNING_FILE, ADMIN_STOPPED_FILE, CONFIG_NAME_KEY, LOG_LEVEL_DEFAULT, TMP_FOLDER| Constructor and Description |
|---|
RuntimeConfiguration(ModelMBeanInfo mbeanInfo,
ConfigurationCategory category,
String target)
Creates a new RuntimeConfiguration MBean.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addNotificationListener(NotificationListener listener,
NotificationFilter filter,
Object handback)
Adds a listener to this MBean.
|
protected void |
checkIsValidAttribute(Attribute attribute)
This operations checks :
(a) If an attribute with the same identification exists in the current configuration
(b) If the type of the value passed matches the expected value.
|
static ModelMBeanInfo |
createMBeanInfo(ModelMBeanAttributeInfo[] attributeInfos) |
protected void |
deleteOverride(String attrName)
This operation is called when a configuration attribute is to use the
global configuration, the overriden attribute needs to be deleted from the
target configiration
|
Object |
getAttribute(String attribute)
Obtain the value of a specific attribute of the Dynamic MBean.
|
protected ModelMBeanAttributeInfo |
getAttributeInfo(String attribute) |
AttributeList |
getAttributes(String[] attributeNames)
Get the values of several attributes of the Dynamic MBean.
|
protected static EnvironmentContext |
getEnvironmentContext() |
protected List<NotificationListenerInfo> |
getListeners() |
protected static Logger |
getLogger() |
protected ManagementContext |
getManagementContext() |
protected String |
getMatchingAttribute(String name) |
MBeanNotificationInfo[] |
getNotificationInfo() |
protected PlatformContext |
getPlatformContext() |
protected Registry |
getRegistry()
Get a handle to the registry
|
protected static StringTranslator |
getTranslator() |
Object |
invoke(String actionName,
Object[] params,
String[] signature)
Allows an action to be invoked on the Dynamic MBean.
|
protected boolean |
isPassword(String attrName) |
protected void |
notifyListenersOfAttributeChange(Attribute attribute)
Send the notification to all interested listeners
|
protected void |
persist()
Persist the factory defaults to the registry for the global configuration.
|
protected void |
persistDomainConfig()
Persist the domain configuration if required.
|
void |
removeNotificationListener(NotificationListener listener) |
void |
removeNotificationListener(NotificationListener listener,
NotificationFilter filter,
Object handback)
Remove a specific listener from the set.
|
AttributeList |
setAttributes(AttributeList attributes)
Sets the values of several attributes of the Dynamic MBean.
|
addAttributeChangeNotificationListener, getClassLoaderRepository, getMBeanInfo, load, postDeregister, postRegister, preDeregister, preRegister, removeAttributeChangeNotificationListener, sendAttributeChangeNotification, sendAttributeChangeNotification, sendNotification, sendNotification, setAttribute, setManagedResource, setModelMBeanInfo, storeprotected static MessageBuilder sMsgBuilder
protected PlatformContext mPlatformCtx
protected ConfigurationCategory mCategory
protected String mTarget
protected List<NotificationListenerInfo> mListeners
protected static MBeanNotificationInfo[] sNotificationInfo
public RuntimeConfiguration(ModelMBeanInfo mbeanInfo, ConfigurationCategory category, String target) throws Exception
mbeanInfo - metadata returned by the 'real' MBean in the
target instance.mbeanName - name of this MBean registered in the DAS.Exceptionpublic Object getAttribute(String attribute) throws AttributeNotFoundException, MBeanException, ReflectionException
getAttribute in interface DynamicMBeangetAttribute in class RequiredModelMBeanattribute - The name of the attribute to be retrievedAttributeNotFoundExceptionMBeanException - Wraps a java.lang.Exception
thrown by the MBean's getter.ReflectionException - Wraps a java.lang.Exception
thrown while trying to invoke the getter.RequiredModelMBean.setAttribute(javax.management.Attribute)public AttributeList setAttributes(AttributeList attributes)
setAttributes in interface DynamicMBeansetAttributes in class RequiredModelMBeanattributes - A list of attributes: The identification of the
attributes to be set and the values they are to be set to.getAttributes(java.lang.String[])public AttributeList getAttributes(String[] attributeNames)
getAttributes in interface DynamicMBeangetAttributes in class RequiredModelMBeanattributeNames - A list of the attributes to be retrieved.setAttributes(javax.management.AttributeList)public Object invoke(String actionName, Object[] params, String[] signature) throws MBeanException, ReflectionException
invoke in interface DynamicMBeaninvoke in class RequiredModelMBeanactionName - The name of the action to be invoked.params - An array containing the parameters to be set when the
action is invoked.signature - An array containing the signature of the action. The
class objects will be loaded through the same class loader as the
one used for loading the MBean on which the action is invoked.MBeanException - Wraps a java.lang.Exception thrown
by the MBean's invoked method.ReflectionException - Wraps a java.lang.Exception
thrown while trying to invoke the methodpublic static ModelMBeanInfo createMBeanInfo(ModelMBeanAttributeInfo[] attributeInfos) throws Exception
Exceptionprotected void checkIsValidAttribute(Attribute attribute) throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException
attribute - - the attribute to be validatedAttributeNotFoundException - if attribute with the same identification
is not present in the configuration set.InvalidAttributeValueException - if the type of the attribute is different
from what is expected.MBeanExceptionprotected String getMatchingAttribute(String name)
protected static StringTranslator getTranslator()
protected static Logger getLogger()
protected ManagementContext getManagementContext()
protected PlatformContext getPlatformContext()
protected static EnvironmentContext getEnvironmentContext()
protected void persist()
throws Exception
Exceptionprotected void deleteOverride(String attrName) throws Exception
attrName - - attribute to be deletedExceptionprotected ModelMBeanAttributeInfo getAttributeInfo(String attribute) throws MBeanException
attribName - - identification of the attributeMBeanExceptionprotected Registry getRegistry()
protected void persistDomainConfig()
throws MBeanException
MBeanExceptionprotected boolean isPassword(String attrName)
protected List<NotificationListenerInfo> getListeners()
protected void notifyListenersOfAttributeChange(Attribute attribute) throws Exception
attribute - the attribute being updated.Exceptionpublic void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws IllegalArgumentException
addNotificationListener in interface NotificationBroadcasteraddNotificationListener in class RequiredModelMBeanlistener - The listener object which will handle the notifications
emitted by the broadcaster.filter - The filter object. If filter is null, no filtering will be
performed before handling notifications.handback - An opaque object to be sent back to the listener when a
notification is emitted. This object cannot be used by the
Notification broadcaster object. It should be resent unchanged
with the notification to the listener.IllegalArgumentException - - Listener parameter is null.public void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException
removeNotificationListener in interface NotificationBroadcasterremoveNotificationListener in class RequiredModelMBeanListenerNotFoundExceptionpublic void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException
removeNotificationListener in interface NotificationEmitterremoveNotificationListener in class RequiredModelMBeanListenerNotFoundExceptionpublic MBeanNotificationInfo[] getNotificationInfo()
getNotificationInfo in interface NotificationBroadcastergetNotificationInfo in class RequiredModelMBeanCopyright © 2011-2016 OpenESB Community. All Rights Reserved.