当前位置: 首页>>代码示例>>Java>>正文


Java OpenDataException类代码示例

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


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

示例1: getSlowQueriesCD

import javax.management.openmbean.OpenDataException; //导入依赖的package包/类
/**
 * JMX operation - returns all the queries we have collected.
 * @return - the slow query report as composite data.
 */
@Override
public CompositeData[] getSlowQueriesCD() throws OpenDataException {
    CompositeDataSupport[] result = null;
    ConcurrentHashMap<String,QueryStats> queries = perPoolStats.get(poolName);
    if (queries!=null) {
        Set<Map.Entry<String,QueryStats>> stats = queries.entrySet();
        if (stats!=null) {
            result = new CompositeDataSupport[stats.size()];
            Iterator<Map.Entry<String,QueryStats>> it = stats.iterator();
            int pos = 0;
            while (it.hasNext()) {
                Map.Entry<String,QueryStats> entry = it.next();
                QueryStats qs = entry.getValue();
                result[pos++] = qs.getCompositeData(getCompositeType());
            }
        }
    }
    return result;
}
 
开发者ID:sunmingshuai,项目名称:apache-tomcat-7.0.73-with-comment,代码行数:24,代码来源:SlowQueryReportJmx.java

示例2: toCompositeData

import javax.management.openmbean.OpenDataException; //导入依赖的package包/类
/**
 * @param jobDetail
 * @return CompositeData
 */
public static CompositeData toCompositeData(JobDetail jobDetail) {
    try {
        return new CompositeDataSupport(COMPOSITE_TYPE, ITEM_NAMES,
                new Object[] {
                        jobDetail.getKey().getName(),
                        jobDetail.getKey().getGroup(),
                        jobDetail.getDescription(),
                        jobDetail.getJobClass().getName(),
                        JobDataMapSupport.toTabularData(jobDetail
                                .getJobDataMap()), 
                        jobDetail.isDurable(),
                        jobDetail.requestsRecovery(), });
    } catch (OpenDataException e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:21,代码来源:JobDetailSupport.java

示例3: toCompositeData

import javax.management.openmbean.OpenDataException; //导入依赖的package包/类
public static CompositeData toCompositeData(CronTrigger trigger) {
    try {
        return new CompositeDataSupport(COMPOSITE_TYPE, ITEM_NAMES,
                new Object[] {
                        trigger.getCronExpression(),
                        trigger.getTimeZone(),
                        trigger.getKey().getName(),
                        trigger.getKey().getGroup(),
                        trigger.getJobKey().getName(),
                        trigger.getJobKey().getGroup(),
                        trigger.getDescription(),
                        JobDataMapSupport.toTabularData(trigger
                                .getJobDataMap()),
                        trigger.getCalendarName(),
                        ((OperableTrigger)trigger).getFireInstanceId(),
                        trigger.getMisfireInstruction(),
                        trigger.getPriority(), trigger.getStartTime(),
                        trigger.getEndTime(), trigger.getNextFireTime(),
                        trigger.getPreviousFireTime(),
                        trigger.getFinalFireTime() });
    } catch (OpenDataException e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:25,代码来源:CronTriggerSupport.java

示例4: toCompositeData

import javax.management.openmbean.OpenDataException; //导入依赖的package包/类
public static CompositeData toCompositeData(SimpleTrigger trigger) {
    try {
        return new CompositeDataSupport(COMPOSITE_TYPE, ITEM_NAMES,
                new Object[] {
                        trigger.getRepeatCount(),
                        trigger.getRepeatInterval(),
                        trigger.getTimesTriggered(),
                        trigger.getKey().getName(),
                        trigger.getKey().getGroup(),
                        trigger.getJobKey().getName(),
                        trigger.getJobKey().getGroup(),
                        trigger.getDescription(),
                        JobDataMapSupport.toTabularData(trigger
                                .getJobDataMap()),
                        trigger.getCalendarName(),
                        ((OperableTrigger)trigger).getFireInstanceId(),
                        trigger.getMisfireInstruction(),
                        trigger.getPriority(), trigger.getStartTime(),
                        trigger.getEndTime(), trigger.getNextFireTime(),
                        trigger.getPreviousFireTime(),
                        trigger.getFinalFireTime() });
    } catch (OpenDataException e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:26,代码来源:SimpleTriggerSupport.java

示例5: toCompositeData

import javax.management.openmbean.OpenDataException; //导入依赖的package包/类
public static CompositeData toCompositeData(Trigger trigger) {
    try {
        return new CompositeDataSupport(COMPOSITE_TYPE, ITEM_NAMES,
                new Object[] {
                        trigger.getKey().getName(),
                        trigger.getKey().getGroup(),
                        trigger.getJobKey().getName(),
                        trigger.getJobKey().getGroup(),
                        trigger.getDescription(),
                        JobDataMapSupport.toTabularData(trigger
                                .getJobDataMap()),
                        trigger.getCalendarName(),
                        ((OperableTrigger)trigger).getFireInstanceId(),
                        trigger.getMisfireInstruction(),
                        trigger.getPriority(), trigger.getStartTime(),
                        trigger.getEndTime(), trigger.getNextFireTime(),
                        trigger.getPreviousFireTime(),
                        trigger.getFinalFireTime() });
    } catch (OpenDataException e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:23,代码来源:TriggerSupport.java

示例6: toCompositeData

import javax.management.openmbean.OpenDataException; //导入依赖的package包/类
/**
 * @param jobDetail
 * @return CompositeData
 */
public static CompositeData toCompositeData(JobDetail jobDetail) {
	try {
		return new CompositeDataSupport(COMPOSITE_TYPE, ITEM_NAMES,
				new Object[] {
						jobDetail.getName(),
						jobDetail.getGroup(),
						jobDetail.getDescription(),
						jobDetail.getJobClass().getName(),
						JobDataMapSupport.toTabularData(jobDetail
								.getJobDataMap()), jobDetail.isVolatile(),
						jobDetail.isDurable(),
						jobDetail.requestsRecovery(), });
	} catch (OpenDataException e) {
		throw new RuntimeException(e);
	}
}
 
开发者ID:AsuraTeam,项目名称:asura,代码行数:21,代码来源:JobDetailSupport.java

示例7: getCompositeData

import javax.management.openmbean.OpenDataException; //导入依赖的package包/类
protected CompositeData getCompositeData() {
    // CONTENTS OF THIS ARRAY MUST BE SYNCHRONIZED WITH
    // gcNotifInfoItemNames!
    final Object[] gcNotifInfoItemValues;
    gcNotifInfoItemValues = new Object[] {
        gcNotifInfo.getGcName(),
        gcNotifInfo.getGcAction(),
        gcNotifInfo.getGcCause(),
        GcInfoCompositeData.toCompositeData(gcNotifInfo.getGcInfo())
    };

    CompositeType gict = getCompositeTypeByBuilder();

    try {
        return new CompositeDataSupport(gict,
                                        gcNotifInfoItemNames,
                                        gcNotifInfoItemValues);
    } catch (OpenDataException e) {
        // Should never reach here
        throw new AssertionError(e);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:23,代码来源:GarbageCollectionNotifInfoCompositeData.java

示例8: getCompositeData

import javax.management.openmbean.OpenDataException; //导入依赖的package包/类
protected CompositeData getCompositeData() {
    // CONTENTS OF THIS ARRAY MUST BE SYNCHRONIZED WITH
    // stackTraceElementItemNames!
    final Object[] stackTraceElementItemValues = {
        ste.getClassName(),
        ste.getMethodName(),
        ste.getFileName(),
        new Integer(ste.getLineNumber()),
        new Boolean(ste.isNativeMethod()),
    };
    try {
        return new CompositeDataSupport(stackTraceElementCompositeType,
                                        stackTraceElementItemNames,
                                        stackTraceElementItemValues);
    } catch (OpenDataException e) {
        // Should never reach here
        throw new AssertionError(e);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:StackTraceElementCompositeData.java

示例9: getCompositeData

import javax.management.openmbean.OpenDataException; //导入依赖的package包/类
protected CompositeData getCompositeData() {
    // CONTENTS OF THIS ARRAY MUST BE SYNCHRONIZED WITH
    // lockInfoItemNames!
    final Object[] lockInfoItemValues = {
        new String(lock.getClassName()),
        new Integer(lock.getIdentityHashCode()),
    };

    try {
        return new CompositeDataSupport(lockInfoCompositeType,
                                        lockInfoItemNames,
                                        lockInfoItemValues);
    } catch (OpenDataException e) {
        // Should never reach here
        throw Util.newException(e);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:LockInfoCompositeData.java

示例10: getCompositeData

import javax.management.openmbean.OpenDataException; //导入依赖的package包/类
protected CompositeData getCompositeData() {
    // CONTENTS OF THIS ARRAY MUST BE SYNCHRONIZED WITH
    // vmOptionItemNames!
    final Object[] vmOptionItemValues = {
        option.getName(),
        option.getValue(),
        new Boolean(option.isWriteable()),
        option.getOrigin().toString(),
    };

    try {
        return new CompositeDataSupport(vmOptionCompositeType,
                                        vmOptionItemNames,
                                        vmOptionItemValues);
    } catch (OpenDataException e) {
        // Should never reach here
        throw new AssertionError(e);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:VMOptionCompositeData.java

示例11: getCompositeData

import javax.management.openmbean.OpenDataException; //导入依赖的package包/类
protected CompositeData getCompositeData() {
    // CONTENTS OF THIS ARRAY MUST BE SYNCHRONIZED WITH
    // memoryNotifInfoItemNames!
    final Object[] memoryNotifInfoItemValues = {
        memoryNotifInfo.getPoolName(),
        MemoryUsageCompositeData.toCompositeData(memoryNotifInfo.getUsage()),
        new Long(memoryNotifInfo.getCount()),
    };

    try {
        return new CompositeDataSupport(memoryNotifInfoCompositeType,
                                        memoryNotifInfoItemNames,
                                        memoryNotifInfoItemValues);
    } catch (OpenDataException e) {
        // Should never reach here
        throw new AssertionError(e);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:MemoryNotifInfoCompositeData.java

示例12: toNonNullOpenValue

import javax.management.openmbean.OpenDataException; //导入依赖的package包/类
@Override
final Object toNonNullOpenValue(Object value)
        throws OpenDataException {
    final Collection<?> valueCollection = (Collection<?>) value;
    if (valueCollection instanceof SortedSet<?>) {
        Comparator<?> comparator =
            ((SortedSet<?>) valueCollection).comparator();
        if (comparator != null) {
            final String msg =
                "Cannot convert SortedSet with non-null comparator: " +
                comparator;
            throw openDataException(msg, new IllegalArgumentException(msg));
        }
    }
    final Object[] openArray = (Object[])
        Array.newInstance(getOpenClass().getComponentType(),
                          valueCollection.size());
    int i = 0;
    for (Object o : valueCollection)
        openArray[i++] = elementMapping.toOpenValue(o);
    return openArray;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:23,代码来源:DefaultMXBeanMappingFactory.java

示例13: CompositeMapping

import javax.management.openmbean.OpenDataException; //导入依赖的package包/类
CompositeMapping(Class<?> targetClass,
                 CompositeType compositeType,
                 String[] itemNames,
                 Method[] getters,
                 MXBeanMappingFactory factory) throws OpenDataException {
    super(targetClass, compositeType);

    assert(itemNames.length == getters.length);

    this.itemNames = itemNames;
    this.getters = getters;
    this.getterMappings = new MXBeanMapping[getters.length];
    for (int i = 0; i < getters.length; i++) {
        Type retType = getters[i].getGenericReturnType();
        getterMappings[i] = factory.mappingForType(retType, factory);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:DefaultMXBeanMappingFactory.java

示例14: getOpenType

import javax.management.openmbean.OpenDataException; //导入依赖的package包/类
@Override
public CompositeType getOpenType() {
    final String description = getNullableDescription() == null ? getAttributeYangName() : getNullableDescription();

    final FunctionImpl functionImpl = new FunctionImpl();
    final Map<String, AttributeIfc> jmxPropertiesToTypesMap = getJmxPropertiesToTypesMap();
    final OpenType<?>[] itemTypes = Collections2.transform(
            jmxPropertiesToTypesMap.entrySet(), functionImpl).toArray(
            new OpenType<?>[] {});
    final String[] itemNames = functionImpl.getItemNames();
    try {
        // TODO add package name to create fully qualified name for this
        // type
        final CompositeType compositeType = new CompositeType(
                getUpperCaseCammelCase(), description, itemNames,
                itemNames, itemTypes);
        return compositeType;
    } catch (final OpenDataException e) {
        throw new RuntimeException("Unable to create CompositeType for "
                + this, e);
    }
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:23,代码来源:TOAttribute.java

示例15: toNonNullOpenValue

import javax.management.openmbean.OpenDataException; //导入依赖的package包/类
final Object toNonNullOpenValue(Object value) throws OpenDataException {
  final Collection valueCollection = (Collection) value;
  if (valueCollection instanceof SortedSet) {
    Comparator comparator = ((SortedSet) valueCollection).comparator();
    if (comparator != null) {
      final String msg = "Cannot convert SortedSet with non-null comparator: " + comparator;
      throw openDataException(msg, new IllegalArgumentException(msg));
    }
  }
  final Object[] openArray =
      (Object[]) Array.newInstance(getOpenClass().getComponentType(), valueCollection.size());
  int i = 0;
  for (Object o : valueCollection)
    openArray[i++] = elementConverter.toOpenValue(o);
  return openArray;
}
 
开发者ID:ampool,项目名称:monarch,代码行数:17,代码来源:CollectionConverter.java


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