ObjectName objectName = new ObjectName("jboss.system:service=ServiceController");
mbeanServer.registerMBean(serviceController, objectName);
try
{
ClassLoader loader = Thread.currentThread().getContextClassLoader();
mbeanServer.registerMBean(new JmxCL(loader), new ObjectName("jboss:service=defaultClassLoader"));
BasicBootstrap bootstrap = new BasicBootstrap();
bootstrap.run();
Kernel kernel = bootstrap.getKernel();
AbstractController controller = (AbstractController)kernel.getController();