本文整理汇总了Java中javax.management.modelmbean.ModelMBeanInfo.getMBeanDescriptor方法的典型用法代码示例。如果您正苦于以下问题:Java ModelMBeanInfo.getMBeanDescriptor方法的具体用法?Java ModelMBeanInfo.getMBeanDescriptor怎么用?Java ModelMBeanInfo.getMBeanDescriptor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.management.modelmbean.ModelMBeanInfo
的用法示例。
在下文中一共展示了ModelMBeanInfo.getMBeanDescriptor方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getModelMBeanLogger
import javax.management.modelmbean.ModelMBeanInfo; //导入方法依赖的package包/类
private Logger getModelMBeanLogger(String notificationType) throws MBeanException {
// Get a copy to avoid synchronization
ModelMBeanInfo info = getModelMBeanInfo();
// First look if there is a suitable notification descriptor, otherwise use MBean descriptor
Descriptor descriptor = null;
Logger modelMBeanLogger = null;
if (notificationType != null) {
descriptor = info.getDescriptor(notificationType, "notification");
modelMBeanLogger = findLogger(descriptor);
}
if (modelMBeanLogger == null) {
descriptor = info.getMBeanDescriptor();
modelMBeanLogger = findLogger(descriptor);
if (modelMBeanLogger != null)
return modelMBeanLogger;
}
return null;
}
示例2: getModelMBeanLogger
import javax.management.modelmbean.ModelMBeanInfo; //导入方法依赖的package包/类
private Logger getModelMBeanLogger(String notificationType) throws MBeanException
{
// Get a copy to avoid synchronization
ModelMBeanInfo info = getModelMBeanInfo();
// First look if there is a suitable notification descriptor, otherwise use MBean descriptor
Descriptor descriptor = null;
Logger modelMBeanLogger = null;
if (notificationType != null)
{
descriptor = info.getDescriptor(notificationType, "notification");
modelMBeanLogger = findLogger(descriptor);
}
if (modelMBeanLogger == null)
{
descriptor = info.getMBeanDescriptor();
modelMBeanLogger = findLogger(descriptor);
if (modelMBeanLogger != null) return modelMBeanLogger;
}
return null;
}
示例3: testManagedResourceDescriptor
import javax.management.modelmbean.ModelMBeanInfo; //导入方法依赖的package包/类
@Test
public void testManagedResourceDescriptor() throws Exception {
ModelMBeanInfo info = getMBeanInfoFromAssembler();
Descriptor desc = info.getMBeanDescriptor();
assertEquals("Logging should be set to true", "true", desc.getFieldValue("log"));
assertEquals("Log file should be jmx.log", "jmx.log", desc.getFieldValue("logFile"));
assertEquals("Currency Time Limit should be 15", "15", desc.getFieldValue("currencyTimeLimit"));
assertEquals("Persist Policy should be OnUpdate", "OnUpdate", desc.getFieldValue("persistPolicy"));
assertEquals("Persist Period should be 200", "200", desc.getFieldValue("persistPeriod"));
assertEquals("Persist Location should be foo", "./foo", desc.getFieldValue("persistLocation"));
assertEquals("Persist Name should be bar", "bar.jmx", desc.getFieldValue("persistName"));
}
示例4: getMBeanInfo
import javax.management.modelmbean.ModelMBeanInfo; //导入方法依赖的package包/类
/**
* Create an instance of the {@code ModelMBeanInfoSupport} class supplied with all
* JMX implementations and populates the metadata through calls to the subclass.
* @param managedBean the bean that will be exposed (might be an AOP proxy)
* @param beanKey the key associated with the managed bean
* @return the populated ModelMBeanInfo instance
* @throws JMException in case of errors
* @see #getDescription(Object, String)
* @see #getAttributeInfo(Object, String)
* @see #getConstructorInfo(Object, String)
* @see #getOperationInfo(Object, String)
* @see #getNotificationInfo(Object, String)
* @see #populateMBeanDescriptor(javax.management.Descriptor, Object, String)
*/
@Override
public ModelMBeanInfo getMBeanInfo(Object managedBean, String beanKey) throws JMException {
checkManagedBean(managedBean);
ModelMBeanInfo info = new ModelMBeanInfoSupport(
getClassName(managedBean, beanKey), getDescription(managedBean, beanKey),
getAttributeInfo(managedBean, beanKey), getConstructorInfo(managedBean, beanKey),
getOperationInfo(managedBean, beanKey), getNotificationInfo(managedBean, beanKey));
Descriptor desc = info.getMBeanDescriptor();
populateMBeanDescriptor(desc, managedBean, beanKey);
info.setMBeanDescriptor(desc);
return info;
}
示例5: getMBeanInfo
import javax.management.modelmbean.ModelMBeanInfo; //导入方法依赖的package包/类
/**
* Create an instance of the {@code ModelMBeanInfoSupport} class supplied with all
* JMX implementations and populates the metadata through calls to the subclass.
* @param managedBean the bean that will be exposed (might be an AOP proxy)
* @param beanKey the key associated with the managed bean
* @return the populated ModelMBeanInfo instance
* @throws JMException in case of errors
* @see #getDescription(Object, String)
* @see #getAttributeInfo(Object, String)
* @see #getConstructorInfo(Object, String)
* @see #getOperationInfo(Object, String)
* @see #getNotificationInfo(Object, String)
* @see #populateMBeanDescriptor(javax.management.Descriptor, Object, String)
*/
public ModelMBeanInfo getMBeanInfo(Object managedBean, String beanKey) throws JMException {
checkManagedBean(managedBean);
ModelMBeanInfo info = new ModelMBeanInfoSupport(
getClassName(managedBean, beanKey), getDescription(managedBean, beanKey),
getAttributeInfo(managedBean, beanKey), getConstructorInfo(managedBean, beanKey),
getOperationInfo(managedBean, beanKey), getNotificationInfo(managedBean, beanKey));
Descriptor desc = info.getMBeanDescriptor();
populateMBeanDescriptor(desc, managedBean, beanKey);
info.setMBeanDescriptor(desc);
return info;
}