net.sbbi.upnp.jmx.upnp
Class UPNPConnectorServer

java.lang.Object
  extended by javax.management.NotificationBroadcasterSupport
      extended by javax.management.remote.JMXConnectorServer
          extended by net.sbbi.upnp.jmx.upnp.UPNPConnectorServer
All Implemented Interfaces:
EventListener, javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, javax.management.NotificationListener, javax.management.remote.JMXAddressable, javax.management.remote.JMXConnectorServerMBean

public class UPNPConnectorServer
extends javax.management.remote.JMXConnectorServer
implements javax.management.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 the UPNPMBeanBuilder interface 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
static 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
static 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.
static 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.
static 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
static 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
static String UPNP_MBEANS_BUILDER
          Environement key used to define the UPNPMBeanBuilder used 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
UPNPConnectorServer(javax.management.MBeanServer server, javax.management.remote.JMXServiceURL serviceURL, Map env)
           
 
Method Summary
 javax.management.remote.JMXServiceURL getAddress()
           
 Map getAttributes()
           
 void handleNotification(javax.management.Notification notification, Object handBack)
           
 boolean isActive()
           
 void start()
           
 void stop()
           
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UPNP_MBEANS_BUILDER

public static final String UPNP_MBEANS_BUILDER
Environement key used to define the UPNPMBeanBuilder used to select MBeans to deploy as UPNP devices Key value must be an object UPNPMBeanBuilder instance. When no implemntation is provided, the default UPNPMBeanBuilderImpl will 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(javax.management.MBeanServer server,
                           javax.management.remote.JMXServiceURL serviceURL,
                           Map env)
                    throws IOException
Throws:
IOException
Method Detail

getAddress

public javax.management.remote.JMXServiceURL getAddress()
Specified by:
getAddress in interface javax.management.remote.JMXAddressable
Specified by:
getAddress in interface javax.management.remote.JMXConnectorServerMBean

getAttributes

public Map getAttributes()
Specified by:
getAttributes in interface javax.management.remote.JMXConnectorServerMBean

isActive

public boolean isActive()
Specified by:
isActive in interface javax.management.remote.JMXConnectorServerMBean

start

public void start()
           throws IOException
Specified by:
start in interface javax.management.remote.JMXConnectorServerMBean
Throws:
IOException

stop

public void stop()
          throws IOException
Specified by:
stop in interface javax.management.remote.JMXConnectorServerMBean
Throws:
IOException

handleNotification

public void handleNotification(javax.management.Notification notification,
                               Object handBack)
Specified by:
handleNotification in interface javax.management.NotificationListener


Copyright © 2010. All Rights Reserved.