本文整理汇总了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());
}
示例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
}
}
示例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;
}
示例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;
}
示例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));
}
示例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 });
}
示例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());
}
示例8: getFeatureInfo
import javax.management.MBeanFeatureInfo; //导入依赖的package包/类
protected MBeanFeatureInfo getFeatureInfo() {
return getModel().getData().getInfo();
}
示例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
}
示例10: compare
import javax.management.MBeanFeatureInfo; //导入依赖的package包/类
@Override
public int compare(final MBeanFeatureInfo o1, final MBeanFeatureInfo o2) {
return o1.getName().compareTo(o2.getName());
}
示例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;
}
示例12: getInfo
import javax.management.MBeanFeatureInfo; //导入依赖的package包/类
/**
* Feature information.
*/
MBeanFeatureInfo getInfo();
示例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);
}
示例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());
}
示例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());
}