本文整理汇总了Java中javax.management.openmbean.OpenMBeanConstructorInfoSupport类的典型用法代码示例。如果您正苦于以下问题:Java OpenMBeanConstructorInfoSupport类的具体用法?Java OpenMBeanConstructorInfoSupport怎么用?Java OpenMBeanConstructorInfoSupport使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OpenMBeanConstructorInfoSupport类属于javax.management.openmbean包,在下文中一共展示了OpenMBeanConstructorInfoSupport类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: customize
import javax.management.openmbean.OpenMBeanConstructorInfoSupport; //导入依赖的package包/类
private static MBeanConstructorInfo
customize(MBeanConstructorInfo ci,
String description,
MBeanParameterInfo[] signature) {
if (equal(description, ci.getDescription()) &&
identicalArrays(signature, ci.getSignature()))
return ci;
if (ci instanceof OpenMBeanConstructorInfo) {
OpenMBeanParameterInfo[] oparams =
paramsToOpenParams(signature);
return new OpenMBeanConstructorInfoSupport(ci.getName(),
description,
oparams,
ci.getDescriptor());
} else {
return new MBeanConstructorInfo(ci.getName(),
description,
signature,
ci.getDescriptor());
}
}
示例2: getMBeanInfo
import javax.management.openmbean.OpenMBeanConstructorInfoSupport; //导入依赖的package包/类
@Override
public MBeanInfo getMBeanInfo() {
ArrayList<OpenMBeanAttributeInfoSupport> attributes = new ArrayList<>();
attributes.add(new OpenMBeanAttributeInfoSupport("enabled", "enabled", SimpleType.BOOLEAN, true, true, true));
for (String type : registry.getTypes()) {
attributes.add(new OpenMBeanAttributeInfoSupport(type, type, getCompositeType(type), true, false, false));
}
OpenMBeanParameterInfo[] params = new OpenMBeanParameterInfoSupport[0];
OpenMBeanOperationInfoSupport reset = new OpenMBeanOperationInfoSupport("reset", "Reset all Metrics", params,
SimpleType.VOID, MBeanOperationInfo.ACTION);
OpenMBeanInfoSupport PSOMBInfo = new OpenMBeanInfoSupport(this.getClass().getName(), description,
attributes.toArray(new OpenMBeanAttributeInfoSupport[0]), new OpenMBeanConstructorInfoSupport[0],
new OpenMBeanOperationInfoSupport[] { reset }, new MBeanNotificationInfo[0]);
return PSOMBInfo;
}
示例3: createMBeanConstructorInfo
import javax.management.openmbean.OpenMBeanConstructorInfoSupport; //导入依赖的package包/类
private OpenMBeanConstructorInfo[] createMBeanConstructorInfo()
{
return new OpenMBeanConstructorInfoSupport[]
{
};
}
示例4: cacheMBeanInfo
import javax.management.openmbean.OpenMBeanConstructorInfoSupport; //导入依赖的package包/类
protected void cacheMBeanInfo(MBeanInfo info)
{
if (info == null)
return;
try
{
MBeanAttributeInfo[] oldA = info.getAttributes();
OpenMBeanAttributeInfo[] attribs =
new OpenMBeanAttributeInfoSupport[oldA.length];
for (int a = 0; a < oldA.length; ++a)
{
OpenMBeanParameterInfo param = Translator.translate(oldA[a].getType());
if (param.getMinValue() == null)
{
Object[] lv;
if (param.getLegalValues() == null)
lv = null;
else
lv = param.getLegalValues().toArray();
attribs[a] = new OpenMBeanAttributeInfoSupport(oldA[a].getName(),
oldA[a].getDescription(),
((OpenType<Object>)
param.getOpenType()),
oldA[a].isReadable(),
oldA[a].isWritable(),
oldA[a].isIs(),
param.getDefaultValue(),
lv);
}
else
attribs[a] = new OpenMBeanAttributeInfoSupport(oldA[a].getName(),
oldA[a].getDescription(),
((OpenType<Object>)
param.getOpenType()),
oldA[a].isReadable(),
oldA[a].isWritable(),
oldA[a].isIs(),
param.getDefaultValue(),
((Comparable<Object>)
param.getMinValue()),
((Comparable<Object>)
param.getMaxValue()));
}
MBeanConstructorInfo[] oldC = info.getConstructors();
OpenMBeanConstructorInfo[] cons = new OpenMBeanConstructorInfoSupport[oldC.length];
for (int a = 0; a < oldC.length; ++a)
cons[a] =
new OpenMBeanConstructorInfoSupport(oldC[a].getName(),
oldC[a].getDescription(),
translateSignature(oldC[a].getSignature()));
MBeanOperationInfo[] oldO = info.getOperations();
OpenMBeanOperationInfo[] ops = new OpenMBeanOperationInfoSupport[oldO.length];
for (int a = 0; a < oldO.length; ++a)
ops[a] =
new OpenMBeanOperationInfoSupport(oldO[a].getName(),
oldO[a].getDescription(),
translateSignature(oldO[a].getSignature()),
Translator.translate(oldO[a].getReturnType()).getOpenType(),
oldO[a].getImpact());
openInfo = new OpenMBeanInfoSupport(info.getClassName(), info.getDescription(),
attribs, cons, ops, info.getNotifications());
}
catch (OpenDataException e)
{
throw (InternalError) (new InternalError("A problem occurred creating the open type " +
"descriptors.").initCause(e));
}
}
示例5: cacheMBeanInfo
import javax.management.openmbean.OpenMBeanConstructorInfoSupport; //导入依赖的package包/类
protected void cacheMBeanInfo(MBeanInfo info)
{
if (info == null)
return;
try
{
MBeanAttributeInfo[] oldA = info.getAttributes();
OpenMBeanAttributeInfo[] attribs =
new OpenMBeanAttributeInfoSupport[oldA.length];
for (int a = 0; a < oldA.length; ++a)
{
OpenMBeanParameterInfo param = Translator.translate(oldA[a].getType());
if (param.getMinValue() == null)
{
Object[] lv;
if (param.getLegalValues() == null)
lv = null;
else
lv = param.getLegalValues().toArray();
attribs[a] = new OpenMBeanAttributeInfoSupport(oldA[a].getName(),
oldA[a].getDescription(),
((OpenType<Object>)
param.getOpenType()),
oldA[a].isReadable(),
oldA[a].isWritable(),
oldA[a].isIs(),
param.getDefaultValue(),
lv);
}
else
attribs[a] = new OpenMBeanAttributeInfoSupport(oldA[a].getName(),
oldA[a].getDescription(),
((OpenType<Object>)
param.getOpenType()),
oldA[a].isReadable(),
oldA[a].isWritable(),
oldA[a].isIs(),
param.getDefaultValue(),
((Comparable<Object>)
param.getMinValue()),
((Comparable<Object>)
param.getMaxValue()));
}
MBeanConstructorInfo[] oldC = info.getConstructors();
OpenMBeanConstructorInfo[] cons = new OpenMBeanConstructorInfoSupport[oldC.length];
for (int a = 0; a < oldC.length; ++a)
cons[a] =
new OpenMBeanConstructorInfoSupport(oldC[a].getName(),
oldC[a].getDescription(),
translateSignature(oldC[a].getSignature()));
MBeanOperationInfo[] oldO = info.getOperations();
OpenMBeanOperationInfo[] ops = new OpenMBeanOperationInfoSupport[oldO.length];
for (int a = 0; a < oldO.length; ++a)
ops[a] =
new OpenMBeanOperationInfoSupport(oldO[a].getName(),
oldO[a].getDescription(),
translateSignature(oldO[a].getSignature()),
Translator.translate(oldO[a].getReturnType()).getOpenType(),
oldO[a].getImpact());
openInfo = new OpenMBeanInfoSupport(info.getClassName(), info.getDescription(),
attribs, cons, ops, info.getNotifications());
}
catch (OpenDataException e)
{
throw (InternalError) (new InternalError("A problem occurred creating the open type " +
"descriptors.").initCause(e));
}
}