Interface w3c.jigsaw.daemon.ServerClient
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface w3c.jigsaw.daemon.ServerClient

public interface ServerClient
extends Object
extends Runnable

Method Index

 o bind(Socket)
Bind this client to the given socket.
 o error(String)
Emit an error message on behalf of this client.
 o getIdentifier()
Get this client identifier.
 o getInetAddress()
Get the internet address of the peer this client is handling.
 o getInputStream()
Get this client's socket input stream.
 o getOutputStream()
Get this client's socket output stream.
 o getServerHandler()
Get the server this client is attached to.
 o getThread()
Get this client thread.
 o initialize(ServerHandler, ClientFactory, int)
Initialize this client, with the given parameters.
 o kill(boolean)
Kill this client.
 o log(String)
Emit a normal log entry on behalf of this client.
 o trace(String)
Emit debugging trace on behalf of this client.

Methods

 o initialize
  public abstract void initialize(ServerHandler hdlr,
                                  ClientFactory factory,
                                  int id)
Initialize this client, with the given parameters.
Parameters:
server - The server that created the client.
factory - The factory that created this client.
id - An integer identifing the client.
 o getServerHandler
  public abstract ServerHandler getServerHandler()
Get the server this client is attached to.
Returns:
A Server instance, describing the server that created this client.
 o getThread
  public abstract Thread getThread()
Get this client thread.
Returns:
The thread running this client, or null if no thread has been allocated for this client.
 o getIdentifier
  public abstract int getIdentifier()
Get this client identifier.
Returns:
The identifier that this client received at initialization time.
 o error
  public abstract void error(String msg)
Emit an error message on behalf of this client.
Parameters:
msg - The message to emit.
 o log
  public abstract void log(String msg)
Emit a normal log entry on behalf of this client.
Parameters:
msg - The entry to be logged.
 o trace
  public abstract void trace(String msg)
Emit debugging trace on behalf of this client.
Parameters:
msg - The trace to be emited.
 o kill
  public abstract void kill(boolean force)
Kill this client.
Parameters:
force - Make all efforts to kill the client right now if true, otherwise, shutdown the client gracefully.
 o bind
  public abstract void bind(Socket socket)
Bind this client to the given socket. The factory has been asked to run a client for a newly created connection. It wants to reuse this client instance to handle this new connection.
Parameters:
socket - The socket this client is to handle now.
 o getInetAddress
  public abstract InetAddress getInetAddress()
Get the internet address of the peer this client is handling. This should be used only on bound clients (see the bind method), and returns the IP address of the client's peer.
Returns:
An InetAddress instance, or null if the client is not currently bound to a socket.
 o getInputStream
  public abstract InputStream getInputStream()
Get this client's socket input stream. This should be used only on bound clients (see the bind method). If this method fails, the client is silently killed (unbound) and handed out to the factory as idle.
Returns:
An InputStream instance suitable for reading data from the client, or null if the client is not bound.
 o getOutputStream
  public abstract OutputStream getOutputStream()
Get this client's socket output stream. This should be used only on bound clients (see the bind method). If the method fails, the client is silently killed (unbound) and handed out to the factory as idle.
Returns:
An OutputStream instance, suitable to send data back to the client, or null if the client is not bound.

All Packages  Class Hierarchy  This Package  Previous  Next  Index