CSP for Java
(JCSP) 1.1-rc4

org.jcsp.net
Class LinkServer

java.lang.Object
  extended by org.jcsp.net.LinkServer

public abstract class LinkServer
extends Object

An abstract class that must be implemented by communication protocol implementations. LinkServer objects are processes which listen on a certain address for connection requests. When a request is received, a Link should be spawned in server mode.

Author:
Quickstone Technologies Limited

Constructor Summary
protected LinkServer(ProtocolID protocolID, NodeAddressID linkServerAddressID)
          Constructor.
 
Method Summary
protected static LinkServer create(NodeAddressID addressID)
          Create a server on a specifiedNodeAddressID, and start it.
protected  NodeAddressID getLinkServerAddressID()
          Protected accessor for obtaining the NodeAddressID on which this server is listening.
protected  ProtocolID getProtocolID()
          Gets the protocol that this LinkServer supports.
protected  boolean stop()
          Stops the LinkServer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinkServer

protected LinkServer(ProtocolID protocolID,
                     NodeAddressID linkServerAddressID)
Constructor. A LinkServer must have an associated protocolID.

Parameters:
protocolID - The ProtocolID for the protocol that the concrete implementation of LinkServer supports.
linkServerAddressID - the NodeAddressID for this LinkServer to listen on.
Method Detail

create

protected static LinkServer create(NodeAddressID addressID)
Create a server on a specifiedNodeAddressID, and start it. The server is spawned off in parallel, so this call returns immediately. This needs to be implemented by the concrete implementation of this class. This is not enforced by the compiler due to this being a static method. This NEEDS to be overridden.

Parameters:
addressID - The NodeAddressID to accept from
Returns:
the instance of LinkServer.

stop

protected boolean stop()
Stops the LinkServer. This NEEDS to be overridden.

Returns:
true iff the LinkServer has stopped.

getProtocolID

protected final ProtocolID getProtocolID()
Gets the protocol that this LinkServer supports.

Returns:
the ProtocolID representing this LinkServers protocol.

getLinkServerAddressID

protected final NodeAddressID getLinkServerAddressID()
Protected accessor for obtaining the NodeAddressID on which this server is listening.

Returns:
the NodeAddressID on which this server is listening.

CSP for Java
(JCSP) 1.1-rc4

Submit a bug or feature to jcsp-team@kent.ac.uk
Version 1.1-rc4 of the JCSP API Specification (Copyright 1997-2008 P.D.Austin and P.H.Welch - All Rights Reserved)
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.