org.w3c.jigsaw.daemon
Interface ServerHandler

All Known Subinterfaces:
ServerInterface
All Known Implementing Classes:
AdminServer, httpd, httpsd, webdavd, webdavsd

public interface ServerHandler

A ServerHandler is a class that handles an accepting socket.


Method Summary
 ServerHandler clone(ServerHandlerManager shm, java.lang.String identifier, ObservableProperties props)
          Clone this server handler, and custmozie it with the given properties.
 void errlog(java.lang.String msg)
          Log an error into this server's error log.
 ResourceReference getConfigResource()
          Get the root, configuration resource for that server.
 java.lang.String getIdentifier()
          Get this server identifier.
 java.net.InetAddress getInetAddress()
          Get the network addresses on which this server is listening.
 void initialize(ServerHandlerManager shm, java.lang.String id, ObservableProperties props)
          Initialize the server from the given set of properties.
 void log(java.lang.String msg)
          Log a normal message into this server's log.
 void shutdown()
          Shutdown this server handler.
 void start()
          Start the server, after everything has been initialized.
 void trace(java.lang.String msg)
          Emit a debugging trace on behalf of this server.
 

Method Detail

getIdentifier

java.lang.String getIdentifier()
Get this server identifier.

Returns:
A String identifying this server context.

errlog

void errlog(java.lang.String msg)
Log an error into this server's error log.

Parameters:
msg - The message to log.

log

void log(java.lang.String msg)
Log a normal message into this server's log.

Parameters:
msg - The message to log.

trace

void trace(java.lang.String msg)
Emit a debugging trace on behalf of this server.

Parameters:
msg - The trace to emit.

getInetAddress

java.net.InetAddress getInetAddress()
Get the network addresses on which this server is listening.

Returns:
The InetAddress this server is listening to.

getConfigResource

ResourceReference getConfigResource()
Get the root, configuration resource for that server.

Returns:
A ContainerResource instance.

clone

ServerHandler clone(ServerHandlerManager shm,
                    java.lang.String identifier,
                    ObservableProperties props)
                    throws ServerHandlerInitException
Clone this server handler, and custmozie it with the given properties.

Once cloned, the new server is assumed to be running happily, as if it had been initialized.

Parameters:
shm - The global server handler manager.
identifier - The new ServerHandler identifier.
props - The properties that overide part of the configuration of the cloned server.
Returns:
A newly created server, sharing the configuration of the cloned server, except for the config options defined by the given property set.
Throws:
ServerHandlerInitException - if initialization failed.

initialize

void initialize(ServerHandlerManager shm,
                java.lang.String id,
                ObservableProperties props)
                throws ServerHandlerInitException
Initialize the server from the given set of properties. This method is called by the ServerManager instance, when launching the appropriate servers.

A Server instance that has initialize itself successfully is considered to be running.

Parameters:
shm - The global server handler manager.
identifier - A String identifying the server.
props - The property set this server should use to initialize itself.
Throws:
ServerHandlerInitException - if initialization failed.

start

void start()
           throws ServerHandlerInitException
Start the server, after everything has been initialized. itself.

Throws:
ServerHandlerInitException - if initialization failed.

shutdown

void shutdown()
Shutdown this server handler. This is a synchronous method, that will return only once the server has been shutdown entirely (all the resources it uses have been released).

This server handler clones are considered shutdown too.