类 AbstractReflectiveMBeanInfoAssembler

    • 方法详细资料

      • setDefaultCurrencyTimeLimit

        public void setDefaultCurrencyTimeLimit​(Integer defaultCurrencyTimeLimit)
        Set the default for the JMX field "currencyTimeLimit". The default will usually indicate to never cache attribute values.

        Default is none, not explicitly setting that field, as recommended by the JMX 1.2 specification. This should result in "never cache" behavior, always reading attribute values freshly (which corresponds to a "currencyTimeLimit" of -1 in JMX 1.2).

        However, some JMX implementations (that do not follow the JMX 1.2 spec in that respect) might require an explicit value to be set here to get "never cache" behavior: for example, JBoss 3.2.x.

        Note that the "currencyTimeLimit" value can also be specified on a managed attribute or operation. The default value will apply if not overridden with a "currencyTimeLimit" value >= 0 there: a metadata "currencyTimeLimit" value of -1 indicates to use the default; a value of 0 indicates to "always cache" and will be translated to Integer.MAX_VALUE; a positive value indicates the number of cache seconds.

        另请参阅:
        AbstractJmxAttribute.setCurrencyTimeLimit(int), applyCurrencyTimeLimit(javax.management.Descriptor, int)
      • setUseStrictCasing

        public void setUseStrictCasing​(boolean useStrictCasing)
        Set whether to use strict casing for attributes. Enabled by default.

        When using strict casing, a JavaBean property with a getter such as getFoo() translates to an attribute called Foo. With strict casing disabled, getFoo() would translate to just foo.

      • isUseStrictCasing

        protected boolean isUseStrictCasing()
        Return whether strict casing for attributes is enabled.
      • setExposeClassDescriptor

        public void setExposeClassDescriptor​(boolean exposeClassDescriptor)
        Set whether to expose the JMX descriptor field "class" for managed operations. Default is "false", letting the JMX implementation determine the actual class through reflection.

        Set this property to true for JMX implementations that require the "class" field to be specified, for example WebLogic's. In that case, Spring will expose the target class name there, in case of a plain bean instance or a CGLIB proxy. When encountering a JDK dynamic proxy, the first interface implemented by the proxy will be specified.

        WARNING: Review your proxy definitions when exposing a JDK dynamic proxy through JMX, in particular with this property turned to true: the specified interface list should start with your management interface in this case, with all other interfaces following. In general, consider exposing your target bean directly or a CGLIB proxy for it instead.

        另请参阅:
        getClassForDescriptor(Object)
      • isExposeClassDescriptor

        protected boolean isExposeClassDescriptor()
        Return whether to expose the JMX descriptor field "class" for managed operations.
      • createModelMBeanOperationInfo

        protected ModelMBeanOperationInfo createModelMBeanOperationInfo​(Method method,
                                                                        String name,
                                                                        String beanKey)
        Creates an instance of ModelMBeanOperationInfo for the given method. Populates the parameter info for the operation.
        参数:
        method - the Method to create a ModelMBeanOperationInfo for
        name - the logical name for the operation (method name or property name); not used by the default implementation but possibly by subclasses
        beanKey - the key associated with the MBean in the beans map of the MBeanExporter
        返回:
        the ModelMBeanOperationInfo
      • includeReadAttribute

        protected abstract boolean includeReadAttribute​(Method method,
                                                        String beanKey)
        Allows subclasses to vote on the inclusion of a particular attribute accessor.
        参数:
        method - the accessor Method
        beanKey - the key associated with the MBean in the beans map of the MBeanExporter
        返回:
        true if the accessor should be included in the management interface, otherwise false
      • includeWriteAttribute

        protected abstract boolean includeWriteAttribute​(Method method,
                                                         String beanKey)
        Allows subclasses to vote on the inclusion of a particular attribute mutator.
        参数:
        method - the mutator Method.
        beanKey - the key associated with the MBean in the beans map of the MBeanExporter
        返回:
        true if the mutator should be included in the management interface, otherwise false
      • includeOperation

        protected abstract boolean includeOperation​(Method method,
                                                    String beanKey)
        Allows subclasses to vote on the inclusion of a particular operation.
        参数:
        method - the operation method
        beanKey - the key associated with the MBean in the beans map of the MBeanExporter
        返回:
        whether the operation should be included in the management interface
      • getAttributeDescription

        protected String getAttributeDescription​(PropertyDescriptor propertyDescriptor,
                                                 String beanKey)
        Get the description for a particular attribute.

        The default implementation returns a description for the operation that is the name of corresponding Method.

        参数:
        propertyDescriptor - the PropertyDescriptor for the attribute
        beanKey - the key associated with the MBean in the beans map of the MBeanExporter
        返回:
        the description for the attribute
      • getOperationDescription

        protected String getOperationDescription​(Method method,
                                                 String beanKey)
        Get the description for a particular operation.

        The default implementation returns a description for the operation that is the name of corresponding Method.

        参数:
        method - the operation method
        beanKey - the key associated with the MBean in the beans map of the MBeanExporter
        返回:
        the description for the operation
      • getOperationParameters

        protected MBeanParameterInfo[] getOperationParameters​(Method method,
                                                              String beanKey)
        Create parameter info for the given method.

        The default implementation returns an empty array of MBeanParameterInfo.

        参数:
        method - the Method to get the parameter information for
        beanKey - the key associated with the MBean in the beans map of the MBeanExporter
        返回:
        the MBeanParameterInfo array
      • applyCurrencyTimeLimit

        protected void applyCurrencyTimeLimit​(Descriptor desc,
                                              int currencyTimeLimit)
        Apply the given JMX "currencyTimeLimit" value to the given descriptor.

        The default implementation sets a value >0 as-is (as number of cache seconds), turns a value of 0 into Integer.MAX_VALUE ("always cache") and sets the "defaultCurrencyTimeLimit" (if any, indicating "never cache") in case of a value <0. This follows the recommendation in the JMX 1.2 specification.

        参数:
        desc - the JMX attribute or operation descriptor
        currencyTimeLimit - the "currencyTimeLimit" value to apply
        另请参阅:
        setDefaultCurrencyTimeLimit(Integer), applyDefaultCurrencyTimeLimit(javax.management.Descriptor)