fr.dyade.aaa.agent
Class HttpNetwork

java.lang.Object
  extended byfr.dyade.aaa.agent.Network
      extended byfr.dyade.aaa.agent.StreamNetwork
          extended byfr.dyade.aaa.agent.HttpNetwork
All Implemented Interfaces:
MessageConsumer, NetworkMBean

public class HttpNetwork
extends StreamNetwork

HttpNetwork is a simple implementation of StreamNetwork based on HTTP 1.1 protocol.


Field Summary
protected  long activationPeriod
          Period of time between two activation of NetServerOut, it matchs to the time between two requests from the client to the server when there is no message to transmit from client to server.
 
Fields inherited from class fr.dyade.aaa.agent.Network
bootTSFN, domain, idxLS, logmon, name, port, qout, servers, serversFN, sid
 
Constructor Summary
HttpNetwork()
          Creates a new network component.
 
Method Summary
protected  fr.dyade.aaa.agent.Message getReply(java.io.InputStream is)
           
protected  fr.dyade.aaa.agent.Message getRequest(java.io.InputStream is)
           
 void init(java.lang.String name, int port, short[] servers)
          Initializes a new network component.
 boolean isRunning()
          Tests if the network component is alive.
protected  java.lang.String readLine(java.io.InputStream is)
           
protected  void sendReply(fr.dyade.aaa.agent.Message msg, java.io.OutputStream os)
           
protected  void sendRequest(fr.dyade.aaa.agent.Message msg, java.io.OutputStream os)
           
 void start()
          Causes this network component to begin execution.
 void stop()
          Forces the network component to stop executing.
 java.lang.String toString()
          Returns a string representation of this consumer, including the daemon's name and status.
 void wakeup()
          Wakes up the watch-dog thread.
 
Methods inherited from class fr.dyade.aaa.agent.Network
delete, deliver, getDomainName, getName, getPort, getQueue, index, insert, post, restore, save, setPort, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

activationPeriod

protected long activationPeriod
Period of time between two activation of NetServerOut, it matchs to the time between two requests from the client to the server when there is no message to transmit from client to server. This value can be adjusted for all HttpNetwork components by setting ActivationPeriod global property or for a particular network by setting \.ActivationPeriod specific property.

Theses properties can be fixed either from java launching command, or in a3servers.xml configuration file.

Constructor Detail

HttpNetwork

public HttpNetwork()
Creates a new network component.

Method Detail

init

public void init(java.lang.String name,
                 int port,
                 short[] servers)
          throws java.lang.Exception
Initializes a new network component. This method is used in order to easily creates and configure a Network component from a class name. So we can use the Class.newInstance() method for create (whitout any parameter) the component, then we can initialize it with this method.
This method initializes the logical clock for the domain.

Overrides:
init in class StreamNetwork
Parameters:
name - The domain name.
port - The listen port.
servers - The list of servers directly accessible from this network interface.
Throws:
java.lang.Exception
See Also:
Network

start

public void start()
           throws java.lang.Exception
Causes this network component to begin execution.

Throws:
java.lang.Exception
See Also:
stop

wakeup

public void wakeup()
Wakes up the watch-dog thread.


stop

public void stop()
Forces the network component to stop executing.

See Also:
start

isRunning

public boolean isRunning()
Tests if the network component is alive.

Returns:
true if this MessageConsumer is alive; false otherwise.

toString

public java.lang.String toString()
Returns a string representation of this consumer, including the daemon's name and status.

Overrides:
toString in class Network
Returns:
A string representation of this consumer.

readLine

protected java.lang.String readLine(java.io.InputStream is)
                             throws java.io.IOException
Throws:
java.io.IOException

sendRequest

protected void sendRequest(fr.dyade.aaa.agent.Message msg,
                           java.io.OutputStream os)
                    throws java.lang.Exception
Throws:
java.lang.Exception

getRequest

protected fr.dyade.aaa.agent.Message getRequest(java.io.InputStream is)
                                         throws java.lang.Exception
Throws:
java.lang.Exception

sendReply

protected void sendReply(fr.dyade.aaa.agent.Message msg,
                         java.io.OutputStream os)
                  throws java.lang.Exception
Throws:
java.lang.Exception

getReply

protected fr.dyade.aaa.agent.Message getReply(java.io.InputStream is)
                                       throws java.lang.Exception
Throws:
java.lang.Exception


Copyright ? 2004 Scalagent - All rights reserved