java类javax.management.OperationsException的实例源码

JmxMBeanServer.java 文件源码 项目:openjdk9 阅读 22 收藏 0 点赞 0 评论 0
/**
 * De-serializes a byte array in the context of a given MBean class loader.
 * The class loader is the one that loaded the class with name "className".
 *
 * @param className The name of the class whose class loader should be
 *      used for the de-serialization.
 * @param data The byte array to be de-sererialized.
 *
 * @return  The de-serialized object stream.
 *
 * @exception OperationsException Any of the usual Input/Output
 *      related exceptions.
 * @exception ReflectionException The specified class could not be
 *      loaded by the default loader repository
 *
 */
@Deprecated
public ObjectInputStream deserialize(String className, byte[] data)
    throws OperationsException, ReflectionException {

    if (className == null) {
        throw new  RuntimeOperationsException(
                                    new IllegalArgumentException(),
                                    "Null className passed in parameter");
    }

    /* Permission check */
    // This call requires MBeanPermission 'getClassLoaderRepository'
    final ClassLoaderRepository clr = getClassLoaderRepository();

    Class<?> theClass;
    try {
        if (clr == null) throw new ClassNotFoundException(className);
        theClass = clr.loadClass(className);
    } catch (ClassNotFoundException e) {
        throw new ReflectionException(e,
                                      "The given class could not be " +
                                      "loaded by the default loader " +
                                      "repository");
    }

    return instantiator.deserialize(theClass.getClassLoader(), data);
}
MBeanServerAccessController.java 文件源码 项目:openjdk9 阅读 21 收藏 0 点赞 0 评论 0
/**
 * Call <code>checkRead()</code>, then forward this method to the
 * wrapped object.
 */
@Deprecated
public ObjectInputStream deserialize(ObjectName name, byte[] data)
    throws InstanceNotFoundException, OperationsException {
    checkRead();
    return getMBeanServer().deserialize(name, data);
}
MBeanServerAccessController.java 文件源码 项目:openjdk9 阅读 27 收藏 0 点赞 0 评论 0
/**
 * Call <code>checkRead()</code>, then forward this method to the
 * wrapped object.
 */
@Deprecated
public ObjectInputStream deserialize(String className, byte[] data)
    throws OperationsException, ReflectionException {
    checkRead();
    return getMBeanServer().deserialize(className, data);
}
MBeanServerAccessController.java 文件源码 项目:openjdk9 阅读 25 收藏 0 点赞 0 评论 0
/**
 * Call <code>checkRead()</code>, then forward this method to the
 * wrapped object.
 */
@Deprecated
public ObjectInputStream deserialize(String className,
                                     ObjectName loaderName,
                                     byte[] data)
    throws
    InstanceNotFoundException,
    OperationsException,
    ReflectionException {
    checkRead();
    return getMBeanServer().deserialize(className, loaderName, data);
}
KahaDBJournalsStatistics.java 文件源码 项目:amq-kahadb-tool 阅读 23 收藏 0 点赞 0 评论 0
private void showJournalStatistic(JournalStatistic journalStatistic, int fileIndex) throws OperationsException {
    System.out.printf("(%s) Journal: '%s'.\r\n", fileIndex, journalStatistic.getFile());

    if(journalStatistic.hasStatistic()) {
        showJournalDestinationStatistics(journalStatistic);
        showJournalCommandStatistics(journalStatistic);
    }

    showSeparator(2);
}
KahaDBJournalsStatistics.java 文件源码 项目:amq-kahadb-tool 阅读 29 收藏 0 点赞 0 评论 0
private void showCommandStatistics(DestinationStatistic[] destinationStatistics) throws OperationsException {
    for (DestinationStatistic destinationStatistic : destinationStatistics) {
        CommandStatistic[] commandStatistics = destinationStatistic.getCommandStatistics();
        if(destinationStatistic.hasDestinationId()) {
            System.out.println();

            String destinationRemovedStr = destinationStatistic.hasRemoved() ? "- " : "";
            String destinationInfo = getDestinationInfo(destinationStatistic.getDestinationType(), destinationStatistic.getDestinationId());
            System.out.printf("%s%s.\r\n", destinationRemovedStr, destinationInfo);
        }
        showCommandStatistics(commandStatistics);
    }
}
MemberInfoWithStatsMBean.java 文件源码 项目:gemfirexd-oss 阅读 14 收藏 0 点赞 0 评论 0
/**
 * Default Constructor
 * 
 * @param agent Admin Agent instance
 * @throws OperationsException if ObjectName can't be formed for this MBean
 * @throws MBeanRegistrationException 
 * @throws AdminException 
 */
MemberInfoWithStatsMBean(Agent agent) throws OperationsException, MBeanRegistrationException, AdminException {
  this.agent           = agent;
  this.logWriter       = this.agent.getLogWriter().convertToLogWriterI18n();
  this.objectName      = ObjectName.getInstance(MBEAN_NAME);
  this.version         = GemFireVersion.getGemFireVersion();
  this.refreshInterval = -1;
  this.id              = NOT_AVAILABLE_STR;
  this.forwarder       = new NotificationForwarder(agent.getMBeanServer(), this.logWriter);
}
MemberInfoWithStatsMBean.java 文件源码 项目:gemfirexd-oss 阅读 15 收藏 0 点赞 0 评论 0
/**
 * Connects the Admin Agent in the DS
 * 
 * @return AdminDistributedSystem MBean ObjectName
 * @throws OperationsException
 *           if connection to the DS fails
 * @throws AdminException
 *           if connection to the DS fails
 */
private ObjectName connectToSystem() throws OperationsException, AdminException {
  ObjectName adminDsObjName = agent.connectToSystem();

  AdminDistributedSystem adminDS = agent.getDistributedSystem();
  if (adminDSJmx == null && adminDS instanceof AdminDistributedSystemJmxImpl) {//instanceof checks for null
    adminDSJmx      = (AdminDistributedSystemJmxImpl) adminDS;
    refreshInterval = adminDSJmx.getRefreshInterval();
    id              = adminDSJmx.getId();
    forwarder.registerNotificationListener(adminDSJmx.getObjectName());
  }

  return adminDsObjName;
}
MemberInfoWithStatsMBean.java 文件源码 项目:gemfirexd-oss 阅读 16 收藏 0 点赞 0 评论 0
/**
 * Initializes Cache, Regions & Statistics Types MBeans for the given Member.
 * 
 * @param memberJmx
 *          Member Mbean instance
 * @throws OperationsException
 *           if fails to initialize required MBeans
 * @throws AdminException
 *           if fails to initialize required MBeans
 */
private void initializeCacheRegionsAndStats(SystemMemberJmx memberJmx) 
  throws OperationsException, AdminException {
  if (memberJmx != null) {
    SystemMemberCacheJmxImpl cache = (SystemMemberCacheJmxImpl) memberJmx.getCache();
    if (cache != null) {
      RegionSubRegionSnapshot regionSnapshot = cache.getRegionSnapshot();
      initializeRegionSubRegions(cache, regionSnapshot);
    }
    initStats(memberJmx);
  }
}
MemberInfoWithStatsMBeanDUnitTest.java 文件源码 项目:gemfirexd-oss 阅读 14 收藏 0 点赞 0 评论 0
@SuppressWarnings("rawtypes")
private Map getMemberDetailsDirect(String memberId) 
  throws OperationsException {
  logWriter.fine("Entered MemberInfoWithStatsMBeanDUnitTest.getMemberDetailsDirect() ...");
  MemberInfoWithStatsMBean memberInfoWithStatsMBean = ((AgentImpl)agent).memberInfoWithStatsMBean;
  Map<String, Object> memberDetails = memberInfoWithStatsMBean.getMemberDetails(memberId);

  logWriter.fine("Exiting MemberInfoWithStatsMBeanDUnitTest.getMemberDetailsDirect() ...");
  return memberDetails;
}


问题


面经


文章

微信
公众号

扫码关注公众号