MUM.metadataService
Class MetadataServiceConnectionMaker

java.lang.Object
  extended byMUM.metadataService.MetadataServiceConnectionMaker
All Implemented Interfaces:
Daemon, java.lang.Runnable

public class MetadataServiceConnectionMaker
extends java.lang.Object
implements java.lang.Runnable, Daemon

This class implements a MetaDataContainerConnectionMaker. This component listen for requests on the port where it can be istantiated then creates a new thread to serve the request and return to wait for new requests


Field Summary
 
Fields inherited from interface SOMA.network.connection.Daemon
ERROR, OFF, ON
 
Constructor Summary
MetadataServiceConnectionMaker(IMetadataCacheManager metadataCacheManager, IPoliciesManager policiesManager, java.io.PrintStream out)
          The constructor doesn't do anything, you must call the start method to activate the connection manager
 
Method Summary
 java.net.InetAddress getInetAddress()
          Returns the local address of this server socket.
 int getPort()
          Returns the port on which the socket was istantiated
 java.lang.Object getStatus()
          Returns the status of the daemon.
 void run()
          This is the method executed by the daemon.
 void start()
          Activate the connection manager (the metadata server)
 void stop()
          Stop the connection manager (the metadata server)
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MetadataServiceConnectionMaker

public MetadataServiceConnectionMaker(IMetadataCacheManager metadataCacheManager,
                                      IPoliciesManager policiesManager,
                                      java.io.PrintStream out)
The constructor doesn't do anything, you must call the start method to activate the connection manager

Method Detail

start

public void start()
           throws java.io.IOException,
                  MetaDataContainerConnectionMakerException
Activate the connection manager (the metadata server)

Specified by:
start in interface Daemon
Throws:
java.io.IOException
MetaDataContainerConnectionMakerException

stop

public void stop()
          throws java.io.IOException,
                 MetaDataContainerConnectionMakerException
Stop the connection manager (the metadata server)

Specified by:
stop in interface Daemon
Throws:
java.io.IOException
MetaDataContainerConnectionMakerException

toString

public java.lang.String toString()

getStatus

public java.lang.Object getStatus()
Returns the status of the daemon.

Specified by:
getStatus in interface Daemon

run

public void run()
This is the method executed by the daemon. It activates metadata protocol agents until status==ON and the listenSocket is active

Specified by:
run in interface java.lang.Runnable

getInetAddress

public java.net.InetAddress getInetAddress()
Returns the local address of this server socket. Must be called after start()

Returns:
the address to which this socket is connected, or null if the socket is not yet connected.

getPort

public int getPort()
Returns the port on which the socket was istantiated

Returns:
an integer which is the port of this service


Copyright © 2004 Luca Foschini