• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java OpenMBeanParameterInfoSupport类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: customize

import javax.management.openmbean.OpenMBeanParameterInfoSupport; //导入依赖的package包/类
private static MBeanParameterInfo
        customize(MBeanParameterInfo pi,
                  String name,
                  String description) {
    if (equal(name, pi.getName()) &&
            equal(description, pi.getDescription()))
        return pi;
    else if (pi instanceof OpenMBeanParameterInfo) {
        OpenMBeanParameterInfo opi = (OpenMBeanParameterInfo) pi;
        return new OpenMBeanParameterInfoSupport(name,
                                                 description,
                                                 opi.getOpenType(),
                                                 pi.getDescriptor());
    } else {
        return new MBeanParameterInfo(name,
                                      pi.getType(),
                                      description,
                                      pi.getDescriptor());
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:StandardMBean.java


示例2: getMBeanInfo

import javax.management.openmbean.OpenMBeanParameterInfoSupport; //导入依赖的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;
}
 
开发者ID:mevdschee,项目名称:tqdev-metrics,代码行数:21,代码来源:JmxReporter.java


示例3: paramsToOpenParams

import javax.management.openmbean.OpenMBeanParameterInfoSupport; //导入依赖的package包/类
private static OpenMBeanParameterInfo[]
        paramsToOpenParams(MBeanParameterInfo[] params) {
    if (params instanceof OpenMBeanParameterInfo[])
        return (OpenMBeanParameterInfo[]) params;
    OpenMBeanParameterInfo[] oparams =
        new OpenMBeanParameterInfoSupport[params.length];
    System.arraycopy(params, 0, oparams, 0, params.length);
    return oparams;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:StandardMBean.java


示例4: translateSignature

import javax.management.openmbean.OpenMBeanParameterInfoSupport; //导入依赖的package包/类
private OpenMBeanParameterInfo[] translateSignature(MBeanParameterInfo[] oldS)
  throws OpenDataException
{
  OpenMBeanParameterInfo[] sig = new OpenMBeanParameterInfoSupport[oldS.length];
  for (int a = 0; a < oldS.length; ++a)
    {
      OpenMBeanParameterInfo param = Translator.translate(oldS[a].getType());
      if (param.getMinValue() == null)
        {
          Object[] lv;
          if (param.getLegalValues() == null)
            lv = null;
          else
            lv = param.getLegalValues().toArray();
          sig[a] = new OpenMBeanParameterInfoSupport(oldS[a].getName(),
                                                     oldS[a].getDescription(),
                                                     ((OpenType<Object>)
                                                      param.getOpenType()),
                                                     param.getDefaultValue(),
                                                     lv);
        }
      else
        sig[a] = new OpenMBeanParameterInfoSupport(oldS[a].getName(),
                                                   oldS[a].getDescription(),
                                                   ((OpenType<Object>)
                                                    param.getOpenType()),
                                                   param.getDefaultValue(),
                                                   ((Comparable<Object>)
                                                    param.getMinValue()),
                                                   ((Comparable<Object>)
                                                    param.getMaxValue()));
    }
  return sig;
}
 
开发者ID:vilie,项目名称:javify,代码行数:35,代码来源:BeanImpl.java


示例5: translateSignature

import javax.management.openmbean.OpenMBeanParameterInfoSupport; //导入依赖的package包/类
private OpenMBeanParameterInfo[] translateSignature(MBeanParameterInfo[] oldS)
   throws OpenDataException
 {
   OpenMBeanParameterInfo[] sig = new OpenMBeanParameterInfoSupport[oldS.length];
   for (int a = 0; a < oldS.length; ++a)
     {
OpenMBeanParameterInfo param = Translator.translate(oldS[a].getType());
if (param.getMinValue() == null)
  {
    Object[] lv;
    if (param.getLegalValues() == null)
      lv = null;
    else
      lv = param.getLegalValues().toArray();
    sig[a] = new OpenMBeanParameterInfoSupport(oldS[a].getName(),
					       oldS[a].getDescription(),
					       ((OpenType<Object>)
						param.getOpenType()),
					       param.getDefaultValue(),
					       lv);
  }
else
  sig[a] = new OpenMBeanParameterInfoSupport(oldS[a].getName(),
					     oldS[a].getDescription(),
					     ((OpenType<Object>)
					      param.getOpenType()),
					     param.getDefaultValue(),
					     ((Comparable<Object>)
					      param.getMinValue()),
					     ((Comparable<Object>)
					      param.getMaxValue()));
     }
   return sig;
 }
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:35,代码来源:BeanImpl.java


示例6: getMBeanInfo

import javax.management.openmbean.OpenMBeanParameterInfoSupport; //导入依赖的package包/类
public MBeanInfo getMBeanInfo() {
    OpenMBeanParameterInfoSupport parameterInfoSupport = new OpenMBeanParameterInfoSupport(
        "par name", "descripttiosdf", SimpleType.STRING);
    OpenMBeanOperationInfo infoSupport = new OpenMBeanOperationInfoSupport(
        operationName, "desciption",
        new OpenMBeanParameterInfo[] { parameterInfoSupport },
        SimpleType.STRING, MBeanOperationInfo.ACTION);
    OpenMBeanAttributeInfoSupport attributeInfo = new OpenMBeanAttributeInfoSupport(
        attrName, "description", SimpleType.STRING, true, true, false);
    OpenMBeanInfoSupport beanInfoSupport = new OpenMBeanInfoSupport(this
        .getClass().getName(), "descriptor",
        new OpenMBeanAttributeInfo[] { attributeInfo }, null,
        new OpenMBeanOperationInfo[] { infoSupport }, null);
    return beanInfoSupport;
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:16,代码来源:RegistringOpenMBeanTest.java


示例7: createMBeanOperationInfo

import javax.management.openmbean.OpenMBeanParameterInfoSupport; //导入依赖的package包/类
/**
 * The operations are pulled from the core cache and the member regions.
 * @param cache 
 *
 */
private OpenMBeanOperationInfo[] createMBeanOperationInfo()
{
	List<OpenMBeanOperationInfo> operations = new ArrayList<OpenMBeanOperationInfo>();
	
	for(Cache cache : getKnownCaches())
	{
		if(cache != null && !cache.isInitialized())
			operations.add(
	     		new OpenMBeanOperationInfoSupport(initializePrefix + cache.getName(), 
	     				"Initialize the cache (root directory must be set first) \n" +
	     				"This action is ignored if the cache is initialized.\n" + 
	     				"If the cache has been started with a valid configuration state available \n" +
	     				"it will start in an initialized state.  Changes to configuration will then require a restart of the server.", 
	     				new OpenMBeanParameterInfo[]{}, 
	     				SimpleType.VOID, MBeanOperationInfo.ACTION)
	     	);

		if(cache != null && cache.isInitialized() && !cache.isEnabled() )
			operations.add(
	     		new OpenMBeanOperationInfoSupport(enablePrefix + cache.getName(), 
	     				"Enable the cache (cache must be initialized)", 
	     				new OpenMBeanParameterInfo[]{}, 
	     				SimpleType.VOID, MBeanOperationInfo.ACTION)
	     	);
		
		else if(cache != null && cache.isEnabled())
			operations.add(
	     		new OpenMBeanOperationInfoSupport(disablePrefix + cache.getName(), 
	     				"Disable the cache (cache must be initialized and enabled)", 
	     				new OpenMBeanParameterInfo[]{}, 
	     				SimpleType.VOID, MBeanOperationInfo.ACTION)
	     	);
	}
	
	operations.add(
     		new OpenMBeanOperationInfoSupport(storeOperation, 
     				"Store the named cache configuration to persistent storage", 
     				new OpenMBeanParameterInfo[]{new OpenMBeanParameterInfoSupport("name", "the bname of the cache to save configuration of", SimpleType.STRING)}, 
     				SimpleType.VOID, MBeanOperationInfo.ACTION)
     	);
	
	operations.add(
     		new OpenMBeanOperationInfoSupport(storeAllOperation, 
     				"Store all current cache configuration to persistent storage", 
     				new OpenMBeanParameterInfo[]{}, 
     				SimpleType.VOID, MBeanOperationInfo.ACTION)
     	);
	
	operations.add(
    		new OpenMBeanOperationInfoSupport(createOperation, 
    				"Create a new cache at the specified location.", 
				new OpenMBeanParameterInfo[]
				{
					new OpenMBeanParameterInfoSupport("cacheName", "The name of the cache (and the root of the configuration file name)", SimpleType.STRING),
					new OpenMBeanParameterInfoSupport("cacheLocation", "The URI of the cache location (e.g. 'file:///vix/cache' or 'smb://server/cacheroot')", SimpleType.STRING),
					new OpenMBeanParameterInfoSupport("prototypeName", "The name of the prototype or blank(e.g. 'VixPrototype', 'TestWithEvictionPrototype')", SimpleType.STRING)
				}, 
				SimpleType.STRING, 
				MBeanOperationInfo.ACTION)
    	);
	
	return operations.toArray(new OpenMBeanOperationInfoSupport[operations.size()]);
}
 
开发者ID:VHAINNOVATIONS,项目名称:Telepathology,代码行数:69,代码来源:CacheManagerImpl.java


示例8: getParameterInfos

import javax.management.openmbean.OpenMBeanParameterInfoSupport; //导入依赖的package包/类
private OpenMBeanParameterInfo[] getParameterInfos(ModelNode opNode) {
    if (!opNode.hasDefined(REQUEST_PROPERTIES)) {
        return EMPTY_PARAMETERS;
    }
    List<Property> propertyList = opNode.get(REQUEST_PROPERTIES).asPropertyList();
    List<OpenMBeanParameterInfo> params = new ArrayList<OpenMBeanParameterInfo>(propertyList.size());

    for (Property prop : propertyList) {
        ModelNode value = prop.getValue();
        String paramName = NameConverter.convertToCamelCase(prop.getName());

        Map<String, Object> descriptions = new HashMap<String, Object>(4);

        boolean expressionsAllowed = prop.getValue().hasDefined(EXPRESSIONS_ALLOWED) && prop.getValue().get(EXPRESSIONS_ALLOWED).asBoolean();
        descriptions.put(DESC_EXPRESSIONS_ALLOWED, String.valueOf(expressionsAllowed));

        if (!expressionsAllowed) {
            Object defaultValue = getIfExists(value, DEFAULT);
            descriptions.put(DEFAULT_VALUE_FIELD, defaultValue);
            if (value.has(ALLOWED)) {
                if (value.get(TYPE).asType()!=ModelType.LIST){
                    List<ModelNode> allowed = value.get(ALLOWED).asList();
                    descriptions.put(LEGAL_VALUES_FIELD, fromModelNodes(allowed));
                }
            } else {
                if (value.has(MIN)) {
                    Comparable minC = getIfExistsAsComparable(value, MIN);
                    if (minC instanceof Number) {
                        descriptions.put(MIN_VALUE_FIELD, minC);
                    }
                }
                if (value.has(MAX)) {
                    Comparable maxC = getIfExistsAsComparable(value, MAX);
                    if (maxC instanceof Number) {
                        descriptions.put(MAX_VALUE_FIELD, maxC);
                    }
                }
            }
        }


        params.add(
                new OpenMBeanParameterInfoSupport(
                        paramName,
                        getDescription(prop.getValue()),
                        converters.convertToMBeanType(value),
                        new ImmutableDescriptor(descriptions)));

    }
    return params.toArray(new OpenMBeanParameterInfo[params.size()]);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:52,代码来源:MBeanInfoFactory.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java IndentingWriter类代码示例发布时间:2022-05-21
下一篇:
Java CommandResponderEvent类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap