Search in sources :

Example 1 with MQJMXConnectorInfo

use of org.glassfish.jms.admin.cli.MQJMXConnectorInfo in project Payara by payara.

the class JmsHandlers method getMBeanServerConnection.

private static MBeanServerConnection getMBeanServerConnection(String target) throws ConnectorRuntimeException, Exception {
    ServiceLocator habitat = GuiUtil.getHabitat();
    Domain domain = habitat.getService(Domain.class);
    Cluster cluster = domain.getClusterNamed(target);
    String configRef = null;
    if (cluster == null) {
        Server server = domain.getServerNamed(target);
        configRef = server.getConfigRef();
    } else {
        configRef = cluster.getConfigRef();
    }
    PhysicalDestinations pd = new PhysicalDestinations();
    MQJMXConnectorInfo mqInfo = pd.getConnectorInfo(target, configRef, habitat, domain);
    return mqInfo.getMQMBeanServerConnection();
}
Also used : ServiceLocator(org.glassfish.hk2.api.ServiceLocator) MBeanServer(javax.management.MBeanServer) Server(com.sun.enterprise.config.serverbeans.Server) Cluster(com.sun.enterprise.config.serverbeans.Cluster) Domain(com.sun.enterprise.config.serverbeans.Domain) MQJMXConnectorInfo(org.glassfish.jms.admin.cli.MQJMXConnectorInfo)

Aggregations

Cluster (com.sun.enterprise.config.serverbeans.Cluster)1 Domain (com.sun.enterprise.config.serverbeans.Domain)1 Server (com.sun.enterprise.config.serverbeans.Server)1 MBeanServer (javax.management.MBeanServer)1 ServiceLocator (org.glassfish.hk2.api.ServiceLocator)1 MQJMXConnectorInfo (org.glassfish.jms.admin.cli.MQJMXConnectorInfo)1