Java Code Examples for javax.management.ObjectInstance

The following examples show how to use javax.management.ObjectInstance. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
@Override
public ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName) throws ReflectionException,
        InstanceAlreadyExistsException, MBeanException, NotCompliantMBeanException,
        InstanceNotFoundException {
    Throwable error = null;
    MBeanServerPlugin delegate = null;
    final boolean readOnly = false;
    try {
        delegate = findDelegateForNewObject(name);
        authorizeMBeanOperation(delegate, name, CREATE_MBEAN, null, JmxAction.Impact.WRITE);
        return checkNotAReservedDomainRegistrationIfObjectNameWasChanged(name, delegate.createMBean(className, name, loaderName), delegate);
    } catch (Exception e) {
        error = e;
        if (e instanceof ReflectionException) throw (ReflectionException)e;
        if (e instanceof InstanceAlreadyExistsException) throw (InstanceAlreadyExistsException)e;
        if (e instanceof MBeanException) throw (MBeanException)e;
        if (e instanceof NotCompliantMBeanException) throw (NotCompliantMBeanException)e;
        if (e instanceof InstanceNotFoundException) throw (InstanceNotFoundException)e;
        throw makeRuntimeException(e);
    } finally {
        if (shouldAuditLog(delegate, readOnly)) {
            new MBeanServerAuditLogRecordFormatter(this, error, readOnly).createMBean(className, name, loaderName);
        }
    }
}
 
Example 2
public ObjectInstance registerMBean(Object object, ObjectName name)
    throws InstanceAlreadyExistsException, MBeanRegistrationException,
    NotCompliantMBeanException  {

    // ------------------------------
    // ------------------------------
    Class<?> theClass = object.getClass();

    Introspector.checkCompliance(theClass);

    final String infoClassName = getNewMBeanClassName(object);

    checkMBeanPermission(infoClassName, null, name, "registerMBean");
    checkMBeanTrustPermission(theClass);

    return registerObject(infoClassName, object, name);
}
 
Example 3
Source Project: jdk8u-jdk   Source File: OldMBeanServerTest.java    License: GNU General Public License v2.0 6 votes vote down vote up
public Set<ObjectInstance> queryMBeans(ObjectName name, QueryExp query) {
    Set<ObjectInstance> instances = newSet();
    if (name == null)
        name = ObjectName.WILDCARD;
    if (query == null)
        query = trueQuery;
    MBeanServer oldMBS = QueryEval.getMBeanServer();
    try {
        query.setMBeanServer(this);
        for (ObjectName n : mbeans.keySet()) {
            if (name.apply(n)) {
                try {
                    if (query.apply(n))
                        instances.add(getObjectInstance(n));
                } catch (Exception e) {
                    // OK: Ignore this MBean in the result
                }
            }
        }
    } finally {
        query.setMBeanServer(oldMBS);
    }
    return instances;
}
 
Example 4
Source Project: javamelody   Source File: TestMBeans.java    License: Apache License 2.0 6 votes vote down vote up
/** Before.
 * @throws JMException e */
@Before
public void setUp() throws JMException {
	Utils.initialize();
	mbeans = new MBeans();
	mBeanServer = MBeans.getPlatformMBeanServer();
	final ObjectInstance mBean1 = mBeanServer.registerMBean(new ThreadPool(),
			new ObjectName("Catalina:type=ThreadPool"));
	mbeansList.add(mBean1.getObjectName());
	final ObjectInstance mBean2 = mBeanServer.registerMBean(new GlobalRequestProcessor(),
			new ObjectName("Catalina:type=GlobalRequestProcessor,name=http-8080"));
	mbeansList.add(mBean2.getObjectName());
	final ObjectInstance mBean3 = mBeanServer.registerMBean(new GlobalRequestProcessor(),
			new ObjectName("jboss.deployment:type=Servlet"));
	mbeansList.add(mBean3.getObjectName());
}
 
Example 5
public ObjectInstance createMBean(String className, ObjectName name,
                                  Object[] params, String[] signature)
    throws ReflectionException, InstanceAlreadyExistsException,
           MBeanRegistrationException, MBeanException,
           NotCompliantMBeanException  {

    try {
        return createMBean(className, name, null, true,
                           params, signature);
    } catch (InstanceNotFoundException e) {
        /* Can only happen if loaderName doesn't exist, but we just
           passed null, so we shouldn't get this exception.  */
        throw EnvHelp.initCause(
            new IllegalArgumentException("Unexpected exception: " + e), e);
    }
}
 
Example 6
/**
 * @see javax.management.MBeanServerConnection#getObjectInstance(javax.management.ObjectName)
 */
public ObjectInstance getObjectInstance(final ObjectName name) throws InstanceNotFoundException, IOException {
    if (this.subject == null) {
        return this.mbs.getObjectInstance(name);
    }
    try {
        return (ObjectInstance) Subject.doAsPrivileged(this.subject,
                                                       new PrivilegedExceptionAction<ObjectInstance>() {
                                                           public final ObjectInstance run() throws Exception {
                                                               return mbs.getObjectInstance(name);
                                                           }
                                                       },
                                                       this.context);
    } catch (final PrivilegedActionException pe) {
        final Exception e = JMXProviderUtils.extractException(pe);
        if (e instanceof InstanceNotFoundException)
            throw (InstanceNotFoundException) e;
        if (e instanceof IOException)
            throw (IOException) e;
        throw JMXProviderUtils.newIOException("Got unexpected server exception: " + e, e);
    }
}
 
Example 7
public Set<ObjectInstance> queryMBeans(ObjectName name, QueryExp query) {
    Set<ObjectInstance> instances = newSet();
    if (name == null)
        name = ObjectName.WILDCARD;
    if (query == null)
        query = trueQuery;
    MBeanServer oldMBS = QueryEval.getMBeanServer();
    try {
        query.setMBeanServer(this);
        for (ObjectName n : mbeans.keySet()) {
            if (name.apply(n)) {
                try {
                    if (query.apply(n))
                        instances.add(getObjectInstance(n));
                } catch (Exception e) {
                    // OK: Ignore this MBean in the result
                }
            }
        }
    } finally {
        query.setMBeanServer(oldMBS);
    }
    return instances;
}
 
Example 8
/**
 * Call <code>checkCreate(className)</code>, then forward this method to the
 * wrapped object.
 */
public ObjectInstance createMBean(String className, ObjectName name)
    throws
    ReflectionException,
    InstanceAlreadyExistsException,
    MBeanRegistrationException,
    MBeanException,
    NotCompliantMBeanException {
    checkCreate(className);
    SecurityManager sm = System.getSecurityManager();
    if (sm == null) {
        Object object = getMBeanServer().instantiate(className);
        checkClassLoader(object);
        return getMBeanServer().registerMBean(object, name);
    } else {
        return getMBeanServer().createMBean(className, name);
    }
}
 
Example 9
Source Project: gemfirexd-oss   Source File: MBeanTest.java    License: Apache License 2.0 6 votes vote down vote up
private void checkMemberView(boolean expectedBeans,
    MBeanServerConnection mbeanServer, String memberId, String serverGroup)
    throws MalformedObjectNameException, IOException, TestException {
  Log.getLogWriter().info("Checking GFXDMemberMBean for server group " + serverGroup + " and memberId : "  + memberId);
  String memberONstr = memberONTemplate.replace("{0}", serverGroup);
  memberONstr = memberONstr.replace("{1}", memberId);
  ObjectName memberON = new ObjectName(memberONstr);

  // check memberMBean
  Log.getLogWriter().info("Querying for member instance " + memberON);

  try {
    ObjectInstance instance = mbeanServer.getObjectInstance(memberON);
    Log.getLogWriter().info("Found instance " + memberON + " Expected " + expectedBeans);
    if (!expectedBeans && instance != null)
      throw new TestException("Found member instance " + memberON + " when not expected ");
  } catch (InstanceNotFoundException e) {
    if (expectedBeans) {
      logMBeans(MessageFormat.format(ManagementConstants.OBJECTNAME__GFXDMEMBER_MXBEAN, new Object[] {"*", "*"}), mbeanServer);
      throw new TestException("checkMemberViewFromManager\n" + TestHelper.getStackTrace(e));
    }
  }
}
 
Example 10
public ObjectInstance registerMBean(Object object, ObjectName name)
    throws InstanceAlreadyExistsException, MBeanRegistrationException,
    NotCompliantMBeanException  {

    // ------------------------------
    // ------------------------------
    Class<?> theClass = object.getClass();

    Introspector.checkCompliance(theClass);

    final String infoClassName = getNewMBeanClassName(object);

    checkMBeanPermission(infoClassName, null, name, "registerMBean");
    checkMBeanTrustPermission(theClass);

    return registerObject(infoClassName, object, name);
}
 
Example 11
Source Project: jdk8u_jdk   Source File: RMIConnector.java    License: GNU General Public License v2.0 6 votes vote down vote up
public Set<ObjectInstance> queryMBeans(ObjectName name,
        QueryExp query)
        throws IOException {
    if (logger.debugOn()) logger.debug("queryMBeans",
            "name=" + name + ", query=" + query);

    final MarshalledObject<QueryExp> sQuery =
            new MarshalledObject<QueryExp>(query);
    final ClassLoader old = pushDefaultClassLoader();
    try {
        return connection.queryMBeans(name, sQuery, delegationSubject);
    } catch (IOException ioe) {
        communicatorAdmin.gotIOException(ioe);

        return connection.queryMBeans(name, sQuery, delegationSubject);
    } finally {
        popDefaultClassLoader(old);
    }
}
 
Example 12
Source Project: activemq-artemis   Source File: PurgeCommandTest.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * This test ensures that the queueViewMbean will work.
 *
 * @throws Exception
 */
public void testQueueViewMbean() throws Exception {

   try {
      addMessages();

      validateCounts(MESSAGE_COUNT, MESSAGE_COUNT, MESSAGE_COUNT * 2);

      List<String> tokens = Arrays.asList(new String[]{"*"});
      for (String token : tokens) {
         List<ObjectInstance> queueList = JmxMBeansUtil.queryMBeans(createJmxConnection(), "type=Broker,brokerName=localbroker,destinationType=Queue,destinationName=" + token);

         for (ObjectInstance queue : queueList) {
            ObjectName queueName = queue.getObjectName();
            QueueViewMBean proxy = MBeanServerInvocationHandler.newProxyInstance(createJmxConnection(), queueName, QueueViewMBean.class, true);
            int removed = proxy.removeMatchingMessages(MSG_SEL_WITH_PROPERTY);
            LOG.info("Removed: " + removed);
         }
      }

      validateCounts(0, MESSAGE_COUNT, MESSAGE_COUNT);

   } finally {
      purgeAllMessages();
   }
}
 
Example 13
/**
 * Call <code>checkCreate(className)</code>, then forward this method to the
 * wrapped object.
 */
public ObjectInstance createMBean(String className, ObjectName name)
    throws
    ReflectionException,
    InstanceAlreadyExistsException,
    MBeanRegistrationException,
    MBeanException,
    NotCompliantMBeanException {
    checkCreate(className);
    SecurityManager sm = System.getSecurityManager();
    if (sm == null) {
        Object object = getMBeanServer().instantiate(className);
        checkClassLoader(object);
        return getMBeanServer().registerMBean(object, name);
    } else {
        return getMBeanServer().createMBean(className, name);
    }
}
 
Example 14
/**
 * Call <code>checkCreate(className)</code>, then forward this method to the
 * wrapped object.
 */
public ObjectInstance createMBean(String className, ObjectName name,
                                  Object params[], String signature[])
    throws
    ReflectionException,
    InstanceAlreadyExistsException,
    MBeanRegistrationException,
    MBeanException,
    NotCompliantMBeanException {
    checkCreate(className);
    SecurityManager sm = System.getSecurityManager();
    if (sm == null) {
        Object object = getMBeanServer().instantiate(className,
                                                     params,
                                                     signature);
        checkClassLoader(object);
        return getMBeanServer().registerMBean(object, name);
    } else {
        return getMBeanServer().createMBean(className, name,
                                            params, signature);
    }
}
 
Example 15
public ObjectInstance registerMBean(Object object, ObjectName name)
    throws InstanceAlreadyExistsException, MBeanRegistrationException,
    NotCompliantMBeanException  {

    // ------------------------------
    // ------------------------------
    Class<?> theClass = object.getClass();

    Introspector.checkCompliance(theClass);

    final String infoClassName = getNewMBeanClassName(object);

    checkMBeanPermission(infoClassName, null, name, "registerMBean");
    checkMBeanTrustPermission(theClass);

    return registerObject(infoClassName, object, name);
}
 
Example 16
Source Project: jdk8u-jdk   Source File: OldMBeanServerTest.java    License: GNU General Public License v2.0 6 votes vote down vote up
public Set<ObjectInstance> queryMBeans(ObjectName name, QueryExp query) {
    Set<ObjectInstance> instances = newSet();
    if (name == null)
        name = ObjectName.WILDCARD;
    if (query == null)
        query = trueQuery;
    MBeanServer oldMBS = QueryEval.getMBeanServer();
    try {
        query.setMBeanServer(this);
        for (ObjectName n : mbeans.keySet()) {
            if (name.apply(n)) {
                try {
                    if (query.apply(n))
                        instances.add(getObjectInstance(n));
                } catch (Exception e) {
                    // OK: Ignore this MBean in the result
                }
            }
        }
    } finally {
        query.setMBeanServer(oldMBS);
    }
    return instances;
}
 
Example 17
Source Project: JDKSourceCode1.8   Source File: DefaultMBeanServerInterceptor.java    License: MIT License 6 votes vote down vote up
public ObjectInstance createMBean(String className, ObjectName name,
                                  Object[] params, String[] signature)
    throws ReflectionException, InstanceAlreadyExistsException,
           MBeanRegistrationException, MBeanException,
           NotCompliantMBeanException  {

    try {
        return createMBean(className, name, null, true,
                           params, signature);
    } catch (InstanceNotFoundException e) {
        /* Can only happen if loaderName doesn't exist, but we just
           passed null, so we shouldn't get this exception.  */
        throw EnvHelp.initCause(
            new IllegalArgumentException("Unexpected exception: " + e), e);
    }
}
 
Example 18
/**
 * Call <code>checkCreate(className)</code>, then forward this method to the
 * wrapped object.
 */
public ObjectInstance createMBean(String className, ObjectName name,
                                  Object params[], String signature[])
    throws
    ReflectionException,
    InstanceAlreadyExistsException,
    MBeanRegistrationException,
    MBeanException,
    NotCompliantMBeanException {
    checkCreate(className);
    SecurityManager sm = System.getSecurityManager();
    if (sm == null) {
        Object object = getMBeanServer().instantiate(className,
                                                     params,
                                                     signature);
        checkClassLoader(object);
        return getMBeanServer().registerMBean(object, name);
    } else {
        return getMBeanServer().createMBean(className, name,
                                            params, signature);
    }
}
 
Example 19
/**
 * Call <code>checkWrite()</code>, then forward this method to the
 * wrapped object.
 */
public ObjectInstance registerMBean(Object object, ObjectName name)
    throws
    InstanceAlreadyExistsException,
    MBeanRegistrationException,
    NotCompliantMBeanException {
    checkWrite();
    return getMBeanServer().registerMBean(object, name);
}
 
Example 20
Source Project: lucene-solr   Source File: TestJmxIntegration.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void testJmxRegistration() throws Exception {
  assertTrue("No MBeans found in server", mbeanServer.getMBeanCount() > 0);

  Set<ObjectInstance> objects = mbeanServer.queryMBeans(null, null);
  assertFalse("No objects found in mbean server", objects
      .isEmpty());
  int numDynamicMbeans = 0;
  for (ObjectInstance o : objects) {
    ObjectName name = o.getObjectName();
    assertNotNull("Null name on: " + o.toString(), name);
    MBeanInfo mbeanInfo = mbeanServer.getMBeanInfo(name);
    if (name.getDomain().equals("solr")) {
      numDynamicMbeans++;
      MBeanAttributeInfo[] attrs = mbeanInfo.getAttributes();
      if (name.getKeyProperty("name").equals("fetcher")) { // no attributes without active replication
        continue;
      }
      assertTrue("No Attributes found for mbean: " + o.getObjectName() + ", " + mbeanInfo,
          0 < attrs.length);
      for (MBeanAttributeInfo attr : attrs) {
        // ensure every advertised attribute is gettable
        try {
          Object trash = mbeanServer.getAttribute(o.getObjectName(), attr.getName());
        } catch (javax.management.AttributeNotFoundException e) {
          throw new RuntimeException("Unable to featch attribute for " + o.getObjectName()
              + ": " + attr.getName(), e);
        }
      }
    }
  }
  assertTrue("No MBeans found", 0 < numDynamicMbeans);
}
 
Example 21
Source Project: dragonwell8_jdk   Source File: RMIConnector.java    License: GNU General Public License v2.0 5 votes vote down vote up
public ObjectInstance createMBean(String className,
        ObjectName name,
        ObjectName loaderName)
        throws ReflectionException,
        InstanceAlreadyExistsException,
        MBeanRegistrationException,
        MBeanException,
        NotCompliantMBeanException,
        InstanceNotFoundException,
        IOException {

    if (logger.debugOn())
        logger.debug("createMBean(String,ObjectName,ObjectName)",
                "className=" + className + ", name="
                + name + ", loaderName="
                + loaderName + ")");

    final ClassLoader old = pushDefaultClassLoader();
    try {
        return connection.createMBean(className,
                name,
                loaderName,
                delegationSubject);

    } catch (IOException ioe) {
        communicatorAdmin.gotIOException(ioe);

        return connection.createMBean(className,
                name,
                loaderName,
                delegationSubject);

    } finally {
        popDefaultClassLoader(old);
    }
}
 
Example 22
/**
 * Applies the specified queries to the set of ObjectInstances.
 */
private Set<ObjectInstance>
        filterListOfObjectInstances(Set<ObjectInstance> list,
                                    QueryExp query) {
    // Null query.
    //
    if (query == null) {
        return list;
    } else {
        Set<ObjectInstance> result = new HashSet<ObjectInstance>();
        // Access the filter.
        //
        for (ObjectInstance oi : list) {
            boolean res = false;
            MBeanServer oldServer = QueryEval.getMBeanServer();
            query.setMBeanServer(server);
            try {
                res = query.apply(oi.getObjectName());
            } catch (Exception e) {
                res = false;
            } finally {
                /*
                 * query.setMBeanServer is probably
                 * QueryEval.setMBeanServer so put back the old
                 * value.  Since that method uses a ThreadLocal
                 * variable, this code is only needed for the
                 * unusual case where the user creates a custom
                 * QueryExp that calls a nested query on another
                 * MBeanServer.
                 */
                query.setMBeanServer(oldServer);
            }
            if (res) {
                result.add(oi);
            }
        }
        return result;
    }
}
 
Example 23
Source Project: helix   Source File: TestParticipantManager.java    License: Apache License 2.0 5 votes vote down vote up
private void verifyHelixManagerMetrics(InstanceType type, MonitorLevel monitorLevel,
    String instanceName) throws MalformedObjectNameException {
  // check HelixCallback Monitor
  Set<ObjectInstance> objs =
      _server.queryMBeans(buildCallbackMonitorObjectName(type, clusterName, instanceName), null);
  Assert.assertEquals(objs.size(), 18);

  // check HelixZkClient Monitors
  objs =
      _server.queryMBeans(buildZkClientMonitorObjectName(type, clusterName, instanceName), null);
  Assert.assertEquals(objs.size(), 1);

  objs = _server.queryMBeans(buildZkClientPathMonitorObjectName(type, clusterName, instanceName),
      null);

  int expectedZkPathMonitor;
  switch (monitorLevel) {
  case ALL:
    expectedZkPathMonitor = 10;
    break;
  case AGGREGATED_ONLY:
    expectedZkPathMonitor = 1;
    break;
  default:
    expectedZkPathMonitor =
        type == InstanceType.CONTROLLER || type == InstanceType.CONTROLLER_PARTICIPANT ? 10 : 1;
  }
  Assert.assertEquals(objs.size(), expectedZkPathMonitor);
}
 
Example 24
Source Project: hottub   Source File: RMIConnector.java    License: GNU General Public License v2.0 5 votes vote down vote up
public ObjectInstance createMBean(String className,
        ObjectName name,
        ObjectName loaderName,
        Object params[],
        String signature[])
        throws ReflectionException,
        InstanceAlreadyExistsException,
        MBeanRegistrationException,
        MBeanException,
        NotCompliantMBeanException,
        InstanceNotFoundException,
        IOException {
    if (logger.debugOn()) logger.debug(
            "createMBean(String,ObjectName,ObjectName,Object[],String[])",
            "className=" + className + ", name=" + name + ", loaderName="
            + loaderName + ", signature=" + strings(signature));

    final MarshalledObject<Object[]> sParams =
            new MarshalledObject<Object[]>(params);
    final ClassLoader old = pushDefaultClassLoader();
    try {
        return connection.createMBean(className,
                name,
                loaderName,
                sParams,
                signature,
                delegationSubject);
    } catch (IOException ioe) {
        communicatorAdmin.gotIOException(ioe);

        return connection.createMBean(className,
                name,
                loaderName,
                sParams,
                signature,
                delegationSubject);
    } finally {
        popDefaultClassLoader(old);
    }
}
 
Example 25
@Override
public ObjectInstance createMBean(String className, ObjectName name) throws ReflectionException,
        InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException {
    Boolean originalValue = AUTHORIZING.get();
    try {
        AUTHORIZING.set(Boolean.TRUE);
        return delegate.createMBean(className, name);
    } finally {
        AUTHORIZING.set(originalValue);
    }
}
 
Example 26
/**
 * Call <code>checkWrite()</code>, then forward this method to the
 * wrapped object.
 */
public ObjectInstance registerMBean(Object object, ObjectName name)
    throws
    InstanceAlreadyExistsException,
    MBeanRegistrationException,
    NotCompliantMBeanException {
    checkWrite();
    return getMBeanServer().registerMBean(object, name);
}
 
Example 27
Source Project: lucene-solr   Source File: JmxMetricsReporter.java    License: Apache License 2.0 5 votes vote down vote up
private void unregisterMBean(ObjectName originalObjectName) throws InstanceNotFoundException, MBeanRegistrationException {
  ObjectName objectName = registered.remove(originalObjectName);
  if (objectName == null) {
    objectName = originalObjectName;
  }
  Set<ObjectInstance> objects = mBeanServer.queryMBeans(objectName, exp);
  for (ObjectInstance o : objects) {
    if (log.isDebugEnabled()) {
      log.debug("## Unregistered {}, tag={}", o.getObjectName().getCanonicalName(), tag);
    }
    mBeanServer.unregisterMBean(o.getObjectName());
  }
}
 
Example 28
Source Project: jdk8u60   Source File: PreRegisterNameTest.java    License: GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
    MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
    for (Class<?> c : new Class<?>[] {
            Spume.class, Thing.class, XSpume.class, XThing.class
         }) {
        for (ObjectName n : new ObjectName[] {null, new ObjectName("a:b=c")}) {
            System.out.println("Class " + c.getName() + " with name " + n +
                    "...");
            ObjectName realName = new ObjectName("a:type=" + c.getName());
            Constructor<?> constr = c.getConstructor(ObjectName.class);
            Object mbean = constr.newInstance(realName);
            ObjectInstance oi;
            String what =
                "Registering MBean of type " + c.getName() + " under name " +
                "<" + n + ">: ";
            try {
                oi = mbs.registerMBean(mbean, n);
            } catch (Exception e) {
                e.printStackTrace();
                fail(what + " got " + e);
                continue;
            }
            ObjectName registeredName = oi.getObjectName();
            if (!registeredName.equals(realName))
                fail(what + " registered as " + registeredName);
            if (!mbs.isRegistered(realName)) {
                fail(what + " not registered as expected");
            }
            mbs.unregisterMBean(registeredName);
        }
    }
    System.err.flush();
    if (failures == 0)
        System.out.println("TEST PASSED");
    else
        throw new Exception("TEST FAILED: " + failure);
}
 
Example 29
Source Project: TencentKona-8   Source File: RMIConnector.java    License: GNU General Public License v2.0 5 votes vote down vote up
public ObjectInstance createMBean(String className,
        ObjectName name,
        ObjectName loaderName)
        throws ReflectionException,
        InstanceAlreadyExistsException,
        MBeanRegistrationException,
        MBeanException,
        NotCompliantMBeanException,
        InstanceNotFoundException,
        IOException {

    if (logger.debugOn())
        logger.debug("createMBean(String,ObjectName,ObjectName)",
                "className=" + className + ", name="
                + name + ", loaderName="
                + loaderName + ")");

    final ClassLoader old = pushDefaultClassLoader();
    try {
        return connection.createMBean(className,
                name,
                loaderName,
                delegationSubject);

    } catch (IOException ioe) {
        communicatorAdmin.gotIOException(ioe);

        return connection.createMBean(className,
                name,
                loaderName,
                delegationSubject);

    } finally {
        popDefaultClassLoader(old);
    }
}
 
Example 30
public ObjectInstance createMBean(String className, ObjectName name,
                                  ObjectName loaderName,
                                  Object[] params, String[] signature)
    throws ReflectionException, InstanceAlreadyExistsException,
           MBeanRegistrationException, MBeanException,
           NotCompliantMBeanException, InstanceNotFoundException  {

    return createMBean(className, name, loaderName, false,
                       params, signature);
}