Package net.sbbi.upnp.jmx.upnp
Class UPNPConnectorServer
- java.lang.Object
-
- javax.management.NotificationBroadcasterSupport
-
- javax.management.remote.JMXConnectorServer
-
- net.sbbi.upnp.jmx.upnp.UPNPConnectorServer
-
- All Implemented Interfaces:
EventListener,MBeanRegistration,NotificationBroadcaster,NotificationEmitter,NotificationListener,JMXAddressable,JMXConnectorServerMBean
public class UPNPConnectorServer extends JMXConnectorServer implements NotificationListener
JMX connector server, this connector can be used to expose all deployed MBeans on an MBeans Server as UPNP devices. You can use an object implementing theUPNPMBeanBuilderinterface do define which beans can be deployed as UPNP devices. Look at the UPNP_MBEANS_BUILDER, EXPOSE_UPNP_DEVICES_AS_MBEANS and EXPOSE_MBEANS_AS_UPNP_DEVICES vars for more info about connector specific settings.- Version:
- 1.0
- Author:
- SuperBonBon
-
-
Field Summary
Fields Modifier and Type Field Description static StringEXPOSE_EXISTING_MBEANS_AS_UPNP_DEVICESWhen set to true all MBeans registred into the MBeans server prior to the connector registration will be exposed as UPNP devices Default to Boolean.FALSEstatic StringEXPOSE_MBEANS_AS_UPNP_DEVICESEnvironnment key to define if the MBeans registered into the connector MBeans server can be exposed as UPNP devices.static StringEXPOSE_UPNP_DEVICES_AS_MBEANSEnvironement key do define if the connector can also expose as MBeans all UPNP devices services on the network.static StringEXPOSE_UPNP_DEVICES_AS_MBEANS_TIMEOUTInteger key to define the discovery timeout (in ms) of UPNP devices on the network when the EXPOSE_UPNP_DEVICES_AS_MBEANS env key is set to Boolean.TRUEstatic StringHANDLE_SSDP_MESSAGESEnvironement key when EXPOSE_UPNP_DEVICES_AS_MBEANS is set to true, will define SSDP messages will be handled by the connector, if set to true new devices joining the network will be automatically exposed as MBeans Key value must be Boolean.TRUE or Boolean.FALSE, default to Boolean.FALSEstatic StringUPNP_MBEANS_BUILDEREnvironement key used to define theUPNPMBeanBuilderused to select MBeans to deploy as UPNP devices Key value must be an object UPNPMBeanBuilder instance.-
Fields inherited from class javax.management.remote.JMXConnectorServer
AUTHENTICATOR
-
-
Constructor Summary
Constructors Constructor Description UPNPConnectorServer(MBeanServer server, JMXServiceURL serviceURL, Map env)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JMXServiceURLgetAddress()MapgetAttributes()voidhandleNotification(Notification notification, Object handBack)booleanisActive()voidstart()voidstop()-
Methods inherited from class javax.management.remote.JMXConnectorServer
connectionClosed, connectionFailed, connectionOpened, getConnectionIds, getMBeanServer, getNotificationInfo, postDeregister, postRegister, preDeregister, preRegister, setMBeanServerForwarder, toJMXConnector
-
Methods inherited from class javax.management.NotificationBroadcasterSupport
addNotificationListener, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
-
-
-
-
Field Detail
-
UPNP_MBEANS_BUILDER
public static final String UPNP_MBEANS_BUILDER
Environement key used to define theUPNPMBeanBuilderused to select MBeans to deploy as UPNP devices Key value must be an object UPNPMBeanBuilder instance. When no implemntation is provided, the defaultUPNPMBeanBuilderImplwill be use.
-
EXPOSE_UPNP_DEVICES_AS_MBEANS
public static final String EXPOSE_UPNP_DEVICES_AS_MBEANS
Environement key do define if the connector can also expose as MBeans all UPNP devices services on the network. Key value must be Boolean.TRUE or Boolean.FALSE, default to Boolean.FALSE
-
EXPOSE_UPNP_DEVICES_AS_MBEANS_TIMEOUT
public static final String EXPOSE_UPNP_DEVICES_AS_MBEANS_TIMEOUT
Integer key to define the discovery timeout (in ms) of UPNP devices on the network when the EXPOSE_UPNP_DEVICES_AS_MBEANS env key is set to Boolean.TRUE
-
HANDLE_SSDP_MESSAGES
public static final String HANDLE_SSDP_MESSAGES
Environement key when EXPOSE_UPNP_DEVICES_AS_MBEANS is set to true, will define SSDP messages will be handled by the connector, if set to true new devices joining the network will be automatically exposed as MBeans Key value must be Boolean.TRUE or Boolean.FALSE, default to Boolean.FALSE
-
EXPOSE_MBEANS_AS_UPNP_DEVICES
public static final String EXPOSE_MBEANS_AS_UPNP_DEVICES
Environnment key to define if the MBeans registered into the connector MBeans server can be exposed as UPNP devices. Key value must be Boolean.TRUE or Boolean.FALSE, default to Boolean.TRUE
-
EXPOSE_EXISTING_MBEANS_AS_UPNP_DEVICES
public static final String EXPOSE_EXISTING_MBEANS_AS_UPNP_DEVICES
When set to true all MBeans registred into the MBeans server prior to the connector registration will be exposed as UPNP devices Default to Boolean.FALSE
-
-
Constructor Detail
-
UPNPConnectorServer
public UPNPConnectorServer(MBeanServer server, JMXServiceURL serviceURL, Map env) throws IOException
- Throws:
IOException
-
-
Method Detail
-
getAddress
public JMXServiceURL getAddress()
- Specified by:
getAddressin interfaceJMXAddressable- Specified by:
getAddressin interfaceJMXConnectorServerMBean
-
getAttributes
public Map getAttributes()
- Specified by:
getAttributesin interfaceJMXConnectorServerMBean
-
isActive
public boolean isActive()
- Specified by:
isActivein interfaceJMXConnectorServerMBean
-
start
public void start() throws IOException- Specified by:
startin interfaceJMXConnectorServerMBean- Throws:
IOException
-
stop
public void stop() throws IOException- Specified by:
stopin interfaceJMXConnectorServerMBean- Throws:
IOException
-
handleNotification
public void handleNotification(Notification notification, Object handBack)
- Specified by:
handleNotificationin interfaceNotificationListener
-
-