java类javax.management.MBeanParameterInfo的实例源码

ModelMBeanConstructorInfo.java 文件源码 项目:Java8CN 阅读 24 收藏 0 点赞 0 评论 0
/**
* Returns a string containing the entire contents of the ModelMBeanConstructorInfo in human readable form.
*/
@Override
public String toString()
{
    if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
        MODELMBEAN_LOGGER.logp(Level.FINER,
                ModelMBeanConstructorInfo.class.getName(),
                "toString()", "Entry");
    }
        String retStr =
            "ModelMBeanConstructorInfo: " + this.getName() +
            " ; Description: " + this.getDescription() +
            " ; Descriptor: " + this.getDescriptor() +
            " ; Signature: ";
        MBeanParameterInfo[] pTypes = this.getSignature();
        for (int i=0; i < pTypes.length; i++)
        {
                retStr = retStr.concat((pTypes[i]).getType() + ", ");
        }
        return retStr;
}
ModelMBeanOperationInfo.java 文件源码 项目:Java8CN 阅读 20 收藏 0 点赞 0 评论 0
/**
* Constructs a ModelMBeanOperationInfo object with a default descriptor.
*
* @param name The name of the method.
* @param description A human readable description of the operation.
* @param signature MBeanParameterInfo objects describing the
* parameters(arguments) of the method.
* @param type The type of the method's return value.
* @param impact The impact of the method, one of INFO, ACTION,
* ACTION_INFO, UNKNOWN.
*/

public ModelMBeanOperationInfo(String name,
                               String description,
                               MBeanParameterInfo[] signature,
                               String type,
                               int impact)
{

        super(name, description, signature, type, impact);
        // create default descriptor
        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
            MODELMBEAN_LOGGER.logp(Level.FINER,
                    ModelMBeanOperationInfo.class.getName(),
                    "ModelMBeanOperationInfo(" +
                    "String,String,MBeanParameterInfo[],String,int)",
                    "Entry");
        }
        operationDescriptor = validDescriptor(null);
}
ModelMBeanOperationInfo.java 文件源码 项目:Java8CN 阅读 18 收藏 0 点赞 0 评论 0
/**
* Returns a string containing the entire contents of the
* ModelMBeanOperationInfo in human readable form.
*/
public String toString()
{
    if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
        MODELMBEAN_LOGGER.logp(Level.FINER,
                ModelMBeanOperationInfo.class.getName(),
                "toString()", "Entry");
    }
        String retStr =
            "ModelMBeanOperationInfo: " + this.getName() +
            " ; Description: " + this.getDescription() +
            " ; Descriptor: " + this.getDescriptor() +
            " ; ReturnType: " + this.getReturnType() +
            " ; Signature: ";
        MBeanParameterInfo[] pTypes = this.getSignature();
        for (int i=0; i < pTypes.length; i++)
        {
                retStr = retStr.concat((pTypes[i]).getType() + ", ");
        }
        return retStr;
}
MetadataMBeanInfoAssembler.java 文件源码 项目:spring4-understanding 阅读 27 收藏 0 点赞 0 评论 0
/**
 * Reads {@code MBeanParameterInfo} from the {@code ManagedOperationParameter}
 * attributes attached to a method. Returns an empty array of {@code MBeanParameterInfo}
 * if no attributes are found.
 */
@Override
protected MBeanParameterInfo[] getOperationParameters(Method method, String beanKey) {
    ManagedOperationParameter[] params = this.attributeSource.getManagedOperationParameters(method);
    if (ObjectUtils.isEmpty(params)) {
        return super.getOperationParameters(method, beanKey);
    }

    MBeanParameterInfo[] parameterInfo = new MBeanParameterInfo[params.length];
    Class<?>[] methodParameters = method.getParameterTypes();
    for (int i = 0; i < params.length; i++) {
        ManagedOperationParameter param = params[i];
        parameterInfo[i] =
                new MBeanParameterInfo(param.getName(), methodParameters[i].getName(), param.getDescription());
    }
    return parameterInfo;
}
AbstractReflectiveMBeanInfoAssembler.java 文件源码 项目:spring4-understanding 阅读 25 收藏 0 点赞 0 评论 0
/**
 * Create parameter info for the given method.
 * <p>The default implementation returns an empty array of {@code MBeanParameterInfo}.
 * @param method the {@code Method} to get the parameter information for
 * @param beanKey the key associated with the MBean in the beans map
 * of the {@code MBeanExporter}
 * @return the {@code MBeanParameterInfo} array
 */
protected MBeanParameterInfo[] getOperationParameters(Method method, String beanKey) {
    ParameterNameDiscoverer paramNameDiscoverer = getParameterNameDiscoverer();
    String[] paramNames = (paramNameDiscoverer != null ? paramNameDiscoverer.getParameterNames(method) : null);
    if (paramNames == null) {
        return new MBeanParameterInfo[0];
    }

    MBeanParameterInfo[] info = new MBeanParameterInfo[paramNames.length];
    Class<?>[] typeParameters = method.getParameterTypes();
    for (int i = 0; i < info.length; i++) {
        info[i] = new MBeanParameterInfo(paramNames[i], typeParameters[i].getName(), paramNames[i]);
    }

    return info;
}
MetadataMBeanInfoAssembler.java 文件源码 项目:my-spring-cache-redis 阅读 25 收藏 0 点赞 0 评论 0
/**
 * Reads {@code MBeanParameterInfo} from the {@code ManagedOperationParameter}
 * attributes attached to a method. Returns an empty array of {@code MBeanParameterInfo}
 * if no attributes are found.
 */
@Override
protected MBeanParameterInfo[] getOperationParameters(Method method, String beanKey) {
    ManagedOperationParameter[] params = this.attributeSource.getManagedOperationParameters(method);
    if (ObjectUtils.isEmpty(params)) {
        return super.getOperationParameters(method, beanKey);
    }

    MBeanParameterInfo[] parameterInfo = new MBeanParameterInfo[params.length];
    Class<?>[] methodParameters = method.getParameterTypes();
    for (int i = 0; i < params.length; i++) {
        ManagedOperationParameter param = params[i];
        parameterInfo[i] =
                new MBeanParameterInfo(param.getName(), methodParameters[i].getName(), param.getDescription());
    }
    return parameterInfo;
}
AbstractReflectiveMBeanInfoAssembler.java 文件源码 项目:my-spring-cache-redis 阅读 24 收藏 0 点赞 0 评论 0
/**
 * Create parameter info for the given method.
 * <p>The default implementation returns an empty array of {@code MBeanParameterInfo}.
 * @param method the {@code Method} to get the parameter information for
 * @param beanKey the key associated with the MBean in the beans map
 * of the {@code MBeanExporter}
 * @return the {@code MBeanParameterInfo} array
 */
protected MBeanParameterInfo[] getOperationParameters(Method method, String beanKey) {
    ParameterNameDiscoverer paramNameDiscoverer = getParameterNameDiscoverer();
    String[] paramNames = (paramNameDiscoverer != null ? paramNameDiscoverer.getParameterNames(method) : null);
    if (paramNames == null) {
        return new MBeanParameterInfo[0];
    }

    MBeanParameterInfo[] info = new MBeanParameterInfo[paramNames.length];
    Class<?>[] typeParameters = method.getParameterTypes();
    for(int i = 0; i < info.length; i++) {
        info[i] = new MBeanParameterInfo(paramNames[i], typeParameters[i].getName(), paramNames[i]);
    }

    return info;
}
ModelMBeanConstructorInfo.java 文件源码 项目:jdk8u_jdk 阅读 29 收藏 0 点赞 0 评论 0
/**
* Constructs a ModelMBeanConstructorInfo object with a default descriptor.
*
* @param name The name of the constructor.
* @param description A human readable description of the constructor.
* @param signature MBeanParameterInfo object array describing the parameters(arguments) of the constructor.
*/

public ModelMBeanConstructorInfo(String name,
                                 String description,
                                 MBeanParameterInfo[] signature)
{

        super(name, description, signature);
        // create default descriptor
        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
            MODELMBEAN_LOGGER.logp(Level.FINER,
                    ModelMBeanConstructorInfo.class.getName(),
                    "ModelMBeanConstructorInfo(" +
                    "String,String,MBeanParameterInfo[])", "Entry");
        }
        consDescriptor = validDescriptor(null);
}
ModelMBeanConstructorInfo.java 文件源码 项目:jdk8u_jdk 阅读 25 收藏 0 点赞 0 评论 0
/**
* Returns a string containing the entire contents of the ModelMBeanConstructorInfo in human readable form.
*/
@Override
public String toString()
{
    if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
        MODELMBEAN_LOGGER.logp(Level.FINER,
                ModelMBeanConstructorInfo.class.getName(),
                "toString()", "Entry");
    }
        String retStr =
            "ModelMBeanConstructorInfo: " + this.getName() +
            " ; Description: " + this.getDescription() +
            " ; Descriptor: " + this.getDescriptor() +
            " ; Signature: ";
        MBeanParameterInfo[] pTypes = this.getSignature();
        for (int i=0; i < pTypes.length; i++)
        {
                retStr = retStr.concat((pTypes[i]).getType() + ", ");
        }
        return retStr;
}
ModelMBeanOperationInfo.java 文件源码 项目:jdk8u_jdk 阅读 22 收藏 0 点赞 0 评论 0
/**
* Constructs a ModelMBeanOperationInfo object with a default descriptor.
*
* @param name The name of the method.
* @param description A human readable description of the operation.
* @param signature MBeanParameterInfo objects describing the
* parameters(arguments) of the method.
* @param type The type of the method's return value.
* @param impact The impact of the method, one of INFO, ACTION,
* ACTION_INFO, UNKNOWN.
*/

public ModelMBeanOperationInfo(String name,
                               String description,
                               MBeanParameterInfo[] signature,
                               String type,
                               int impact)
{

        super(name, description, signature, type, impact);
        // create default descriptor
        if (MODELMBEAN_LOGGER.isLoggable(Level.FINER)) {
            MODELMBEAN_LOGGER.logp(Level.FINER,
                    ModelMBeanOperationInfo.class.getName(),
                    "ModelMBeanOperationInfo(" +
                    "String,String,MBeanParameterInfo[],String,int)",
                    "Entry");
        }
        operationDescriptor = validDescriptor(null);
}


问题


面经


文章

微信
公众号

扫码关注公众号