Example usage for javax.management MBeanServer getDomains

List of usage examples for javax.management MBeanServer getDomains

Introduction

In this page you can find the example usage for javax.management MBeanServer getDomains.

Prototype

public String[] getDomains();

Source Link

Usage

From source file:net.camelpe.examples.jboss7.loanbroker.queue.JBoss7CamelContextConfiguration.java

@PostConstruct
public void createQueues() throws Exception {
    this.log.info("Creating queues ...");
    final MBeanServer mbeanServer = ManagementFactory.getPlatformMBeanServer();
    this.log.info("Found PlatformMBeanServer [{}]", mbeanServer);
    this.log.info("JMX Domains: {}", Arrays.toString(mbeanServer.getDomains()));
    for (final JmsResources.QueueDefinition queueDef : JmsResources.loanBrokerQueues()) {
        mbeanServer.invoke(new ObjectName("org.hornetq:module=JMS,type=Server"), "createQueue",
                new Object[] { queueDef.getName(), queueDef.getBinding() },
                new String[] { "java.lang.String", "java.lang.String" });
        this.log.info("Created queue [{}]", queueDef);
    }/*from  w ww  . ja  va 2 s.c  om*/
}