org.objectweb.dsrg.sofa.deployment.zeroconf
Interface ZeroConfServerMBean

All Known Implementing Classes:
ZeroConfServer

public interface ZeroConfServerMBean

MBean interface for ZeroConfServer.


Nested Class Summary
static class ZeroConfServerMBean.LauncherInfo
           
 
Method Summary
 ZeroConfServerMBean.LauncherInfo[] getLauncherInfos()
          Returns the information about all the registered launchers.
 java.lang.String getProperty(java.lang.String name)
          Returns the value of property name, or null if there is no property named name.
 boolean hangup(int port)
          Stops listening on port on local machine.
 boolean hangup(java.lang.String hostname, int port)
          Stops listening on hostname:port.
 void hangupAll()
          Stops listening for requests on any sockets.
 void listen()
          Starts listening for configuration requests on local machine and the default port.
 void listen(int port)
          Starts listening for configuration requests on local machine and given port.
 void listen(java.lang.String hostname, int port)
          Starts listening for configuration requests on the given local host and port.
 java.lang.String[] listeningAddresses()
          Returns a list of socket addresses on which the server is listening to requests.
 java.lang.String[] listProperties()
          Returns an array of all set properties in property=value format with special characters escaped as in java.util.Properties stored in a file.
 java.lang.String[] listPropertyNames()
          Returns an array of names of all set properties
 void registerLauncher(java.lang.String url, java.lang.String objectName)
          Registers the launcher in the zeroconf server.
 java.lang.String setProperty(java.lang.String name, java.lang.String value)
          Sets the value of property name to value.
 void stop()
          Stops listening for requests on any sockets and closes the JMX interface.
 

Method Detail

getProperty

java.lang.String getProperty(java.lang.String name)
Returns the value of property name, or null if there is no property named name.


setProperty

java.lang.String setProperty(java.lang.String name,
                             java.lang.String value)
Sets the value of property name to value.

Returns:
The previous value of property name, or null if none was set.

listPropertyNames

java.lang.String[] listPropertyNames()
Returns an array of names of all set properties


listProperties

java.lang.String[] listProperties()
Returns an array of all set properties in property=value format with special characters escaped as in java.util.Properties stored in a file.


listen

void listen()
            throws java.net.SocketException
Starts listening for configuration requests on local machine and the default port. Server will listen in a new thread. This call returns after the thread starts.

Throws:
java.net.SocketException - if binding to the default port on local machine fails.

listen

void listen(int port)
            throws java.net.SocketException
Starts listening for configuration requests on local machine and given port. Server will listen in a new thread. This call returns after the thread starts.

Parameters:
port - port to listen on
Throws:
java.net.SocketException - if binding to port on local machine fails.

listen

void listen(java.lang.String hostname,
            int port)
            throws java.net.SocketException
Starts listening for configuration requests on the given local host and port. Server will listen in a new thread. This call returns after the thread starts.

Parameters:
hostname - local host name to listen on
port - port to listen on
Throws:
java.net.SocketException - if binding to port on the given host machine fails.

listeningAddresses

java.lang.String[] listeningAddresses()
Returns a list of socket addresses on which the server is listening to requests.


hangup

boolean hangup(int port)
Stops listening on port on local machine.

Returns:
false if the server was not listening on port on local machine, true otherwise.

hangup

boolean hangup(java.lang.String hostname,
               int port)
Stops listening on hostname:port.

Returns:
false if the server was not listening on hostname:port, true otherwise.

hangupAll

void hangupAll()
Stops listening for requests on any sockets.


stop

void stop()
Stops listening for requests on any sockets and closes the JMX interface. This will stop all non-daemon threads started by the server. If the server is running as a standalone process, this will effectively cause the server to stop.


registerLauncher

void registerLauncher(java.lang.String url,
                      java.lang.String objectName)
Registers the launcher in the zeroconf server.

Parameters:
url - The jmx service url of the launcher.
objectName - The objectname of the launcher.

getLauncherInfos

ZeroConfServerMBean.LauncherInfo[] getLauncherInfos()
Returns the information about all the registered launchers.