zeus.actors
Class Server

java.lang.Object
  extended byjava.lang.Thread
      extended byzeus.actors.Server
All Implemented Interfaces:
InTray, java.lang.Runnable
Direct Known Subclasses:
Container_Server, FIPA_2000_HTTP_Server, FIPA_2000_IIOP_Server, FIPA_97_Server, FIPA_Server, Zeus_ACC_Server

public class Server
extends java.lang.Thread
implements InTray

This component is part of the MailBox, and is responsible for reading incoming messages. This component operates within its own thread enabling the MailBox to send and receive multiple messages simultaneously.

It is unlikely that developers will need to call these methods directly. Although if the user wants to replace the default TCP/IP messaging mechanism this could be cleanly achieved by reimplementing the methods of this class.


Field Summary
protected  Address address
           
protected  int connection_count
           
private  AgentContext context
           
static int DEFAULT_PORT_MAX
           
static int DEFAULT_PORT_MIN
           
protected  Queue inMail
          Data structure holding messages as they are read in
protected  java.net.ServerSocket listenSocket
           
static int MAX_CONNECTIONS
           
static int MAX_QUEUE_LENGTH
           
protected  MailBox mbox
          Reference to MailBox of which this is a sub-component
protected  MsgHandler msgHandler
           
protected  boolean processing
           
protected  long timeout
          timeout was originally private, but subclasses need to use it to construct there own treads of control, so I changed it to protected (ST -14/8/00)
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Server()
           
Server(AgentContext context, MailBox mbox, Queue inMail)
           
 
Method Summary
 void debug(java.lang.String str)
           
protected  void finalize()
           
 Address getAddress()
           
 AgentContext getAgentContext()
           
 java.lang.String getResponseAddress()
          implement in haste, repent at leisure
 void lowerStatus()
           
 void newMsg(Performative msg)
          ensures that messages are processed // synchronized
 void normalStatus()
           
 void run()
           
 void stopProcessing()
           
 void updateCount(int x)
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MAX_CONNECTIONS

public static final int MAX_CONNECTIONS
See Also:
Constant Field Values

MAX_QUEUE_LENGTH

public static final int MAX_QUEUE_LENGTH
See Also:
Constant Field Values

DEFAULT_PORT_MIN

public static final int DEFAULT_PORT_MIN
See Also:
Constant Field Values

DEFAULT_PORT_MAX

public static final int DEFAULT_PORT_MAX
See Also:
Constant Field Values

listenSocket

protected java.net.ServerSocket listenSocket

address

protected Address address

connection_count

protected int connection_count

processing

protected boolean processing

context

private AgentContext context

timeout

protected long timeout
timeout was originally private, but subclasses need to use it to construct there own treads of control, so I changed it to protected (ST -14/8/00)


inMail

protected Queue inMail
Data structure holding messages as they are read in


mbox

protected MailBox mbox
Reference to MailBox of which this is a sub-component


msgHandler

protected MsgHandler msgHandler
Constructor Detail

Server

public Server()

Server

public Server(AgentContext context,
              MailBox mbox,
              Queue inMail)
Method Detail

getAgentContext

public AgentContext getAgentContext()

updateCount

public void updateCount(int x)

stopProcessing

public void stopProcessing()

lowerStatus

public void lowerStatus()

normalStatus

public void normalStatus()

run

public void run()
Specified by:
run in interface java.lang.Runnable

finalize

protected void finalize()

getAddress

public Address getAddress()

newMsg

public void newMsg(Performative msg)
ensures that messages are processed // synchronized


getResponseAddress

public java.lang.String getResponseAddress()
implement in haste, repent at leisure

Specified by:
getResponseAddress in interface InTray

debug

public void debug(java.lang.String str)


Copyright © 2000-2003 BT Exact Technologies. All Rights Reserved.