Java 类javax.management.AttributeNotFoundException 实例源码

项目:OpenJSharp    文件:PerInterface.java   
Object getAttribute(Object resource, String attribute, Object cookie)
        throws AttributeNotFoundException,
               MBeanException,
               ReflectionException {

    final M cm = getters.get(attribute);
    if (cm == null) {
        final String msg;
        if (setters.containsKey(attribute))
            msg = "Write-only attribute: " + attribute;
        else
            msg = "No such attribute: " + attribute;
        throw new AttributeNotFoundException(msg);
    }
    return introspector.invokeM(cm, resource, (Object[]) null, cookie);
}
项目:OpenJSharp    文件:RMIConnector.java   
public Object getAttribute(ObjectName name,
        String attribute)
        throws MBeanException,
        AttributeNotFoundException,
        InstanceNotFoundException,
        ReflectionException,
        IOException {
    if (logger.debugOn()) logger.debug("getAttribute",
            "name=" + name + ", attribute="
            + attribute);

    final ClassLoader old = pushDefaultClassLoader();
    try {
        return connection.getAttribute(name,
                attribute,
                delegationSubject);
    } catch (IOException ioe) {
        communicatorAdmin.gotIOException(ioe);

        return connection.getAttribute(name,
                attribute,
                delegationSubject);
    } finally {
        popDefaultClassLoader(old);
    }
}
项目:OpenJSharp    文件:RMIConnector.java   
public void setAttribute(ObjectName name,
        Attribute attribute)
        throws InstanceNotFoundException,
        AttributeNotFoundException,
        InvalidAttributeValueException,
        MBeanException,
        ReflectionException,
        IOException {

    if (logger.debugOn()) logger.debug("setAttribute",
            "name=" + name + ", attribute="
            + attribute);

    final MarshalledObject<Attribute> sAttribute =
            new MarshalledObject<Attribute>(attribute);
    final ClassLoader old = pushDefaultClassLoader();
    try {
        connection.setAttribute(name, sAttribute, delegationSubject);
    } catch (IOException ioe) {
        communicatorAdmin.gotIOException(ioe);

        connection.setAttribute(name, sAttribute, delegationSubject);
    } finally {
        popDefaultClassLoader(old);
    }
}
项目:hadoop    文件:JMXGet.java   
/**
 * get single value by key
 */
public String getValue(String key) throws Exception {

  Object val = null;

  for (ObjectName oname : hadoopObjectNames) {
    try {
      val = mbsc.getAttribute(oname, key);
    } catch (AttributeNotFoundException anfe) {
      /* just go to the next */
      continue;
    } catch (ReflectionException re) {
      if (re.getCause() instanceof NoSuchMethodException) {
        continue;
      }
    }
    err("Info: key = " + key + "; val = " +
        (val == null ? "null" : val.getClass()) + ":" + val);
    break;
  }

  return (val == null) ? "" : val.toString();
}
项目:hadoop    文件:TestSecondaryWebUi.java   
@Test
public void testSecondaryWebUi()
        throws IOException, MalformedObjectNameException,
               AttributeNotFoundException, MBeanException,
               ReflectionException, InstanceNotFoundException {
  MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
  ObjectName mxbeanName = new ObjectName(
          "Hadoop:service=SecondaryNameNode,name=SecondaryNameNodeInfo");

  String[] checkpointDir = (String[]) mbs.getAttribute(mxbeanName,
          "CheckpointDirectories");
  Assert.assertArrayEquals(checkpointDir, snn.getCheckpointDirectories());
  String[] checkpointEditlogDir = (String[]) mbs.getAttribute(mxbeanName,
          "CheckpointEditlogDirectories");
  Assert.assertArrayEquals(checkpointEditlogDir,
          snn.getCheckpointEditlogDirectories());
}
项目:jdk8u-jdk    文件:PerInterface.java   
Object getAttribute(Object resource, String attribute, Object cookie)
        throws AttributeNotFoundException,
               MBeanException,
               ReflectionException {

    final M cm = getters.get(attribute);
    if (cm == null) {
        final String msg;
        if (setters.containsKey(attribute))
            msg = "Write-only attribute: " + attribute;
        else
            msg = "No such attribute: " + attribute;
        throw new AttributeNotFoundException(msg);
    }
    return introspector.invokeM(cm, resource, (Object[]) null, cookie);
}
项目:jdk8u-jdk    文件:PerInterface.java   
void setAttribute(Object resource, String attribute, Object value,
                  Object cookie)
        throws AttributeNotFoundException,
               InvalidAttributeValueException,
               MBeanException,
               ReflectionException {

    final M cm = setters.get(attribute);
    if (cm == null) {
        final String msg;
        if (getters.containsKey(attribute))
            msg = "Read-only attribute: " + attribute;
        else
            msg = "No such attribute: " + attribute;
        throw new AttributeNotFoundException(msg);
    }
    introspector.invokeSetter(attribute, cm, resource, value, cookie);
}
项目:jdk8u-jdk    文件:RMIConnector.java   
public Object getAttribute(ObjectName name,
        String attribute)
        throws MBeanException,
        AttributeNotFoundException,
        InstanceNotFoundException,
        ReflectionException,
        IOException {
    if (logger.debugOn()) logger.debug("getAttribute",
            "name=" + name + ", attribute="
            + attribute);

    final ClassLoader old = pushDefaultClassLoader();
    try {
        return connection.getAttribute(name,
                attribute,
                delegationSubject);
    } catch (IOException ioe) {
        communicatorAdmin.gotIOException(ioe);

        return connection.getAttribute(name,
                attribute,
                delegationSubject);
    } finally {
        popDefaultClassLoader(old);
    }
}
项目:jdk8u-jdk    文件:RMIConnector.java   
public void setAttribute(ObjectName name,
        Attribute attribute)
        throws InstanceNotFoundException,
        AttributeNotFoundException,
        InvalidAttributeValueException,
        MBeanException,
        ReflectionException,
        IOException {

    if (logger.debugOn()) logger.debug("setAttribute",
            "name=" + name + ", attribute name="
            + attribute.getName());

    final MarshalledObject<Attribute> sAttribute =
            new MarshalledObject<Attribute>(attribute);
    final ClassLoader old = pushDefaultClassLoader();
    try {
        connection.setAttribute(name, sAttribute, delegationSubject);
    } catch (IOException ioe) {
        communicatorAdmin.gotIOException(ioe);

        connection.setAttribute(name, sAttribute, delegationSubject);
    } finally {
        popDefaultClassLoader(old);
    }
}
项目:jdk8u-jdk    文件:RMIConnectorLogAttributesTest.java   
private void doTest(JMXConnector connector) throws IOException,
MalformedObjectNameException, ReflectionException,
InstanceAlreadyExistsException, MBeanRegistrationException,
MBeanException, NotCompliantMBeanException, InstanceNotFoundException, AttributeNotFoundException, InvalidAttributeValueException {
    MBeanServerConnection  mbsc = connector.getMBeanServerConnection();


    ObjectName objName = new ObjectName("com.redhat.test.jmx:type=NameMBean");
    System.out.println("DEBUG: Calling createMBean");
    mbsc.createMBean(Name.class.getName(), objName);

    System.out.println("DEBUG: Calling setAttributes");
    AttributeList attList = new AttributeList();
    attList.add(new Attribute("FirstName", ANY_NAME));
    attList.add(new Attribute("LastName", ANY_NAME));
    mbsc.setAttributes(objName, attList);
}
项目:openjdk-jdk10    文件:RMIConnector.java   
public Object getAttribute(ObjectName name,
        String attribute)
        throws MBeanException,
        AttributeNotFoundException,
        InstanceNotFoundException,
        ReflectionException,
        IOException {
    if (logger.debugOn()) logger.debug("getAttribute",
            "name=" + name + ", attribute="
            + attribute);

    final ClassLoader old = pushDefaultClassLoader();
    try {
        return connection.getAttribute(name,
                attribute,
                delegationSubject);
    } catch (IOException ioe) {
        communicatorAdmin.gotIOException(ioe);

        return connection.getAttribute(name,
                attribute,
                delegationSubject);
    } finally {
        popDefaultClassLoader(old);
    }
}
项目:openjdk-jdk10    文件:RMIConnector.java   
public void setAttribute(ObjectName name,
        Attribute attribute)
        throws InstanceNotFoundException,
        AttributeNotFoundException,
        InvalidAttributeValueException,
        MBeanException,
        ReflectionException,
        IOException {

    if (logger.debugOn()) logger.debug("setAttribute",
            "name=" + name + ", attribute name="
            + attribute.getName());

    final MarshalledObject<Attribute> sAttribute =
            new MarshalledObject<Attribute>(attribute);
    final ClassLoader old = pushDefaultClassLoader();
    try {
        connection.setAttribute(name, sAttribute, delegationSubject);
    } catch (IOException ioe) {
        communicatorAdmin.gotIOException(ioe);

        connection.setAttribute(name, sAttribute, delegationSubject);
    } finally {
        popDefaultClassLoader(old);
    }
}
项目:openjdk-jdk10    文件:PerInterface.java   
Object getAttribute(Object resource, String attribute, Object cookie)
        throws AttributeNotFoundException,
               MBeanException,
               ReflectionException {

    final M cm = getters.get(attribute);
    if (cm == null) {
        final String msg;
        if (setters.containsKey(attribute))
            msg = "Write-only attribute: " + attribute;
        else
            msg = "No such attribute: " + attribute;
        throw new AttributeNotFoundException(msg);
    }
    return introspector.invokeM(cm, resource, (Object[]) null, cookie);
}
项目:openjdk-jdk10    文件:PerInterface.java   
void setAttribute(Object resource, String attribute, Object value,
                  Object cookie)
        throws AttributeNotFoundException,
               InvalidAttributeValueException,
               MBeanException,
               ReflectionException {

    final M cm = setters.get(attribute);
    if (cm == null) {
        final String msg;
        if (getters.containsKey(attribute))
            msg = "Read-only attribute: " + attribute;
        else
            msg = "No such attribute: " + attribute;
        throw new AttributeNotFoundException(msg);
    }
    introspector.invokeSetter(attribute, cm, resource, value, cookie);
}
项目:hashsdn-controller    文件:DynamicWritableWrapper.java   
@Override
public synchronized void setAttribute(final Attribute attribute)
        throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException {
    Attribute newAttribute = attribute;
    if (configBeanModificationDisabled.get()) {
        throw new IllegalStateException("Operation is not allowed now");
    }

    if ("Attribute".equals(newAttribute.getName())) {
        setAttribute((Attribute) newAttribute.getValue());
        return;
    }

    try {
        if (newAttribute.getValue() instanceof ObjectName) {
            newAttribute = fixDependencyAttribute(newAttribute);
        } else if (newAttribute.getValue() instanceof ObjectName[]) {
            newAttribute = fixDependencyListAttribute(newAttribute);
        }

        internalServer.setAttribute(objectNameInternal, newAttribute);
    } catch (final InstanceNotFoundException e) {
        throw new MBeanException(e);
    }

}
项目:hashsdn-controller    文件:DynamicWritableWrapper.java   
@Override
public AttributeList setAttributes(final AttributeList attributes) {
    AttributeList result = new AttributeList();
    for (Object attributeObject : attributes) {
        Attribute attribute = (Attribute) attributeObject;
        try {
            setAttribute(attribute);
            result.add(attribute);
        } catch (final InvalidAttributeValueException | AttributeNotFoundException | MBeanException
                | ReflectionException e) {
            LOG.warn("Setting attribute {} failed on {}", attribute.getName(), moduleIdentifier, e);
            throw new IllegalArgumentException(
                    "Setting attribute failed - " + attribute.getName() + " on " + moduleIdentifier, e);
        }
    }
    return result;
}
项目:openjdk-jdk10    文件:RMIConnectorLogAttributesTest.java   
private void doTest(JMXConnector connector) throws IOException,
MalformedObjectNameException, ReflectionException,
InstanceAlreadyExistsException, MBeanRegistrationException,
MBeanException, NotCompliantMBeanException, InstanceNotFoundException, AttributeNotFoundException, InvalidAttributeValueException {
    MBeanServerConnection  mbsc = connector.getMBeanServerConnection();


    ObjectName objName = new ObjectName("com.redhat.test.jmx:type=NameMBean");
    System.out.println("DEBUG: Calling createMBean");
    mbsc.createMBean(Name.class.getName(), objName);

    System.out.println("DEBUG: Calling setAttributes");
    AttributeList attList = new AttributeList();
    attList.add(new Attribute("FirstName", ANY_NAME));
    attList.add(new Attribute("LastName", ANY_NAME));
    mbsc.setAttributes(objName, attList);
}
项目:Pogamut3    文件:DynamicProxy.java   
public Object getAttribute(String attribute) throws AttributeNotFoundException, MBeanException, ReflectionException {
    try {
        return mbsc.getAttribute(objectName, attribute);
    } catch (Exception ex) {
        throw new MBeanException(ex);
    }
}
项目:Pogamut3    文件:DynamicProxy.java   
public void setAttribute(Attribute attribute) throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException {
    try {
        mbsc.setAttribute(objectName, attribute);
    } catch (Exception ex) {
        throw new MBeanException(ex);
    }
}
项目:Pogamut3    文件:FolderMBean.java   
@Override
public Object getAttribute(String attribute) throws AttributeNotFoundException, MBeanException, ReflectionException {
    try {
        return folder.getProperty(attribute).getValue();
    } catch (IntrospectionException ex) {
        throw new MBeanException(ex);
    }
}
项目:Pogamut3    文件:FolderMBean.java   
@Override
public void setAttribute(Attribute attribute) throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException {
    try {
        folder.getProperty(attribute.getName()).setValue(attribute.getValue());
    } catch (IntrospectionException ex) {
        throw new MBeanException(ex);
    }
}
项目:tqdev-metrics    文件:JmxReporter.java   
@Override
public void setAttribute(Attribute attribute)
        throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException {
    if (attribute.getName().equals("enabled")) {
        registry.setEnabled((boolean) attribute.getValue());
    } else {
        throw new AttributeNotFoundException("No writable attribute has been found");
    }
}
项目:hadoop-oss    文件:MetricsSourceAdapter.java   
@Override
public Object getAttribute(String attribute)
    throws AttributeNotFoundException, MBeanException, ReflectionException {
  updateJmxCache();
  synchronized(this) {
    Attribute a = attrCache.get(attribute);
    if (a == null) {
      throw new AttributeNotFoundException(attribute +" not found");
    }
    if (LOG.isDebugEnabled()) {
      LOG.debug(attribute +": "+ a);
    }
    return a.getValue();
  }
}
项目:lams    文件:SpringModelMBean.java   
/**
 * Switches the {@link Thread#getContextClassLoader() context ClassLoader} for the
 * managed resources {@link ClassLoader} before allowing the invocation to occur.
 * @see javax.management.modelmbean.ModelMBean#getAttribute
 */
@Override
public Object getAttribute(String attrName)
        throws AttributeNotFoundException, MBeanException, ReflectionException {

    ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader();
    try {
        Thread.currentThread().setContextClassLoader(this.managedResourceClassLoader);
        return super.getAttribute(attrName);
    }
    finally {
        Thread.currentThread().setContextClassLoader(currentClassLoader);
    }
}
项目:lams    文件:SpringModelMBean.java   
/**
 * Switches the {@link Thread#getContextClassLoader() context ClassLoader} for the
 * managed resources {@link ClassLoader} before allowing the invocation to occur.
 * @see javax.management.modelmbean.ModelMBean#setAttribute
 */
@Override
public void setAttribute(Attribute attribute)
        throws AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException {

    ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader();
    try {
        Thread.currentThread().setContextClassLoader(this.managedResourceClassLoader);
        super.setAttribute(attribute);
    }
    finally {
        Thread.currentThread().setContextClassLoader(currentClassLoader);
    }
}
项目:OpenJSharp    文件:MBeanServerDelegateImpl.java   
/**
 * This method always fail since all MBeanServerDelegateMBean attributes
 * are read-only.
 *
 * @param attribute The identification of the attribute to
 * be set and  the value it is to be set to.
 *
 * @exception AttributeNotFoundException
 */
public void setAttribute(Attribute attribute)
    throws AttributeNotFoundException, InvalidAttributeValueException,
           MBeanException, ReflectionException {

    // Now we will always fail:
    // Either because the attribute is null or because it is not
    // accessible (or does not exist).
    //
    final String attname = (attribute==null?null:attribute.getName());
    if (attname == null) {
        final RuntimeException r =
            new IllegalArgumentException("Attribute name cannot be null");
        throw new RuntimeOperationsException(r,
            "Exception occurred trying to invoke the setter on the MBean");
    }

    // This is a hack: we call getAttribute in order to generate an
    // AttributeNotFoundException if the attribute does not exist.
    //
    Object val = getAttribute(attname);

    // If we reach this point, we know that the requested attribute
    // exists. However, since all attributes are read-only, we throw
    // an AttributeNotFoundException.
    //
    throw new AttributeNotFoundException(attname + " not accessible");
}
项目:OpenJSharp    文件:MBeanSupport.java   
public final void setAttribute(Attribute attribute)
        throws AttributeNotFoundException,
               InvalidAttributeValueException,
               MBeanException,
               ReflectionException {
    final String name = attribute.getName();
    final Object value = attribute.getValue();
    perInterface.setAttribute(resource, name, value, getCookie());
}
项目:tqdev-metrics    文件:JmxReporterTest.java   
/**
 * Should throw exception on unknown type.
 *
 * @throws MBeanException
 *             the MBean exception
 * @throws AttributeNotFoundException
 *             the attribute not found exception
 * @throws ReflectionException
 *             the reflection exception
 */
@Test
public void shouldThrowExceptionOnUnknownType()
        throws MBeanException, AttributeNotFoundException, ReflectionException {
    try {
        readJmx("jdbc.Statement.Invocations", "select");
        Assert.fail("readJmx should have thrown an AttributeNotFoundException");
    } catch (Exception e) {
        assertThat(e.getClass().getSimpleName()).isEqualTo("AttributeNotFoundException");
    }
}
项目:OpenJSharp    文件:MBeanServerAccessController.java   
/**
 * Call <code>checkRead()</code>, then forward this method to the
 * wrapped object.
 */
public Object getAttribute(ObjectName name, String attribute)
    throws
    MBeanException,
    AttributeNotFoundException,
    InstanceNotFoundException,
    ReflectionException {
    checkRead();
    return getMBeanServer().getAttribute(name, attribute);
}
项目:OpenJSharp    文件:MBeanServerAccessController.java   
/**
 * Call <code>checkWrite()</code>, then forward this method to the
 * wrapped object.
 */
public void setAttribute(ObjectName name, Attribute attribute)
    throws
    InstanceNotFoundException,
    AttributeNotFoundException,
    InvalidAttributeValueException,
    MBeanException,
    ReflectionException {
    checkWrite();
    getMBeanServer().setAttribute(name, attribute);
}
项目:OpenJSharp    文件:Monitor.java   
Comparable<?> getComparableFromAttribute(ObjectName object,
                                         String attribute,
                                         Object value)
    throws AttributeNotFoundException {
    if (isComplexTypeAttribute) {
        Object v = value;
        for (String attr : remainingAttributes)
            v = Introspector.elementFromComplex(v, attr);
        return (Comparable<?>) v;
    } else {
        return (Comparable<?>) value;
    }
}
项目:openjdk-jdk10    文件:OldMBeanServerTest.java   
public Object getAttribute(String attribute)
throws AttributeNotFoundException, MBeanException, ReflectionException {
    AttrMethods am = attrMap.get(attribute);
    if (am == null || am.getter == null)
        throw new AttributeNotFoundException(attribute);
    return invokeMethod(am.getter);
}
项目:tqdev-metrics    文件:JmxReporterTest.java   
/**
 * Should throw exception on unknown key.
 *
 * @throws MBeanException
 *             the MBean exception
 * @throws AttributeNotFoundException
 *             the attribute not found exception
 * @throws ReflectionException
 *             the reflection exception
 */
@Test
public void shouldThrowExceptionOnUnknownKey()
        throws MBeanException, AttributeNotFoundException, ReflectionException {
    registry.increment("jdbc.Statement.Invocations", "update");
    try {
        readJmx("jdbc.Statement.Invocations", "select");
        Assert.fail("readJmx should have thrown an InvalidKeyException");
    } catch (Exception e) {
        assertThat(e.getClass().getSimpleName()).isEqualTo("InvalidKeyException");
    }
}
项目:monarch    文件:MBeanServerWrapper.java   
@Override
public void setAttribute(ObjectName name, Attribute attribute)
    throws InstanceNotFoundException, AttributeNotFoundException, InvalidAttributeValueException,
    MBeanException, ReflectionException {
  ResourcePermission ctx = getOperationContext(name, attribute.getName(), false);
  this.securityService.authorize(ctx);
  mbs.setAttribute(name, attribute);
}
项目:hadoop    文件:MetricsSourceAdapter.java   
@Override
public Object getAttribute(String attribute)
    throws AttributeNotFoundException, MBeanException, ReflectionException {
  updateJmxCache();
  synchronized(this) {
    Attribute a = attrCache.get(attribute);
    if (a == null) {
      throw new AttributeNotFoundException(attribute +" not found");
    }
    if (LOG.isDebugEnabled()) {
      LOG.debug(attribute +": "+ a);
    }
    return a.getValue();
  }
}
项目:jdk8u-jdk    文件:DefaultMBeanServerInterceptor.java   
public Object getAttribute(ObjectName name, String attribute)
    throws MBeanException, AttributeNotFoundException,
           InstanceNotFoundException, ReflectionException {

    if (name == null) {
        throw new RuntimeOperationsException(new
            IllegalArgumentException("Object name cannot be null"),
            "Exception occurred trying to invoke the getter on the MBean");
    }
    if (attribute == null) {
        throw new RuntimeOperationsException(new
            IllegalArgumentException("Attribute cannot be null"),
            "Exception occurred trying to invoke the getter on the MBean");
    }

    name = nonDefaultDomain(name);

    if (MBEANSERVER_LOGGER.isLoggable(Level.FINER)) {
        MBEANSERVER_LOGGER.logp(Level.FINER,
                DefaultMBeanServerInterceptor.class.getName(),
                "getAttribute",
                "Attribute = " + attribute + ", ObjectName = " + name);
    }

    final DynamicMBean instance = getMBean(name);
    checkMBeanPermission(instance, attribute, name, "getAttribute");

    try {
        return instance.getAttribute(attribute);
    } catch (AttributeNotFoundException e) {
        throw e;
    } catch (Throwable t) {
        rethrowMaybeMBeanException(t);
        throw new AssertionError(); // not reached
    }
}
项目:jdk8u-jdk    文件:MBeanServerDelegateImpl.java   
/**
 * This method always fail since all MBeanServerDelegateMBean attributes
 * are read-only.
 *
 * @param attribute The identification of the attribute to
 * be set and  the value it is to be set to.
 *
 * @exception AttributeNotFoundException
 */
public void setAttribute(Attribute attribute)
    throws AttributeNotFoundException, InvalidAttributeValueException,
           MBeanException, ReflectionException {

    // Now we will always fail:
    // Either because the attribute is null or because it is not
    // accessible (or does not exist).
    //
    final String attname = (attribute==null?null:attribute.getName());
    if (attname == null) {
        final RuntimeException r =
            new IllegalArgumentException("Attribute name cannot be null");
        throw new RuntimeOperationsException(r,
            "Exception occurred trying to invoke the setter on the MBean");
    }

    // This is a hack: we call getAttribute in order to generate an
    // AttributeNotFoundException if the attribute does not exist.
    //
    Object val = getAttribute(attname);

    // If we reach this point, we know that the requested attribute
    // exists. However, since all attributes are read-only, we throw
    // an AttributeNotFoundException.
    //
    throw new AttributeNotFoundException(attname + " not accessible");
}
项目:jdk8u-jdk    文件:MBeanSupport.java   
public final void setAttribute(Attribute attribute)
        throws AttributeNotFoundException,
               InvalidAttributeValueException,
               MBeanException,
               ReflectionException {
    final String name = attribute.getName();
    final Object value = attribute.getValue();
    perInterface.setAttribute(resource, name, value, getCookie());
}
项目:jdk8u-jdk    文件:MBeanServerAccessController.java   
/**
 * Call <code>checkRead()</code>, then forward this method to the
 * wrapped object.
 */
public Object getAttribute(ObjectName name, String attribute)
    throws
    MBeanException,
    AttributeNotFoundException,
    InstanceNotFoundException,
    ReflectionException {
    checkRead();
    return getMBeanServer().getAttribute(name, attribute);
}
项目:jdk8u-jdk    文件:MBeanServerAccessController.java   
/**
 * Call <code>checkWrite()</code>, then forward this method to the
 * wrapped object.
 */
public void setAttribute(ObjectName name, Attribute attribute)
    throws
    InstanceNotFoundException,
    AttributeNotFoundException,
    InvalidAttributeValueException,
    MBeanException,
    ReflectionException {
    checkWrite();
    getMBeanServer().setAttribute(name, attribute);
}