Java 类javax.management.MBeanFeatureInfo 实例源码

项目:eZooKeeper    文件:MBeanFeatureModeMainFormPage.java   
@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());
}
项目:tomee    文件:ManagedMBean.java   
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
    }
}
项目:monarch    文件:MBeanServerWrapper.java   
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;
}
项目:andes    文件:ManagementConsoleTest.java   
private List<String> getNamesList(MBeanFeatureInfo[] features)
{
    List<String> names = new ArrayList<String>();
    for (MBeanFeatureInfo feature : features)
    {
        names.add(feature.getName());
    }

    return names;
}
项目:freeVM    文件:UserDefinedDescriptorTest.java   
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));
}
项目:freeVM    文件:UserDefinedDescriptorTest.java   
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 });
}
项目:freeVM    文件:MBeanFeatureInfoTest.java   
/**
 * 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());
}
项目:eZooKeeper    文件:MBeanFeatureModeMainFormPage.java   
protected MBeanFeatureInfo getFeatureInfo() {
    return getModel().getData().getInfo();
}
项目:purej-vminspect    文件:MBeanUtils.java   
private static String getDescription(MBeanFeatureInfo element) {
  String desc = element.getDescription();
  return desc != null && desc.equals(element.getName()) ? null : desc; // Remove silly descriptions
}
项目:freeVM    文件:UserDefinedDescriptorTest.java   
private void verifyDescriptor(MBeanFeatureInfo[] featureInfos)
    throws Exception {
    assertEquals(featureInfos.length, 1);
    verifyDescriptor(featureInfos[0]);
}
项目:tomee    文件:ManagedMBean.java   
@Override
public int compare(final MBeanFeatureInfo o1, final MBeanFeatureInfo o2) {
    return o1.getName().compareTo(o2.getName());
}
项目:jdk8u-jdk    文件:MBeanFeatureInfoSerialStore.java   
/**
 * 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;
}
项目:openjdk-jdk10    文件:MBeanFeatureInfoSerialStore.java   
/**
 * 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;
}
项目:openjdk9    文件:MBeanFeatureInfoSerialStore.java   
/**
 * 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;
}
项目:jdk8u_jdk    文件:MBeanFeatureInfoSerialStore.java   
/**
 * 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;
}
项目:lookaside_java-1.8.0-openjdk    文件:MBeanFeatureInfoSerialStore.java   
/**
 * 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;
}
项目:infobip-open-jdk-8    文件:MBeanFeatureInfoSerialStore.java   
/**
 * 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;
}
项目:jdk8u-dev-jdk    文件:MBeanFeatureInfoSerialStore.java   
/**
 * 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;
}
项目:jdk7-jdk    文件:MBeanFeatureInfoSerialStore.java   
/**
 * 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;
}
项目:openjdk-source-code-learn    文件:MBeanFeatureInfoSerialStore.java   
/**
 * 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;
}
项目:OLD-OpenJDK8    文件:MBeanFeatureInfoSerialStore.java   
/**
 * 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;
}
项目:JAVA_UNIT    文件:MBeanFeatureInfoSerialStore.java   
/**
 * 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;
}
项目:openjdk-jdk7u-jdk    文件:MBeanFeatureInfoSerialStore.java   
/**
 * 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;
}
项目:openjdk-icedtea7    文件:MBeanFeatureInfoSerialStore.java   
/**
 * 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;
}
项目:nexus-public    文件:MBeanFeature.java   
/**
 * Feature information.
 */
MBeanFeatureInfo getInfo();
项目:freeVM    文件:MBeanFeatureInfoTest.java   
/**
 * 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);
}
项目:freeVM    文件:MBeanFeatureInfoTest.java   
/**
 * Test for the method getDescription()
 * 
 * @see javax.management.MBeanFeatureInfo#getDescription()
 */
public final void testGetDescription() {
    MBeanFeatureInfo inf = new MBeanFeatureInfo("name", "description");
    assertEquals("description", inf.getDescription());
}
项目:freeVM    文件:MBeanFeatureInfoTest.java   
/**
 * Test for the method getName()
 * 
 * @see javax.management.MBeanFeatureInfo#getName()
 */
public final void testGetName() {
    MBeanFeatureInfo inf = new MBeanFeatureInfo("name", "description");
    assertEquals("name", inf.getName());
}
项目:eZooKeeper    文件:MBeanFeatureModel.java   
public abstract MBeanFeatureDoc<? extends MBeanFeatureInfo> getDoc();
项目:TayzGrid    文件:MBeanFeature.java   
public MBeanFeatureInfo getInfo();