Example usage for javax.management.remote JMXServiceURL getHost

List of usage examples for javax.management.remote JMXServiceURL getHost

Introduction

In this page you can find the example usage for javax.management.remote JMXServiceURL getHost.

Prototype

public String getHost() 

Source Link

Document

The host part of the Service URL.

Usage

From source file:net.sbbi.upnp.jmx.upnp.UPNPConnectorServer.java

public UPNPConnectorServer(MBeanServer server, JMXServiceURL serviceURL, Map env) throws IOException {
    super(server);
    this.serviceURL = serviceURL;
    this.env = env;
    // TODO implement an JMXConnector for security (such as basic http auth)? problems with the UPNP protocol itself
    sktAddress = new InetSocketAddress(InetAddress.getByName(serviceURL.getHost()), serviceURL.getPort());
    builder = (UPNPMBeanBuilder) env.get(UPNP_MBEANS_BUILDER);
    if (builder == null) {
        builder = new UPNPMBeanBuilderImpl();
    }/*from  w  w w .  j  ava 2s  .co m*/
    exposeUPNPAsMBeans = (Boolean) env.get(EXPOSE_UPNP_DEVICES_AS_MBEANS);
    if (exposeUPNPAsMBeans == null)
        exposeUPNPAsMBeans = Boolean.FALSE;
    exposeMBeansAsUPNP = (Boolean) env.get(EXPOSE_MBEANS_AS_UPNP_DEVICES);
    if (exposeMBeansAsUPNP == null)
        exposeMBeansAsUPNP = Boolean.TRUE;
    handleSSDPMessages = (Boolean) env.get(HANDLE_SSDP_MESSAGES);
    if (handleSSDPMessages == null)
        handleSSDPMessages = Boolean.FALSE;
    exposeExistingMBeansAsUPNP = (Boolean) env.get(EXPOSE_EXISTING_MBEANS_AS_UPNP_DEVICES);
    if (exposeExistingMBeansAsUPNP == null)
        exposeExistingMBeansAsUPNP = Boolean.FALSE;

    if (!exposeMBeansAsUPNP.booleanValue() && !exposeUPNPAsMBeans.booleanValue()
            && !exposeExistingMBeansAsUPNP.booleanValue()) {
        throw new IOException("Useless UPNPConnectorServer since nothing will be deployed, unregister it");
    }
}