Class AMXConfigImpl
- java.lang.Object
-
- org.glassfish.admin.amx.impl.mbean.MBeanImplBase
-
- org.glassfish.admin.amx.impl.mbean.AMXImplBase
-
- org.glassfish.admin.amx.impl.config.AMXConfigImpl
-
- All Implemented Interfaces:
DynamicMBean,MBeanRegistration,NotificationBroadcaster,NotificationEmitter,AMX_SPI,NotificationSender
@Taxonomy(stability=NOT_AN_INTERFACE) public class AMXConfigImpl extends AMXImplBase
Base class from which all AMX Config MBeans should derive (but not "must").
-
-
Field Summary
-
Fields inherited from class org.glassfish.admin.amx.impl.mbean.AMXImplBase
EMPTY_OBJECT_NAMES, GET, GET_PREFIX, mMBeanInfo, OBJECT_NAME_SUFFIX, SET
-
Fields inherited from class org.glassfish.admin.amx.impl.mbean.MBeanImplBase
EMPTY_STRING_ARRAY, mSelfObjectName, mServer
-
-
Constructor Summary
Constructors Constructor Description AMXConfigImpl(ObjectName parentObjectName, ConfigBean configBean)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String[]attributeNameToType(String attributeName)Supply possible types to be tried based on attribute namestatic StringconvertAttributeName(String s)ObjectNamecreateChild(String type, Map<String,Object> params)ObjectName[]createChildren(Map<String,Map<String,Object>[]> childrenMaps, Map<String,Object> attrs)protected ObjectgetAttributeFromConfigBean(String amxName)Get an Attribute.protected ObjectgetAttributeManually(String name)Subclasses should override this to handle getAttribute( attrName ).protected ConfigModel.PropertygetConfigModel_Property(String xmlName)Map<String,String>getDefaultValues(boolean useAMXAttributeNames)Map<String,String>getDefaultValues(String type, boolean useAMXAttributeNames)StringgetName()The actual name could be different than the 'name' property in the ObjectName if it contains characters that are illegal for an ObjectName.protected ObjectinvokeManually(String operationName, Object[] args, String[] types)Automatically figure out getFactory(), create Config(), remove Config(). static List<String>listOfString()exists so we can get the parameterized return typeObjectNameremoveChild(String type)ObjectNameremoveChild(String type, String name)StringresolveAttribute(String attrName)AttributeListresolveAttributes(String[] attrNames)StringresolveAttributeValue(String varString)Resolve a template String.BooleanresolveBoolean(String attrName)IntegerresolveInteger(String attrName)LongresolveLong(String attrName)voidsendConfigCreatedNotification(ObjectName configObjectName)voidsendConfigRemovedNotification(ObjectName configObjectName)protected voidsetAttributeManually(Attribute attr)Subclasses should override this to handle setAttribute( attr ).AttributeListsetAttributes(AttributeList attrs)Note that the default implementation sets attributes one at a time, but that MBeans with transactional requirements (eg configuration) may wish to set them as a group.AttributeListsetAttributesInConfigBean(AttributeList attrsIn)AttributeListsetAttributesTransactionally(AttributeList attrs)-
Methods inherited from class org.glassfish.admin.amx.impl.mbean.AMXImplBase
attributeTypeMatches, child, child, child, findGetter, findMethod, findSetter, getAncestorByType, getAttribute, getAttributeByMethod, getAttributeInfo, getAttributeInfos, getAttributeInternal, getAttributeNames, getAttributeNoThrow, getAttributes, getAttributeType, getChildren, getChildren, getChildren, getChildren, getChildrenMap, getDomainRoot, getDomainRootProxy, getLogger, getMBeanInfo, getMBeanTracker, getNotificationInfo, getObjectNameAttribute, getObjectNames, getObjectNamesForAttribute, getParent, getParentProxy, getProxy, getProxyFactory, getSelf, getSelf, getterNameMatches, handleException, handleGetAttributeException, handleInvokeThrowable, impossible, invoke, isReadOnlyAttribute, isUtilityMBean, java, operationNameMatches, postRegisterHook, postRegisterModifyMBeanInfo, preDeregisterHook, preRegister, preRegisterDone, preRegisterHook, preRegisterModifyName, registerChild, registerChildren, sendAttributeChangeNotification, setAttribute, setAttributeByMethod, setAttributeInternal, shouldEmitNotifications, stringify, supportsChildren, toString, unimplementedAttribute, unimplementedOperation, unregisterChildren
-
Methods inherited from class org.glassfish.admin.amx.impl.mbean.MBeanImplBase
_getMBeanLogLevel, addNotificationListener, addNotificationListener, createNotificationBuilder, debug, debug, debugMethod, debugMethod, enableAMXDebug, getAMXDebug, getDebugID, getDebugOutput, getJMXDomain, getListenerCount, getMBeanLogger, getMBeanLoggerName, getMBeanLogLevel, getMBeanLogLevelInt, getMBeanServer, getNotificationBuilder, getNotificationEmitter, getNotificationTypeListenerCount, getObjectName, logFine, logFiner, logFinest, logInfo, logSevere, logWarning, postDeregister, postDeregisterHook, postRegister, preDeregister, quote, removeNotificationListener, removeNotificationListener, sendNotification, sendNotification, sendNotification, sendNotification, setAMXDebug, setMBeanLogLevel, shouldOmitObjectNameForDebug, toString, trace
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface javax.management.NotificationBroadcaster
addNotificationListener, removeNotificationListener
-
Methods inherited from interface javax.management.NotificationEmitter
removeNotificationListener
-
-
-
-
Constructor Detail
-
AMXConfigImpl
public AMXConfigImpl(ObjectName parentObjectName, ConfigBean configBean)
-
-
Method Detail
-
setAttributeManually
protected void setAttributeManually(Attribute attr) throws AttributeNotFoundException, InvalidAttributeValueException
Description copied from class:AMXImplBaseSubclasses should override this to handle setAttribute( attr ). It will be called if no appropriate setter is found.- Overrides:
setAttributeManuallyin classAMXImplBase- Throws:
AttributeNotFoundExceptionInvalidAttributeValueException
-
setAttributes
public AttributeList setAttributes(AttributeList attrs)
Note that the default implementation sets attributes one at a time, but that MBeans with transactional requirements (eg configuration) may wish to set them as a group.- Specified by:
setAttributesin interfaceDynamicMBean- Overrides:
setAttributesin classAMXImplBase
-
setAttributesTransactionally
public AttributeList setAttributesTransactionally(AttributeList attrs) throws Exception
- Throws:
Exception
-
getName
public String getName()
The actual name could be different than the 'name' property in the ObjectName if it contains characters that are illegal for an ObjectName. Also, there can be a Name attribute which is not a key value.- Specified by:
getNamein interfaceAMX_SPI- Overrides:
getNamein classAMXImplBase
-
resolveAttributeValue
public String resolveAttributeValue(String varString)
Resolve a template String. SeeAttributeResolverfor details.
-
resolveAttributes
public AttributeList resolveAttributes(String[] attrNames)
-
createChildren
public ObjectName[] createChildren(Map<String,Map<String,Object>[]> childrenMaps, Map<String,Object> attrs)
-
createChild
public ObjectName createChild(String type, Map<String,Object> params)
-
listOfString
public static List<String> listOfString()
exists so we can get the parameterized return type
-
removeChild
public ObjectName removeChild(String type)
-
removeChild
public ObjectName removeChild(String type, String name)
-
invokeManually
protected Object invokeManually(String operationName, Object[] args, String[] types) throws MBeanException, ReflectionException, NoSuchMethodException, AttributeNotFoundException
Automatically figure out getFactory(), create Config(), remove Config(). - Overrides:
invokeManuallyin classAMXImplBase- Throws:
MBeanExceptionReflectionExceptionNoSuchMethodExceptionAttributeNotFoundException
-
sendConfigCreatedNotification
public void sendConfigCreatedNotification(ObjectName configObjectName)
-
sendConfigRemovedNotification
public void sendConfigRemovedNotification(ObjectName configObjectName)
-
getDefaultValues
public final Map<String,String> getDefaultValues(String type, boolean useAMXAttributeNames)
-
attributeNameToType
protected String[] attributeNameToType(String attributeName)
Description copied from class:AMXImplBaseSupply possible types to be tried based on attribute name- Overrides:
attributeNameToTypein classAMXImplBase
-
getAttributeManually
protected Object getAttributeManually(String name) throws AttributeNotFoundException, ReflectionException, MBeanException
Description copied from class:AMXImplBaseSubclasses should override this to handle getAttribute( attrName ). It will be called if no appropriate getter is found.- Overrides:
getAttributeManuallyin classAMXImplBase- Throws:
AttributeNotFoundExceptionReflectionExceptionMBeanException
-
getAttributeFromConfigBean
protected final Object getAttributeFromConfigBean(String amxName)
Get an Attribute. This is a bit tricky, because the target can be an XML attribute, an XML string element, or an XML list of elements.
-
getConfigModel_Property
protected ConfigModel.Property getConfigModel_Property(String xmlName)
-
setAttributesInConfigBean
public AttributeList setAttributesInConfigBean(AttributeList attrsIn) throws TransactionFailure
- Throws:
TransactionFailure
-
-