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

RMIConnector.java 文件源码 项目:OpenJSharp 阅读 31 收藏 0 点赞 0 评论 0
public MBeanInfo getMBeanInfo(ObjectName name)
throws InstanceNotFoundException,
        IntrospectionException,
        ReflectionException,
        IOException {

    if (logger.debugOn()) logger.debug("getMBeanInfo", "name=" + name);
    final ClassLoader old = pushDefaultClassLoader();
    try {
        return connection.getMBeanInfo(name, delegationSubject);
    } catch (IOException ioe) {
        communicatorAdmin.gotIOException(ioe);

        return connection.getMBeanInfo(name, delegationSubject);
    } finally {
        popDefaultClassLoader(old);
    }
}
RMIConnector.java 文件源码 项目:jdk8u-jdk 阅读 26 收藏 0 点赞 0 评论 0
public MBeanInfo getMBeanInfo(ObjectName name)
throws InstanceNotFoundException,
        IntrospectionException,
        ReflectionException,
        IOException {

    if (logger.debugOn()) logger.debug("getMBeanInfo", "name=" + name);
    final ClassLoader old = pushDefaultClassLoader();
    try {
        return connection.getMBeanInfo(name, delegationSubject);
    } catch (IOException ioe) {
        communicatorAdmin.gotIOException(ioe);

        return connection.getMBeanInfo(name, delegationSubject);
    } finally {
        popDefaultClassLoader(old);
    }
}
RMIConnector.java 文件源码 项目:openjdk-jdk10 阅读 25 收藏 0 点赞 0 评论 0
public MBeanInfo getMBeanInfo(ObjectName name)
throws InstanceNotFoundException,
        IntrospectionException,
        ReflectionException,
        IOException {

    if (logger.debugOn()) logger.debug("getMBeanInfo", "name=" + name);
    final ClassLoader old = pushDefaultClassLoader();
    try {
        return connection.getMBeanInfo(name, delegationSubject);
    } catch (IOException ioe) {
        communicatorAdmin.gotIOException(ioe);

        return connection.getMBeanInfo(name, delegationSubject);
    } finally {
        popDefaultClassLoader(old);
    }
}
JmxNetworkManagerTest.java 文件源码 项目:Byter 阅读 29 收藏 0 点赞 0 评论 0
/**
 * Tests if buffer sizes are changeable via invoke function.
 * @throws IOException IOException
 * @throws IntrospectionException IntrospectionException
 * @throws InstanceNotFoundException InstanceNotFoundException
 * @throws ReflectionException ReflectionException
 */
@Test
public void testInvokeChangeBufferSize() throws IOException, IntrospectionException, InstanceNotFoundException, ReflectionException {
    //connect to server
    final JMXConnector connection = JmxConnectionHelper.buildJmxMPConnector(JMXSERVERIP,serverObj.getConnectorSystemPort());
    //get MBeanServerConnection
    MBeanServerConnection mbsConnection = JmxServerHelper.getMBeanServer(connection);
    //check if mbeans are registered
    Assert.assertNotSame(0,mbsConnection.getMBeanCount());
    //do actual test
    ObjectName networkManagerOn = JmxServerHelper.findObjectName(mbsConnection,"de.b4sh.byter","NetworkManager");
    //change writer buffer size
    int networkBufferSizeOLD = JmxServerHelper.getNetworkManagerNetworkBufferSize(mbsConnection,networkManagerOn);
    int writerBufferSizeOLD =  JmxServerHelper.getNetworkManagerWriterBufferSize(mbsConnection,networkManagerOn);
    JmxServerHelper.setNetworkManagerNetworkBufferSize(mbsConnection,networkManagerOn,1337);
    JmxServerHelper.setNetworkManagerWriterBufferSize(mbsConnection,networkManagerOn,1337);
    int networkBufferSize = JmxServerHelper.getNetworkManagerNetworkBufferSize(mbsConnection,networkManagerOn);
    int writerBufferSize =  JmxServerHelper.getNetworkManagerWriterBufferSize(mbsConnection,networkManagerOn);
    Assert.assertNotEquals(networkBufferSize,networkBufferSizeOLD);
    Assert.assertNotEquals(writerBufferSize,writerBufferSizeOLD);
    Assert.assertEquals(networkBufferSize,1337);
    Assert.assertEquals(writerBufferSize,1337);
}
RMIConnector.java 文件源码 项目:openjdk9 阅读 28 收藏 0 点赞 0 评论 0
public MBeanInfo getMBeanInfo(ObjectName name)
throws InstanceNotFoundException,
        IntrospectionException,
        ReflectionException,
        IOException {

    if (logger.debugOn()) logger.debug("getMBeanInfo", "name=" + name);
    final ClassLoader old = pushDefaultClassLoader();
    try {
        return connection.getMBeanInfo(name, delegationSubject);
    } catch (IOException ioe) {
        communicatorAdmin.gotIOException(ioe);

        return connection.getMBeanInfo(name, delegationSubject);
    } finally {
        popDefaultClassLoader(old);
    }
}
RMIConnector.java 文件源码 项目:Java8CN 阅读 31 收藏 0 点赞 0 评论 0
public MBeanInfo getMBeanInfo(ObjectName name)
throws InstanceNotFoundException,
        IntrospectionException,
        ReflectionException,
        IOException {

    if (logger.debugOn()) logger.debug("getMBeanInfo", "name=" + name);
    final ClassLoader old = pushDefaultClassLoader();
    try {
        return connection.getMBeanInfo(name, delegationSubject);
    } catch (IOException ioe) {
        communicatorAdmin.gotIOException(ioe);

        return connection.getMBeanInfo(name, delegationSubject);
    } finally {
        popDefaultClassLoader(old);
    }
}
ElasticsearchBenchmarkToolMain.java 文件源码 项目:elasticsearch-benchmark-tool 阅读 25 收藏 0 点赞 0 评论 0
private static void registerMbeans() {
    try {
        MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();

        IndexingMbean indexingMbean = IndexingMbean.getInstance();
        SearchMbean searchMbean = SearchMbean.getInstance();
        GeneralMbean generalMbean = GeneralMbean.getInstance();

        JMXBeanWrapper indexingMbeanWrapper = new JMXBeanWrapper(indexingMbean);
        JMXBeanWrapper searchMbeanWrapper = new JMXBeanWrapper(searchMbean);
        JMXBeanWrapper generalMbeanWrapper = new JMXBeanWrapper(generalMbean);

        mbs.registerMBean(indexingMbeanWrapper, new ObjectName("io.logz.benchmarks.elasticsearch:type=Indexing,name=Indexing Metrics"));
        mbs.registerMBean(searchMbeanWrapper, new ObjectName("io.logz.benchmarks.elasticsearch:type=Search,name=Search Metrics"));
        mbs.registerMBean(generalMbeanWrapper, new ObjectName("io.logz.benchmarks.elasticsearch:type=General,name=General Metrics"));

    } catch (IntrospectionException | MalformedObjectNameException | NotCompliantMBeanException |
            InstanceAlreadyExistsException | MBeanRegistrationException e) {
        throw new RuntimeException("Could not initialize JMX metrics!", e);
    }
}
TenantAwareChainingUserRegistrySynchronizer.java 文件源码 项目:alfresco-mt-support 阅读 22 收藏 0 点赞 0 评论 0
protected void logPluginConfig(final String id)
{
    try
    {
        final StringBuilder nameBuff = new StringBuilder(200)
                .append("Alfresco:Type=Configuration,Category=Authentication,id1=managed,id2=").append(URLDecoder.decode(id, "UTF-8"));
        final ObjectName name = new ObjectName(nameBuff.toString());
        if (this.mbeanServer != null && this.mbeanServer.isRegistered(name))
        {
            final MBeanInfo info = this.mbeanServer.getMBeanInfo(name);
            final MBeanAttributeInfo[] attributes = info.getAttributes();
            LOGGER.debug("{} attributes:", id);
            for (final MBeanAttributeInfo attribute : attributes)
            {
                final Object value = this.mbeanServer.getAttribute(name, attribute.getName());
                LOGGER.debug("{} = {}", attribute.getName(), value);
            }
        }
    }
    catch (final MalformedObjectNameException | InstanceNotFoundException | IntrospectionException | AttributeNotFoundException
            | ReflectionException | MBeanException | IOException e)
    {
        LOGGER.warn("Exception during logging", e);
    }
}
EndpointMBeanExportAutoConfigurationTests.java 文件源码 项目:https-github.com-g0t4-jenkins2-course-spring-boot 阅读 28 收藏 0 点赞 0 评论 0
@Test
public void testEndpointMBeanExporterWithProperties() throws IntrospectionException,
        InstanceNotFoundException, MalformedObjectNameException, ReflectionException {
    MockEnvironment environment = new MockEnvironment();
    environment.setProperty("endpoints.jmx.domain", "test-domain");
    environment.setProperty("endpoints.jmx.unique_names", "true");
    environment.setProperty("endpoints.jmx.static_names", "key1=value1, key2=value2");
    this.context = new AnnotationConfigApplicationContext();
    this.context.setEnvironment(environment);
    this.context.register(JmxAutoConfiguration.class, EndpointAutoConfiguration.class,
            EndpointMBeanExportAutoConfiguration.class);
    this.context.refresh();
    this.context.getBean(EndpointMBeanExporter.class);

    MBeanExporter mbeanExporter = this.context.getBean(EndpointMBeanExporter.class);
    assertThat(mbeanExporter.getServer().getMBeanInfo(ObjectNameManager.getInstance(
            getObjectName("test-domain", "healthEndpoint", this.context).toString()
                    + ",key1=value1,key2=value2"))).isNotNull();
}
RMIConnector.java 文件源码 项目:jdk8u_jdk 阅读 25 收藏 0 点赞 0 评论 0
public MBeanInfo getMBeanInfo(ObjectName name)
throws InstanceNotFoundException,
        IntrospectionException,
        ReflectionException,
        IOException {

    if (logger.debugOn()) logger.debug("getMBeanInfo", "name=" + name);
    final ClassLoader old = pushDefaultClassLoader();
    try {
        return connection.getMBeanInfo(name, delegationSubject);
    } catch (IOException ioe) {
        communicatorAdmin.gotIOException(ioe);

        return connection.getMBeanInfo(name, delegationSubject);
    } finally {
        popDefaultClassLoader(old);
    }
}
RMIConnector.java 文件源码 项目:lookaside_java-1.8.0-openjdk 阅读 28 收藏 0 点赞 0 评论 0
public MBeanInfo getMBeanInfo(ObjectName name)
throws InstanceNotFoundException,
        IntrospectionException,
        ReflectionException,
        IOException {

    if (logger.debugOn()) logger.debug("getMBeanInfo", "name=" + name);
    final ClassLoader old = pushDefaultClassLoader();
    try {
        return connection.getMBeanInfo(name, delegationSubject);
    } catch (IOException ioe) {
        communicatorAdmin.gotIOException(ioe);

        return connection.getMBeanInfo(name, delegationSubject);
    } finally {
        popDefaultClassLoader(old);
    }
}
CARBON15928JMXDisablingTest.java 文件源码 项目:product-ei 阅读 21 收藏 0 点赞 0 评论 0
private MBeanInfo testMBeanForDatasource() throws Exception {
    Map<String, String[]> env = new HashMap<>();
    String[] credentials = { "admin", "admin" };
    env.put(JMXConnector.CREDENTIALS, credentials);
    try {
        String url = "service:jmx:rmi://localhost:12311/jndi/rmi://localhost:11199/jmxrmi";
        JMXServiceURL jmxUrl = new JMXServiceURL(url);
        JMXConnector jmxConnector = JMXConnectorFactory.connect(jmxUrl, env);
        MBeanServerConnection mBeanServer = jmxConnector.getMBeanServerConnection();
        ObjectName mbeanObject = new ObjectName(dataSourceName + ",-1234:type=DataSource");
        MBeanInfo mBeanInfo = mBeanServer.getMBeanInfo(mbeanObject);
        return mBeanInfo;
    } catch (MalformedURLException | MalformedObjectNameException | IntrospectionException |
            ReflectionException e) {
        throw new AxisFault("Error while connecting to MBean Server " + e.getMessage(), e);
    }
}
EndpointMBeanExportAutoConfigurationTests.java 文件源码 项目:spring-boot-concourse 阅读 27 收藏 0 点赞 0 评论 0
@Test
public void testEndpointMBeanExporterWithProperties() throws IntrospectionException,
        InstanceNotFoundException, MalformedObjectNameException, ReflectionException {
    MockEnvironment environment = new MockEnvironment();
    environment.setProperty("endpoints.jmx.domain", "test-domain");
    environment.setProperty("endpoints.jmx.unique_names", "true");
    environment.setProperty("endpoints.jmx.static_names", "key1=value1, key2=value2");
    this.context = new AnnotationConfigApplicationContext();
    this.context.setEnvironment(environment);
    this.context.register(JmxAutoConfiguration.class, EndpointAutoConfiguration.class,
            EndpointMBeanExportAutoConfiguration.class);
    this.context.refresh();
    this.context.getBean(EndpointMBeanExporter.class);

    MBeanExporter mbeanExporter = this.context.getBean(EndpointMBeanExporter.class);
    assertThat(mbeanExporter.getServer().getMBeanInfo(ObjectNameManager.getInstance(
            getObjectName("test-domain", "healthEndpoint", this.context).toString()
                    + ",key1=value1,key2=value2"))).isNotNull();
}
AgentMonitoringView.java 文件源码 项目:parfait 阅读 18 收藏 0 点赞 0 评论 0
private String checkAttributeName(ObjectName mBeanName, String attributeName) throws UnsupportedOperationException, InstanceNotFoundException, IntrospectionException, ReflectionException, IOException {
    MBeanInfo beanInfo = server.getMBeanInfo(mBeanName);
    MBeanAttributeInfo monitoredAttribute = null;
    MBeanAttributeInfo[] attributes = beanInfo.getAttributes();
    for (MBeanAttributeInfo attribute : attributes) {
        if (attribute.getName().equals(attributeName)) {
            monitoredAttribute = attribute;
            break;
        }
    }
    if (monitoredAttribute == null) {
        throw new UnsupportedOperationException("MBean [" + mBeanName +
                "] has no attribute named [" + attributeName + "]");
    }
    return monitoredAttribute.getType();
}
EndpointMBeanExportAutoConfigurationTests.java 文件源码 项目:contestparser 阅读 26 收藏 0 点赞 0 评论 0
@Test
public void testEndpointMBeanExporterWithProperties() throws IntrospectionException,
        InstanceNotFoundException, MalformedObjectNameException, ReflectionException {
    MockEnvironment environment = new MockEnvironment();
    environment.setProperty("endpoints.jmx.domain", "test-domain");
    environment.setProperty("endpoints.jmx.unique_names", "true");
    environment.setProperty("endpoints.jmx.static_names", "key1=value1, key2=value2");
    this.context = new AnnotationConfigApplicationContext();
    this.context.setEnvironment(environment);
    this.context.register(JmxAutoConfiguration.class, EndpointAutoConfiguration.class,
            EndpointMBeanExportAutoConfiguration.class);
    this.context.refresh();
    this.context.getBean(EndpointMBeanExporter.class);

    MBeanExporter mbeanExporter = this.context.getBean(EndpointMBeanExporter.class);

    assertNotNull(mbeanExporter.getServer()
            .getMBeanInfo(ObjectNameManager.getInstance(
                    getObjectName("test-domain", "healthEndpoint", this.context)
                            .toString() + ",key1=value1,key2=value2")));
}
EndpointMBeanExportAutoConfigurationTests.java 文件源码 项目:contestparser 阅读 30 收藏 0 点赞 0 评论 0
@Test
public void testEndpointMBeanExporterInParentChild() throws IntrospectionException,
        InstanceNotFoundException, MalformedObjectNameException, ReflectionException {
    this.context = new AnnotationConfigApplicationContext();
    this.context.register(JmxAutoConfiguration.class, EndpointAutoConfiguration.class,
            EndpointMBeanExportAutoConfiguration.class);

    AnnotationConfigApplicationContext parent = new AnnotationConfigApplicationContext();
    parent.register(JmxAutoConfiguration.class, EndpointAutoConfiguration.class,
            EndpointMBeanExportAutoConfiguration.class);
    this.context.setParent(parent);

    parent.refresh();
    this.context.refresh();

    parent.close();
}
RMRest.java 文件源码 项目:scheduling 阅读 25 收藏 0 点赞 0 评论 0
/**
 * Retrieves attributes of the specified mbean.
 * 
 * @param sessionId current session
 * @param nodeJmxUrl mbean server url
 * @param objectName name of mbean
 * @param attrs set of mbean attributes
 * 
 * @return mbean attributes values
 */
@Override
@GET
@GZIP
@Produces("application/json")
@Path("node/mbean")
public Object getNodeMBeanInfo(@HeaderParam("sessionid") String sessionId,
        @QueryParam("nodejmxurl") String nodeJmxUrl, @QueryParam("objectname") String objectName,
        @QueryParam("attrs") List<String> attrs)
        throws InstanceNotFoundException, IntrospectionException, ReflectionException, IOException,
        NotConnectedException, MalformedObjectNameException, NullPointerException {

    // checking that still connected to the RM
    RMProxyUserInterface rmProxy = checkAccess(sessionId);
    return rmProxy.getNodeMBeanInfo(nodeJmxUrl, objectName, attrs);
}
RMRest.java 文件源码 项目:scheduling 阅读 24 收藏 0 点赞 0 评论 0
/**
 * Retrieves attributes of the specified mbeans.
 * 
 * @param sessionId current session
 * @param objectNames mbean names (@see ObjectName format)
 * @param nodeJmxUrl mbean server url
 * @param attrs set of mbean attributes
 * 
 * @return mbean attributes values
 */
@Override
@GET
@GZIP
@Produces("application/json")
@Path("node/mbeans")
public Object getNodeMBeansInfo(@HeaderParam("sessionid") String sessionId,
        @QueryParam("nodejmxurl") String nodeJmxUrl, @QueryParam("objectname") String objectNames,
        @QueryParam("attrs") List<String> attrs)
        throws InstanceNotFoundException, IntrospectionException, ReflectionException, IOException,
        NotConnectedException, MalformedObjectNameException, NullPointerException {

    // checking that still connected to the RM
    RMProxyUserInterface rmProxy = checkAccess(sessionId);
    return rmProxy.getNodeMBeansInfo(nodeJmxUrl, objectNames, attrs);
}
RMRest.java 文件源码 项目:scheduling 阅读 23 收藏 0 点赞 0 评论 0
/**
 * Returns the attributes <code>attr</code> of the mbean
 * registered as <code>name</code>.
 * @param sessionId a valid session
 * @param name mbean's object name
 * @param attrs attributes to enumerate
 * @return returns the attributes of the mbean 
 * @throws InstanceNotFoundException
 * @throws IntrospectionException
 * @throws ReflectionException
 * @throws IOException
 * @throws NotConnectedException 
 */
@Override
@GET
@GZIP
@Path("info/{name}")
@Produces("application/json")
public Object getMBeanInfo(@HeaderParam("sessionid") String sessionId, @PathParam("name") ObjectName name,
        @QueryParam("attr") List<String> attrs) throws InstanceNotFoundException, IntrospectionException,
        ReflectionException, IOException, NotConnectedException {
    RMProxyUserInterface rm = checkAccess(sessionId);

    if ((attrs == null) || (attrs.size() == 0)) {
        // no attribute is requested, we return
        // the description of the mbean
        return rm.getMBeanInfo(name);

    } else {
        return rm.getMBeanAttributes(name, attrs.toArray(new String[attrs.size()]));
    }
}
ROConnection.java 文件源码 项目:scheduling 阅读 27 收藏 0 点赞 0 评论 0
/**
 * @see javax.management.MBeanServerConnection#getMBeanInfo(javax.management.ObjectName)
 */
public MBeanInfo getMBeanInfo(final ObjectName name)
        throws InstanceNotFoundException, IntrospectionException, ReflectionException, IOException {
    if (this.subject == null) {
        return this.mbs.getMBeanInfo(name);
    }
    try {
        return (MBeanInfo) Subject.doAsPrivileged(this.subject, new PrivilegedExceptionAction<MBeanInfo>() {
            public final MBeanInfo run() throws Exception {
                return mbs.getMBeanInfo(name);
            }
        }, this.context);
    } catch (final PrivilegedActionException pe) {
        final Exception e = JMXProviderUtils.extractException(pe);
        if (e instanceof InstanceNotFoundException)
            throw (InstanceNotFoundException) e;
        if (e instanceof IntrospectionException)
            throw (IntrospectionException) e;
        if (e instanceof ReflectionException)
            throw (ReflectionException) e;
        if (e instanceof IOException)
            throw (IOException) e;
        throw JMXProviderUtils.newIOException("Got unexpected server exception: " + e, e);
    }
}
RMIConnector.java 文件源码 项目:infobip-open-jdk-8 阅读 30 收藏 0 点赞 0 评论 0
public MBeanInfo getMBeanInfo(ObjectName name)
throws InstanceNotFoundException,
        IntrospectionException,
        ReflectionException,
        IOException {

    if (logger.debugOn()) logger.debug("getMBeanInfo", "name=" + name);
    final ClassLoader old = pushDefaultClassLoader();
    try {
        return connection.getMBeanInfo(name, delegationSubject);
    } catch (IOException ioe) {
        communicatorAdmin.gotIOException(ioe);

        return connection.getMBeanInfo(name, delegationSubject);
    } finally {
        popDefaultClassLoader(old);
    }
}
RMIConnector.java 文件源码 项目:jdk8u-dev-jdk 阅读 33 收藏 0 点赞 0 评论 0
public MBeanInfo getMBeanInfo(ObjectName name)
throws InstanceNotFoundException,
        IntrospectionException,
        ReflectionException,
        IOException {

    if (logger.debugOn()) logger.debug("getMBeanInfo", "name=" + name);
    final ClassLoader old = pushDefaultClassLoader();
    try {
        return connection.getMBeanInfo(name, delegationSubject);
    } catch (IOException ioe) {
        communicatorAdmin.gotIOException(ioe);

        return connection.getMBeanInfo(name, delegationSubject);
    } finally {
        popDefaultClassLoader(old);
    }
}
RMIConnector.java 文件源码 项目:jdk7-jdk 阅读 36 收藏 0 点赞 0 评论 0
public MBeanInfo getMBeanInfo(ObjectName name)
throws InstanceNotFoundException,
        IntrospectionException,
        ReflectionException,
        IOException {

    if (logger.debugOn()) logger.debug("getMBeanInfo", "name=" + name);
    final ClassLoader old = pushDefaultClassLoader();
    try {
        return connection.getMBeanInfo(name, delegationSubject);
    } catch (IOException ioe) {
        communicatorAdmin.gotIOException(ioe);

        return connection.getMBeanInfo(name, delegationSubject);
    } finally {
        popDefaultClassLoader(old);
    }
}
MBeanService.java 文件源码 项目:lunchy 阅读 26 收藏 0 点赞 0 评论 0
public static void copyAllAttributes(ObjectName on, JsonObject targetObject) {
    try {
        MBeanInfo mbi = mbs.getMBeanInfo(on);
        for (MBeanAttributeInfo mbai : mbi.getAttributes()) {
            Object attValue = mbs.getAttribute(on, mbai.getName());
            if (attValue instanceof Boolean) {
                targetObject.addProperty(mbai.getName(), (Boolean) attValue);
            } else if (attValue instanceof Character) {
                targetObject.addProperty(mbai.getName(), (Character) attValue);
            } else if (attValue instanceof Number) {
                targetObject.addProperty(mbai.getName(), (Number) attValue);
            } else if (attValue instanceof String) {
                targetObject.addProperty(mbai.getName(), (String) attValue);
            } else {
                targetObject.addProperty("OBJECT:" + mbai.getName(), attValue != null ? attValue.toString() : "null");
            }
        }
    } catch (InstanceNotFoundException | IntrospectionException | ReflectionException | AttributeNotFoundException
            | MBeanException e) {
        log.error("Failed to query mbean", e);
    }
}
RMIConnector.java 文件源码 项目:openjdk-source-code-learn 阅读 28 收藏 0 点赞 0 评论 0
public MBeanInfo getMBeanInfo(ObjectName name)
throws InstanceNotFoundException,
        IntrospectionException,
        ReflectionException,
        IOException {

    if (logger.debugOn()) logger.debug("getMBeanInfo", "name=" + name);
    final ClassLoader old = pushDefaultClassLoader();
    try {
        return connection.getMBeanInfo(name, delegationSubject);
    } catch (IOException ioe) {
        communicatorAdmin.gotIOException(ioe);

        return connection.getMBeanInfo(name, delegationSubject);
    } finally {
        popDefaultClassLoader(old);
    }
}
ExecutionServlet.java 文件源码 项目:jumbune 阅读 23 收藏 0 点赞 0 评论 0
private void setYarnAndNonYarnDaemons(String host, YarnSlaveParam slave,
    ProfilerJMXDump dump,
    WorkerJMXInfo levelJMXInfo) throws IOException,
    AttributeNotFoundException, InstanceNotFoundException, MBeanException, ReflectionException,
    IntrospectionException {
  levelJMXInfo.setDataNode(dump.getAllJMXAttribute(JMXDeamons.DATA_NODE,  host,
      slave.getDataNodeJmxPort()));
  if(isYarnEnable){
    YarnWorkerJMXInfo ywji = (YarnWorkerJMXInfo) levelJMXInfo;
    ywji.setNodeManager(dump.getAllJMXAttribute(JMXDeamons.NODE_MANAGER,
        host, slave.getNodeManagerJmxPort()));
  }else{
    levelJMXInfo.setTaskTracker(dump.getAllJMXAttribute(JMXDeamons.TASK_TRACKER,  host,
          slave.getTaskTrackerJmxPort()));
  }
}
ExecutionServlet.java 文件源码 项目:jumbune 阅读 21 收藏 0 点赞 0 评论 0
private void setClusterLevelDaemons(YarnMaster master,
        ClusterWideInfo clusterWideInfo,
        ProfilerJMXDump dump)
        throws IOException, AttributeNotFoundException,
        InstanceNotFoundException, MBeanException, ReflectionException,
        IntrospectionException {
    clusterWideInfo.setNameNode(dump.getAllJMXAttribute(
            JMXDeamons.NAME_NODE ,master.getHost(),
            master.getNameNodeJmxPort()));
    if (isYarnEnable) {
        YarnClusterWideInfo yarnClusterWideInfo = (YarnClusterWideInfo) clusterWideInfo;
        yarnClusterWideInfo.setResourceManager(dump.getAllJMXAttribute(
                JMXDeamons.RESOURCE_MANAGER, 
                master.getHost(), master.getResourceManagerJmxPort()));
    } else {
        clusterWideInfo.setJobTracker(dump.getAllJMXAttribute(
                JMXDeamons.JOB_TRACKER, master.getHost(),
                master.getJobTrackerJmxPort()));
    }
}
RMIConnector.java 文件源码 项目:OLD-OpenJDK8 阅读 30 收藏 0 点赞 0 评论 0
public MBeanInfo getMBeanInfo(ObjectName name)
throws InstanceNotFoundException,
        IntrospectionException,
        ReflectionException,
        IOException {

    if (logger.debugOn()) logger.debug("getMBeanInfo", "name=" + name);
    final ClassLoader old = pushDefaultClassLoader();
    try {
        return connection.getMBeanInfo(name, delegationSubject);
    } catch (IOException ioe) {
        communicatorAdmin.gotIOException(ioe);

        return connection.getMBeanInfo(name, delegationSubject);
    } finally {
        popDefaultClassLoader(old);
    }
}
PluggableMBeanServerImpl.java 文件源码 项目:wildfly-core 阅读 27 收藏 0 点赞 0 评论 0
private MBeanInfo getMBeanInfo(ObjectName name, boolean logAndAuthorize, boolean nullIfNotFound) throws InstanceNotFoundException, IntrospectionException, ReflectionException {
    Throwable error = null;
    MBeanServerPlugin delegate = null;
    final boolean readOnly = true;
    try {
        delegate = findDelegate(name);
        if (logAndAuthorize) {
            authorizeMBeanOperation(delegate, name, GET_MBEAN_INFO, null, JmxAction.Impact.READ_ONLY);
        }
        return delegate.getMBeanInfo(name);
    } catch (Exception e) {
        if (nullIfNotFound) {
            return null;
        }
        error = e;
        if (e instanceof InstanceNotFoundException) throw (InstanceNotFoundException)e;
        if (e instanceof IntrospectionException) throw (IntrospectionException)e;
        if (e instanceof ReflectionException) throw (ReflectionException)e;
        throw makeRuntimeException(e);
    } finally {
        if (logAndAuthorize && shouldAuditLog(delegate, readOnly)) {
            new MBeanServerAuditLogRecordFormatter(this, error, readOnly).getMBeanInfo(name);
        }
    }
}
genericJMXAPI.java 文件源码 项目:Boundary-Generic-JMX-Collector 阅读 21 收藏 0 点赞 0 评论 0
Boolean setDeltaValue() throws MalformedObjectNameException,
    AttributeNotFoundException, InstanceNotFoundException,
    MBeanException, ReflectionException, IOException,
    IntrospectionException {
    this.setCurrentValue();
    if (firstTime) {
        this.storeLastValue();
        this.firstTime = false;
        return false;
    } else {
        displayValue = this.currentValue - this.lastValue;
        this.storeLastValue();
        return true;
    }

}


问题


面经


文章

微信
公众号

扫码关注公众号