org.mmbase.remote
Class MMHttpAcceptor

java.lang.Object
  |
  +--org.mmbase.remote.MMHttpAcceptor
All Implemented Interfaces:
MMProtocolDriver, java.lang.Runnable

public class MMHttpAcceptor
extends java.lang.Object
implements java.lang.Runnable, MMProtocolDriver

Version:
$Revision: 1.17 $ $Date: 2001/07/02 16:56:09 $
Author:
Daniel Ockeloen

Constructor Summary
MMHttpAcceptor(java.lang.String servername, java.lang.String remoteHost, int remotePort)
           
 
Method Summary
 boolean addListener(java.lang.String buildername, java.lang.String nodename, RemoteBuilder serv)
          Stores remote builder reference in hashtable using the service Reference name as key.
 boolean commitNode(java.lang.String nodename, java.lang.String tableName, java.lang.String xml)
           
 void doWork()
          Lowers the current thread priority and creates a new MMHttpHandler instance.
 java.lang.String getLocalHost()
          Gets the localhost name.
 int getLocalPort()
          Gets localport number.
 boolean getNode(java.lang.String nodename, java.lang.String tableName)
          Connects to remote host and requests for an xml version of the node, retrieves xmldata and calls the parser to store node locally as a hashtable.
 java.lang.String getProtocol()
          Gets protocol name.
 void init()
          Calls start().
 byte[] readContentLength(int len, java.io.DataInputStream in)
           
 void run()
          Sets the priority of the admin thread a little higher and continuous with work.
 void start()
          Starts the admin Thread.
 void stop()
          Stops the admin Thread.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MMHttpAcceptor

public MMHttpAcceptor(java.lang.String servername,
                      java.lang.String remoteHost,
                      int remotePort)
Method Detail

init

public void init()
Calls start().

start

public void start()
Starts the admin Thread.

stop

public void stop()
Stops the admin Thread.

run

public void run()
Sets the priority of the admin thread a little higher and continuous with work.
Specified by:
run in interface java.lang.Runnable

doWork

public void doWork()
Lowers the current thread priority and creates a new MMHttpHandler instance.

commitNode

public boolean commitNode(java.lang.String nodename,
                          java.lang.String tableName,
                          java.lang.String xml)
Specified by:
commitNode in interface MMProtocolDriver

addListener

public boolean addListener(java.lang.String buildername,
                           java.lang.String nodename,
                           RemoteBuilder serv)
Stores remote builder reference in hashtable using the service Reference name as key.
Specified by:
addListener in interface MMProtocolDriver
Returns:
true, always

getNode

public boolean getNode(java.lang.String nodename,
                       java.lang.String tableName)
Connects to remote host and requests for an xml version of the node, retrieves xmldata and calls the parser to store node locally as a hashtable.
Specified by:
getNode in interface MMProtocolDriver
Parameters:
nodename - the name of the service node (aka remotebuilder node)
tableName - the name of the service builder (aka remotebuilder) that created it.
Returns:
true, always

getLocalPort

public int getLocalPort()
Gets localport number.
Specified by:
getLocalPort in interface MMProtocolDriver
Returns:
port number as an integer.

getProtocol

public java.lang.String getProtocol()
Gets protocol name.
Specified by:
getProtocol in interface MMProtocolDriver
Returns:
protocol name.

getLocalHost

public java.lang.String getLocalHost()
Gets the localhost name.
Specified by:
getLocalHost in interface MMProtocolDriver
Returns:
localhost name.

readContentLength

public byte[] readContentLength(int len,
                                java.io.DataInputStream in)

toString

public java.lang.String toString()
Specified by:
toString in interface MMProtocolDriver
Overrides:
toString in class java.lang.Object


MMBase 2001