List of usage examples for javax.management MBeanServer instantiate
public Object instantiate(String className) throws ReflectionException, MBeanException;
Instantiates an object using the list of all class loaders registered in the MBean server's javax.management.loading.ClassLoaderRepository Class Loader Repository .
From source file:com.meltmedia.cadmium.deployer.JBossUtil.java
public static void addVirtualHost(String domain, Logger log) throws InstanceNotFoundException, MalformedObjectNameException, ReflectionException, MBeanException, NullPointerException { MBeanServer server = MBeanServerLocator.locateJBoss(); boolean aliasFound = server.isRegistered(new ObjectName("jboss.web:type=Host,host=" + domain)); if (!aliasFound) { log.info("Adding vHost {} to jboss", domain); Host host = (Host) server.instantiate("org.apache.catalina.core.StandardHost"); host.setName(domain);//from w w w . java 2s . c om server.invoke(new ObjectName("jboss.web:type=Engine"), "addChild", new Object[] { host }, new String[] { "org.apache.catalina.Container" }); } }