javax.management.MBeanParameterInfo Java Examples

The following examples show how to use javax.management.MBeanParameterInfo. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ModelMBeanConstructorInfo.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
* 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;
}
 
Example #2
Source File: ModelMBeanOperationInfo.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
* 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);
}
 
Example #3
Source File: AbstractReflectiveMBeanInfoAssembler.java    From spring-analysis-note with MIT License 6 votes vote down vote up
/**
 * 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;
}
 
Example #4
Source File: ModelMBeanOperationInfo.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
* 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);
}
 
Example #5
Source File: ModelMBeanConstructorInfo.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
* 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);
}
 
Example #6
Source File: ModelMBeanConstructorInfo.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
* 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);
}
 
Example #7
Source File: ModelMBeanConstructorInfo.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
* 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;
}
 
Example #8
Source File: ModelMBeanConstructorInfo.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
* 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;
}
 
Example #9
Source File: ReflectionMBeanOperation.java    From nexus-public with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Extract {@link MBeanParameterInfo} signature for given method.
 */
private MBeanParameterInfo[] signature(final Method method) {
  // NOTE: when NX is based on Java8 we can replace Paranamer usage with JDK api
  Paranamer paranamer = new BytecodeReadingParanamer();
  String[] names = paranamer.lookupParameterNames(method);
  Class[] types = method.getParameterTypes();
  Annotation[][] annotations = method.getParameterAnnotations();

  MBeanParameterInfo[] result = new MBeanParameterInfo[names.length];
  for (int i=0; i< names.length; i++) {
    Descriptor descriptor = DescriptorHelper.build(annotations[i]);
    String description = DescriptorHelper.stringValue(descriptor, "description");

    result[i] = new MBeanParameterInfo(
        names[i],
        types[i].getName(),
        description,
        descriptor
    );
  }

  return result;
}
 
Example #10
Source File: ModelMBeanConstructorInfo.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
* 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);
}
 
Example #11
Source File: ModelMBeanConstructorInfo.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
* 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;
}
 
Example #12
Source File: ModelMBeanConstructorInfo.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
* 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;
}
 
Example #13
Source File: ModelMBeanOperationInfo.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
* 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);
}
 
Example #14
Source File: ModelMBeanOperationInfo.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
* 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);
}
 
Example #15
Source File: ModelMBeanOperationInfo.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
* 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;
}
 
Example #16
Source File: ModelMBeanOperationInfo.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
* 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;
}
 
Example #17
Source File: ModelMBeanInfoSupporter.java    From cxf with Apache License 2.0 6 votes vote down vote up
public void addModelMBeanMethod(String name,
                                String[] paramTypes,
                                String[] paramNames,
                                String[] paramDescs,
                                String description,
                                String rtype,
                                Descriptor desc) {
    MBeanParameterInfo[] params = null;
    if (paramTypes != null) {
        params = new MBeanParameterInfo[ paramTypes.length ];
        for (int i = 0; i < paramTypes.length; i++) {
            params[i] = new MBeanParameterInfo(paramNames[i],
                                                paramTypes[i], paramDescs[i]);
        }
    }

    operations.put(name,
                    new ModelMBeanOperationInfo(name,
                                                description,
                                                params,
                                                rtype,
                                                MBeanOperationInfo.ACTION,
                                                desc));
}
 
Example #18
Source File: ReflectionMbean.java    From simplejmx with ISC License 6 votes vote down vote up
/**
 * Build our parameter information for an operation.
 */
private MBeanParameterInfo[] buildOperationParameterInfo(Method method, JmxOperationInfo operationInfo) {
	Class<?>[] types = method.getParameterTypes();
	MBeanParameterInfo[] parameterInfos = new MBeanParameterInfo[types.length];
	String[] parameterNames = operationInfo.getParameterNames();
	String[] parameterDescriptions = operationInfo.getParameterDescriptions();
	for (int i = 0; i < types.length; i++) {
		String parameterName;
		if (parameterNames == null || i >= parameterNames.length) {
			parameterName = "p" + (i + 1);
		} else {
			parameterName = parameterNames[i];
		}
		String typeName = types[i].getName();
		String description;
		if (parameterDescriptions == null || i >= parameterDescriptions.length) {
			description = "parameter #" + (i + 1) + " of type: " + typeName;
		} else {
			description = parameterDescriptions[i];
		}
		parameterInfos[i] = new MBeanParameterInfo(parameterName, typeName, description);
	}
	return parameterInfos;
}
 
Example #19
Source File: ModelMBeanOperationInfo.java    From Java8CN with Apache License 2.0 6 votes vote down vote up
/**
* 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);
}
 
Example #20
Source File: DynamicMBeanWrapper.java    From tomee with Apache License 2.0 6 votes vote down vote up
static MBeanParameterInfo[] parameters(final MBeanOperationInfo jvmInfo,
                                       final Class<?>[] classes,
                                       final Annotation[][] annots) {
    final MBeanParameterInfo[] params =
        new MBeanParameterInfo[classes.length];
    assert classes.length == annots.length;

    String desc = "";
    for (int i = 0; i < classes.length; i++) {
        final Descriptor d = jvmInfo.getSignature()[i].getDescriptor();
        final String pn = "arg" + i;
        for (final Annotation a : annots[i]) {
            final Class<? extends Annotation> type = a.annotationType();
            if (type.equals(Description.class) || type.equals(OPENEJB_API_TO_JAVAX.get(Description.class))) {
                desc = getDescription(annotationProxy(a, Description.class), desc);
                break;
            }
        }
        params[i] = new MBeanParameterInfo(pn, classes[i].getName(), desc, d);
    }

    return params;
}
 
Example #21
Source File: ModelMBeanConstructorInfo.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
* 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);
}
 
Example #22
Source File: ModelMBeanOperationInfo.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
* 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);
}
 
Example #23
Source File: IgniteStandardMXBeanTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/**
 * Public constructor that initializes instances of IgniteStandardMXBean and MBeanParameterInfo classes.
 */
public IgniteStandardMXBeanTest() throws NotCompliantMBeanException {
    TestInterfaceImpl testItfImpl = new TestInterfaceImpl();

    igniteStandardMXBean = new IgniteStandardMXBean(testItfImpl, TestInterface.class);

    paramInfo = new MBeanParameterInfo(NAME, TYPE, PARAMETER_INFO_DESCRIPTION);
}
 
Example #24
Source File: MustBeValidCommand.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
static private MBeanOperationInfo[] makeOpInfos(String[][] spec) {
    final MBeanOperationInfo[] result =
        new MBeanOperationInfo[spec.length];
    final MBeanParameterInfo[] pars = makeParInfos(parameters);
    for (int i=0;i<result.length;i++) {
        System.out.println("\tCreate an MBeanOperationInfo: " +
                           spec[i][0]);
        final MBeanOperationInfo item =
            new MBeanOperationInfo(spec[i][2],spec[i][0],pars,spec[i][1],
                                   MBeanOperationInfo.ACTION_INFO);
        result[i]=item;
    }
    return result;
}
 
Example #25
Source File: SetConfigurationSetting.java    From development with Apache License 2.0 5 votes vote down vote up
@Override
public synchronized MBeanInfo getMBeanInfo() {
    MBeanParameterInfo[] parameter = new MBeanParameterInfo[] {
            new MBeanParameterInfo("informationId", "java.lang.String",
                    "The information ID which the value will be changed. e.g. AUTH_MODE"),
            new MBeanParameterInfo("value", "java.lang.String",
                    "The value to be set for the information ID. e.g. INTERNAL, SAML_SP") };

    MBeanOperationInfo[] operations = { new MBeanOperationInfo(
            SET_CONFIGURATION_SETTING, "Set configuration setting",
            parameter, "java.lang.String", MBeanOperationInfo.ACTION) };

    return new MBeanInfo(this.getClass().getName(),
            "Set Configuration Setting MBean", null, null, operations, null);
}
 
Example #26
Source File: MustBeValidCommand.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
static private MBeanParameterInfo[] makeParInfos(String[][] spec) {
    final MBeanParameterInfo[] result =
        new MBeanParameterInfo[spec.length];
    for (int i=0;i<result.length;i++) {
        System.out.println("\tCreate an MBeanParameterInfo: " +
                           spec[i][0]);
        final MBeanParameterInfo item =
            new MBeanParameterInfo(spec[i][2],spec[i][1],spec[i][0]);
        result[i]=item;
    }
    return result;
}
 
Example #27
Source File: OpenMBeanConstructorInfoSupport.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static MBeanParameterInfo[]
        arrayCopyCast(OpenMBeanParameterInfo[] src) {
    if (src == null)
        return null;

    MBeanParameterInfo[] dst = new MBeanParameterInfo[src.length];
    System.arraycopy(src, 0, dst, 0, src.length);
    // may throw an ArrayStoreException
    return dst;
}
 
Example #28
Source File: OpenMBeanOperationInfoSupport.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
private static OpenMBeanParameterInfo[]
        arrayCopyCast(MBeanParameterInfo[] src) {
    if (src == null)
        return null;

    OpenMBeanParameterInfo[] dst = new OpenMBeanParameterInfo[src.length];
    System.arraycopy(src, 0, dst, 0, src.length);
    // may throw an ArrayStoreException
    return dst;
}
 
Example #29
Source File: IgniteStandardMXBean.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override protected String getParameterName(MBeanOperationInfo op, MBeanParameterInfo param, int seq) {
    String str = super.getParameterName(op, param, seq);

    try {
        Method m = getMethod(op);

        MXBeanParametersNames namesAnn = m.getAnnotation(MXBeanParametersNames.class);

        if (namesAnn != null) {
            assert namesAnn.value() != null;
            assert seq < namesAnn.value().length;

            str = namesAnn.value()[seq];

            assert str != null : NAME_MUST_BE_NOT_NULL + str;
            assert !str.trim().isEmpty() : NAME_MUST_BE_NOT_EMPTY + str;
        }
        else {
            MXBeanParameter argInfoAnnotation = getMXBeanParameterAnnotation(m, seq);

            if (argInfoAnnotation != null) {
                str = argInfoAnnotation.name();

                assert str != null : NAME_MUST_BE_NOT_NULL + str;
                assert !str.trim().isEmpty() : NAME_MUST_BE_NOT_EMPTY + str;
            }
        }
    }
    catch (SecurityException | ClassNotFoundException ignored) {
        // No-op. Default value will be returned.
    }

    return str;
}
 
Example #30
Source File: DynamicLegacyService.java    From cacheonix-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
protected MBeanOperationInfo[] createMBeanOperationInfo()
{
   return new MBeanOperationInfo[]
   {
      new MBeanOperationInfo("start", "Start the Legacy Service", new MBeanParameterInfo[0], "void", MBeanOperationInfo.ACTION)
   };
}