Class ResourceDMBean

  • All Implemented Interfaces:
    javax.management.DynamicMBean, javax.management.MBeanRegistration

    public final class ResourceDMBean
    extends java.lang.Object
    implements javax.management.DynamicMBean, javax.management.MBeanRegistration
    This class was copied from JGroups and adapted.

    The original JGroup's ResourceDMBean logic has been modified so that invoke() method checks whether the operation called has been exposed as a ManagedOperation, otherwise the call fails. JGroups deviated from this logic on purpose because they liked the fact that you could expose all class methods by simply annotating class with MBean annotation.

    Since:
    4.0
    Author:
    Mircea.Markus@jboss.com, Galder ZamarreƱo
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      java.lang.Object getAttribute​(java.lang.String name)  
      javax.management.AttributeList getAttributes​(java.lang.String[] names)  
      java.util.function.Supplier<?> getAttributeValueSupplier​(java.lang.String attributeName)  
      javax.management.MBeanInfo getMBeanInfo()  
      javax.management.ObjectName getObjectName()
      The ObjectName.
      int hashCode()  
      java.lang.Object invoke​(java.lang.String name, java.lang.Object[] args, java.lang.String[] sig)  
      void postDeregister()  
      void postRegister​(java.lang.Boolean registrationDone)  
      void preDeregister()  
      javax.management.ObjectName preRegister​(javax.management.MBeanServer server, javax.management.ObjectName name)  
      void setAttribute​(javax.management.Attribute attribute)  
      javax.management.AttributeList setAttributes​(javax.management.AttributeList list)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • getObjectName

        public javax.management.ObjectName getObjectName()
        The ObjectName. Only available if the MBean was registered.
      • getMBeanInfo

        public javax.management.MBeanInfo getMBeanInfo()
        Specified by:
        getMBeanInfo in interface javax.management.DynamicMBean
      • getAttribute

        public java.lang.Object getAttribute​(java.lang.String name)
                                      throws javax.management.AttributeNotFoundException
        Specified by:
        getAttribute in interface javax.management.DynamicMBean
        Throws:
        javax.management.AttributeNotFoundException
      • setAttribute

        public void setAttribute​(javax.management.Attribute attribute)
                          throws javax.management.AttributeNotFoundException,
                                 javax.management.MBeanException
        Specified by:
        setAttribute in interface javax.management.DynamicMBean
        Throws:
        javax.management.AttributeNotFoundException
        javax.management.MBeanException
      • getAttributes

        public javax.management.AttributeList getAttributes​(java.lang.String[] names)
        Specified by:
        getAttributes in interface javax.management.DynamicMBean
      • getAttributeValueSupplier

        public java.util.function.Supplier<?> getAttributeValueSupplier​(java.lang.String attributeName)
                                                                 throws javax.management.AttributeNotFoundException
        Throws:
        javax.management.AttributeNotFoundException
      • setAttributes

        public javax.management.AttributeList setAttributes​(javax.management.AttributeList list)
        Specified by:
        setAttributes in interface javax.management.DynamicMBean
      • invoke

        public java.lang.Object invoke​(java.lang.String name,
                                       java.lang.Object[] args,
                                       java.lang.String[] sig)
                                throws javax.management.MBeanException
        Specified by:
        invoke in interface javax.management.DynamicMBean
        Throws:
        javax.management.MBeanException
      • preRegister

        public javax.management.ObjectName preRegister​(javax.management.MBeanServer server,
                                                       javax.management.ObjectName name)
        Specified by:
        preRegister in interface javax.management.MBeanRegistration
      • postRegister

        public void postRegister​(java.lang.Boolean registrationDone)
        Specified by:
        postRegister in interface javax.management.MBeanRegistration
      • preDeregister

        public void preDeregister()
        Specified by:
        preDeregister in interface javax.management.MBeanRegistration
      • postDeregister

        public void postDeregister()
        Specified by:
        postDeregister in interface javax.management.MBeanRegistration
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object