List of usage examples for javax.management MBeanServerConnection createMBean
public ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName, Object params[], String signature[]) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, InstanceNotFoundException, IOException;
Instantiates and registers an MBean in the MBean server.
From source file:org.helios.collector.jmx.connection.AbstractMBeanServerConnectionFactory.java
/** * Instantiates and registers an MBean in the MBean server. * @param className/*from w w w . ja va 2 s . c om*/ * @param objectName * @param loaderName * @param param * @param signature * @return the ObjectInstance representing the created MBean * @throws ReflectionException * @throws InstanceAlreadyExistsException * @throws MBeanRegistrationException * @throws MBeanException * @throws NotCompliantMBeanException * @throws IOException * @throws InstanceNotFoundException */ @Override @ManagedOperation public ObjectInstance createMBean(String className, ObjectName objectName, ObjectName loaderName, Object[] params, String[] signature) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, IOException, InstanceNotFoundException { validateConn(); MBeanServerConnection conn = null; try { conn = getPooledConnection(); return conn.createMBean(className, objectName, loaderName, params, signature); } catch (MBeanServerConnectionFactoryException e) { throw new RuntimeException("Failed to get pooled connection", e); } finally { try { this.returnPooledConnection(conn); } catch (Exception e) { log.debug(e.getMessage()); } } }