org.glassfish.admin.amx.impl.config
Class AMXConfigImpl

java.lang.Object
  extended by org.glassfish.admin.amx.impl.mbean.MBeanImplBase
      extended by org.glassfish.admin.amx.impl.mbean.AMXImplBase
          extended by org.glassfish.admin.amx.impl.config.AMXConfigImpl
All Implemented Interfaces:
javax.management.DynamicMBean, javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.management.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
AMXConfigImpl(javax.management.ObjectName parentObjectName, java.lang.Class<? extends AMXProxy> theInterface, org.jvnet.hk2.config.ConfigBean configBean)
           
AMXConfigImpl(javax.management.ObjectName parentObjectName, org.jvnet.hk2.config.ConfigBean configBean)
           
 
Method Summary
protected  java.lang.String[] attributeNameToType(java.lang.String attributeName)
           
static java.lang.String convertAttributeName(java.lang.String s)
           
 javax.management.ObjectName createChild(java.lang.String type, java.util.Map<java.lang.String,java.lang.Object> params)
           
 javax.management.ObjectName[] createChildren(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>[]> childrenMaps, java.util.Map<java.lang.String,java.lang.Object> attrs)
           
protected  java.lang.Object getAttributeFromConfigBean(java.lang.String amxName)
          Get an Attribute.
protected  java.lang.Object getAttributeManually(java.lang.String name)
           
protected  org.jvnet.hk2.config.ConfigModel.Property getConfigModel_Property(java.lang.String xmlName)
           
 java.util.Map<java.lang.String,java.lang.String> getDefaultValues(boolean useAMXAttributeNames)
           
 java.util.Map<java.lang.String,java.lang.String> getDefaultValues(java.lang.String type, boolean useAMXAttributeNames)
           
 java.lang.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.
protected  java.lang.Object invokeManually(java.lang.String operationName, java.lang.Object[] args, java.lang.String[] types)
          Automatically figure out getFactory(), createConfig(), removeConfig().
static java.util.List<java.lang.String> listOfString()
          exists so we can get the parameterized return type
 javax.management.ObjectName removeChild(java.lang.String type)
           
 javax.management.ObjectName removeChild(java.lang.String type, java.lang.String name)
           
 java.lang.String resolveAttribute(java.lang.String attrName)
           
 javax.management.AttributeList resolveAttributes(java.lang.String[] attrNames)
           
 java.lang.String resolveAttributeValue(java.lang.String varString)
          Resolve a template String.
 java.lang.Boolean resolveBoolean(java.lang.String attrName)
           
 java.lang.Integer resolveInteger(java.lang.String attrName)
           
 java.lang.Long resolveLong(java.lang.String attrName)
           
 void sendConfigCreatedNotification(javax.management.ObjectName configObjectName)
           
 void sendConfigRemovedNotification(javax.management.ObjectName configObjectName)
           
protected  void setAttributeManually(javax.management.Attribute attr)
           
 javax.management.AttributeList setAttributes(javax.management.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.
 javax.management.AttributeList setAttributesInConfigBean(javax.management.AttributeList attrsIn)
           
 javax.management.AttributeList setAttributesTransactionally(javax.management.AttributeList attrs)
           
 
Methods inherited from class org.glassfish.admin.amx.impl.mbean.AMXImplBase
attributeTypeMatches, cdebug, 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, sleepMillis, 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.MBeanRegistration
postDeregister, postRegister, preDeregister
 
Methods inherited from interface javax.management.NotificationEmitter
removeNotificationListener
 
Methods inherited from interface javax.management.NotificationBroadcaster
addNotificationListener, removeNotificationListener
 

Constructor Detail

AMXConfigImpl

public AMXConfigImpl(javax.management.ObjectName parentObjectName,
                     org.jvnet.hk2.config.ConfigBean configBean)

AMXConfigImpl

public AMXConfigImpl(javax.management.ObjectName parentObjectName,
                     java.lang.Class<? extends AMXProxy> theInterface,
                     org.jvnet.hk2.config.ConfigBean configBean)
Method Detail

setAttributeManually

protected void setAttributeManually(javax.management.Attribute attr)
                             throws javax.management.AttributeNotFoundException,
                                    javax.management.InvalidAttributeValueException
Overrides:
setAttributeManually in class AMXImplBase
Throws:
javax.management.AttributeNotFoundException
javax.management.InvalidAttributeValueException

setAttributes

public javax.management.AttributeList setAttributes(javax.management.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:
setAttributes in interface javax.management.DynamicMBean
Overrides:
setAttributes in class AMXImplBase

setAttributesTransactionally

public javax.management.AttributeList setAttributesTransactionally(javax.management.AttributeList attrs)
                                                            throws java.lang.Exception
Throws:
java.lang.Exception

getName

public java.lang.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:
getName in interface AMX_SPI
Overrides:
getName in class AMXImplBase

resolveAttributeValue

public java.lang.String resolveAttributeValue(java.lang.String varString)
Resolve a template String. See AttributeResolver for details.


resolveAttribute

public java.lang.String resolveAttribute(java.lang.String attrName)

resolveBoolean

public java.lang.Boolean resolveBoolean(java.lang.String attrName)

resolveInteger

public java.lang.Integer resolveInteger(java.lang.String attrName)

resolveLong

public java.lang.Long resolveLong(java.lang.String attrName)

resolveAttributes

public javax.management.AttributeList resolveAttributes(java.lang.String[] attrNames)

createChildren

public javax.management.ObjectName[] createChildren(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>[]> childrenMaps,
                                                    java.util.Map<java.lang.String,java.lang.Object> attrs)

createChild

public javax.management.ObjectName createChild(java.lang.String type,
                                               java.util.Map<java.lang.String,java.lang.Object> params)

listOfString

public static java.util.List<java.lang.String> listOfString()
exists so we can get the parameterized return type


convertAttributeName

public static java.lang.String convertAttributeName(java.lang.String s)

removeChild

public javax.management.ObjectName removeChild(java.lang.String type)

removeChild

public javax.management.ObjectName removeChild(java.lang.String type,
                                               java.lang.String name)

invokeManually

protected java.lang.Object invokeManually(java.lang.String operationName,
                                          java.lang.Object[] args,
                                          java.lang.String[] types)
                                   throws javax.management.MBeanException,
                                          javax.management.ReflectionException,
                                          java.lang.NoSuchMethodException,
                                          javax.management.AttributeNotFoundException
Automatically figure out getFactory(), createConfig(), removeConfig().

Overrides:
invokeManually in class AMXImplBase
Throws:
javax.management.MBeanException
javax.management.ReflectionException
java.lang.NoSuchMethodException
javax.management.AttributeNotFoundException

sendConfigCreatedNotification

public void sendConfigCreatedNotification(javax.management.ObjectName configObjectName)

sendConfigRemovedNotification

public void sendConfigRemovedNotification(javax.management.ObjectName configObjectName)

getDefaultValues

public final java.util.Map<java.lang.String,java.lang.String> getDefaultValues(java.lang.String type,
                                                                               boolean useAMXAttributeNames)

getDefaultValues

public final java.util.Map<java.lang.String,java.lang.String> getDefaultValues(boolean useAMXAttributeNames)

attributeNameToType

protected java.lang.String[] attributeNameToType(java.lang.String attributeName)
Overrides:
attributeNameToType in class AMXImplBase

getAttributeManually

protected java.lang.Object getAttributeManually(java.lang.String name)
                                         throws javax.management.AttributeNotFoundException,
                                                javax.management.ReflectionException,
                                                javax.management.MBeanException
Overrides:
getAttributeManually in class AMXImplBase
Throws:
javax.management.AttributeNotFoundException
javax.management.ReflectionException
javax.management.MBeanException

getAttributeFromConfigBean

protected final java.lang.Object getAttributeFromConfigBean(java.lang.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 org.jvnet.hk2.config.ConfigModel.Property getConfigModel_Property(java.lang.String xmlName)

setAttributesInConfigBean

public javax.management.AttributeList setAttributesInConfigBean(javax.management.AttributeList attrsIn)
                                                         throws org.jvnet.hk2.config.TransactionFailure
Throws:
org.jvnet.hk2.config.TransactionFailure


Copyright © 2012 GlassFish Community. All Rights Reserved.