当前位置: 首页>>代码示例>>Java>>正文


Java MBeanFeatureInfo类代码示例

本文整理汇总了Java中javax.management.MBeanFeatureInfo的典型用法代码示例。如果您正苦于以下问题:Java MBeanFeatureInfo类的具体用法?Java MBeanFeatureInfo怎么用?Java MBeanFeatureInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MBeanFeatureInfo类属于javax.management包,在下文中一共展示了MBeanFeatureInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initInfoSectionFromModel

import javax.management.MBeanFeatureInfo; //导入依赖的package包/类
@Override
protected void initInfoSectionFromModel() {

    Table table = getInfoTable();
    table.removeAll();

    MBeanFeatureInfo featureInfo = getFeatureInfo();

    TableItem nameItem = new TableItem(table, SWT.NONE);
    nameItem.setText(0, FEATURE_INFO_PROPERTY_NAME_NAME);
    nameItem.setText(1, featureInfo.getName());

    TableItem descriptionItem = new TableItem(table, SWT.NONE);
    descriptionItem.setText(0, FEATURE_INFO_PROPERTY_NAME_DESCRIPTION);
    descriptionItem.setText(1, featureInfo.getDescription());
}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:17,代码来源:MBeanFeatureModeMainFormPage.java

示例2: setAttributesFilter

import javax.management.MBeanFeatureInfo; //导入依赖的package包/类
public void setAttributesFilter(String exclude, String include) {
    if (include == null) {
        include = "";
    }
    if (exclude == null) {
        exclude = "";
    }
    includes = Pattern.compile(include);
    excludes = Pattern.compile(exclude);

    try {
        // Set the current value as the description
        final Field field = MBeanFeatureInfo.class.getDeclaredField("description");
        field.setAccessible(true);
        field.set(includeInfo, "\"" + includes.pattern() + "\"");
        field.set(excludeInfo, "\"" + excludes.pattern() + "\"");
    } catch (final Exception e) {
        // Oh well, we tried
    }
}
 
开发者ID:apache,项目名称:tomee,代码行数:21,代码来源:ManagedMBean.java

示例3: getOperationContext

import javax.management.MBeanFeatureInfo; //导入依赖的package包/类
private ResourcePermission getOperationContext(ObjectName objectName, String featureName,
    boolean isOp) throws InstanceNotFoundException, ReflectionException {
  MBeanInfo beanInfo = null;
  try {
    beanInfo = mbs.getMBeanInfo(objectName);
  } catch (IntrospectionException e) {
    throw new GemFireSecurityException("error getting beanInfo of " + objectName, e);
  }
  // If there is no annotation defined either in the class level or method level, we should
  // consider this operation/attribute freely accessible
  ResourcePermission result = null;

  // find the context in the beanInfo if defined in the class level
  result = getOperationContext(beanInfo.getDescriptor(), result);

  MBeanFeatureInfo[] featureInfos = null;
  if (isOp) {
    featureInfos = beanInfo.getOperations();
  } else {
    featureInfos = beanInfo.getAttributes();
  }
  // still look into the attributes/operations to see if it's defined in the method level
  for (MBeanFeatureInfo info : featureInfos) {
    if (info.getName().equals(featureName)) {
      // found the featureInfo of this method on the bean
      result = getOperationContext(info.getDescriptor(), result);
      break;
    }
  }
  return result;
}
 
开发者ID:ampool,项目名称:monarch,代码行数:32,代码来源:MBeanServerWrapper.java

示例4: getNamesList

import javax.management.MBeanFeatureInfo; //导入依赖的package包/类
private List<String> getNamesList(MBeanFeatureInfo[] features)
{
    List<String> names = new ArrayList<String>();
    for (MBeanFeatureInfo feature : features)
    {
        names.add(feature.getName());
    }

    return names;
}
 
开发者ID:wso2,项目名称:andes,代码行数:11,代码来源:ManagementConsoleTest.java

示例5: verifyDescriptor

import javax.management.MBeanFeatureInfo; //导入依赖的package包/类
private void verifyDescriptor(MBeanFeatureInfo featureInfo)
    throws Exception {
    Method getDescriptorMethod = featureInfo.getClass().getMethod(
        "getDescriptor", null);
    Descriptor descriptor = (Descriptor)getDescriptorMethod.invoke(
        featureInfo, null);
    Descriptor descriptor2 = (Descriptor)map.get(featureInfo.getClass()
        .getName());
    assertTrue(DefaultDescriptorTest.compareDescriptors(descriptor,
        descriptor2));
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:12,代码来源:UserDefinedDescriptorTest.java

示例6: setDescriptor

import javax.management.MBeanFeatureInfo; //导入依赖的package包/类
private void setDescriptor(MBeanFeatureInfo featureInfo) throws Exception {
    Method getDescriptorMethod = featureInfo.getClass().getMethod(
        "getDescriptor", null);
    Descriptor descriptor = (Descriptor)getDescriptorMethod.invoke(
        featureInfo, null);
    String[] strings = getSpesific(featureInfo.getClass());
    descriptor.setField(strings[0], strings[1]);
    map.put(featureInfo.getClass().getName(), descriptor);
    Method setDescriptorMethod = featureInfo.getClass().getMethod(
        "setDescriptor", new Class[] { Descriptor.class });
    setDescriptorMethod.invoke(featureInfo, new Object[] { descriptor });
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:13,代码来源:UserDefinedDescriptorTest.java

示例7: testHashCode

import javax.management.MBeanFeatureInfo; //导入依赖的package包/类
/**
 * Test for the method hashCode()
 * 
 * @see javax.management.MBeanFeatureInfo#hashCode();
 */
public final void testHashCode() {
    MBeanFeatureInfo inf1 = new MBeanFeatureInfo("name", "description");
    MBeanFeatureInfo inf2 = new MBeanFeatureInfo("name", "description");

    assertEquals("The hashCode() method must return the same integer "
        + "when it is invoked on the same object more than once!", inf1
        .hashCode(), inf1.hashCode());
    assertEquals("If two objects are equal according to the equals(Object)"
        + " method, then hashCode method on each of them must"
        + " produce the same integer. ", inf1.hashCode(), inf2.hashCode());
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:17,代码来源:MBeanFeatureInfoTest.java

示例8: getFeatureInfo

import javax.management.MBeanFeatureInfo; //导入依赖的package包/类
protected MBeanFeatureInfo getFeatureInfo() {
    return getModel().getData().getInfo();
}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:4,代码来源:MBeanFeatureModeMainFormPage.java

示例9: getDescription

import javax.management.MBeanFeatureInfo; //导入依赖的package包/类
private static String getDescription(MBeanFeatureInfo element) {
  String desc = element.getDescription();
  return desc != null && desc.equals(element.getName()) ? null : desc; // Remove silly descriptions
}
 
开发者ID:purej,项目名称:purej-vminspect,代码行数:5,代码来源:MBeanUtils.java

示例10: compare

import javax.management.MBeanFeatureInfo; //导入依赖的package包/类
@Override
public int compare(final MBeanFeatureInfo o1, final MBeanFeatureInfo o2) {
    return o1.getName().compareTo(o2.getName());
}
 
开发者ID:apache,项目名称:tomee,代码行数:5,代码来源:ManagedMBean.java

示例11: get

import javax.management.MBeanFeatureInfo; //导入依赖的package包/类
/**
 * Retrieves and deserializes the object stored at the given key.
 * @return The deserialized object.
 * @throws IOException if the object cannot be deserialized.
 * @throws ClassNotFoundException if the class of the serialized object
 *         cannot be loaded.
 **/
public static MBeanFeatureInfo get(String name)
throws IOException, ClassNotFoundException {
    final byte[] bytes = map.get(name);
    final Object obj = deserialize(bytes);
    return (MBeanFeatureInfo)obj;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:14,代码来源:MBeanFeatureInfoSerialStore.java

示例12: getInfo

import javax.management.MBeanFeatureInfo; //导入依赖的package包/类
/**
 * Feature information.
 */
MBeanFeatureInfo getInfo();
 
开发者ID:sonatype,项目名称:nexus-public,代码行数:5,代码来源:MBeanFeature.java

示例13: testMBeanFeatureInfo

import javax.management.MBeanFeatureInfo; //导入依赖的package包/类
/**
 * Test for the constructor MBeanFeatureInfo(java.lang.String,
 * java.lang.String)
 * 
 * @see javax.management.MBeanFeatureInfo#MBeanFeatureInfo(java.lang.String,
 *      java.lang.String)
 */
public final void testMBeanFeatureInfo() {
    new MBeanFeatureInfo("name", "description");
    new MBeanFeatureInfo("name", null);
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:12,代码来源:MBeanFeatureInfoTest.java

示例14: testGetDescription

import javax.management.MBeanFeatureInfo; //导入依赖的package包/类
/**
 * Test for the method getDescription()
 * 
 * @see javax.management.MBeanFeatureInfo#getDescription()
 */
public final void testGetDescription() {
    MBeanFeatureInfo inf = new MBeanFeatureInfo("name", "description");
    assertEquals("description", inf.getDescription());
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:10,代码来源:MBeanFeatureInfoTest.java

示例15: testGetName

import javax.management.MBeanFeatureInfo; //导入依赖的package包/类
/**
 * Test for the method getName()
 * 
 * @see javax.management.MBeanFeatureInfo#getName()
 */
public final void testGetName() {
    MBeanFeatureInfo inf = new MBeanFeatureInfo("name", "description");
    assertEquals("name", inf.getName());
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:10,代码来源:MBeanFeatureInfoTest.java


注:本文中的javax.management.MBeanFeatureInfo类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。