com.caucho.server.http
Class ResinServer

java.lang.Object
  |
  +--com.caucho.server.http.ResinServer
All Implemented Interfaces:
com.caucho.server.ShutdownListener
Direct Known Subclasses:
JniServer

public class ResinServer
extends java.lang.Object
implements com.caucho.server.ShutdownListener

The main class for the HTTP server.

TcpServer handles the main thread control. HttpServer just needs to create the right kind of request when a new thread is spawned.

If the -deadwait flag is received, the main thread will wait on System.in. When System.in closes, HttpServer will gracefully shutdown the server. This will automatically close the server when a parent watchdog process closes.

To use the -deadwait feature, the watchdog will need to create a pipe and dup() the Java process's stdin.

See Also:
com.caucho.server.TcpServer

Field Summary
protected  com.caucho.server.http.ServletServer servletServer
           
 
Constructor Summary
ResinServer(java.lang.String[] argv, boolean isHttp)
          Create a new Resin server.
 
Method Summary
 void close()
          Close the server, the TCP sockets and the threads.
protected  void closeImpl()
          Stub so JniServer can close down gracefully.
 void handleShutdown()
          Called when the server shuts down.
 void init(boolean allowHttp)
          Initialize the server, binding to TCP and starting the threads.
 boolean isClosed()
          Returns true if the server has shut down.
static void main(java.lang.String[] argv, boolean isHttp)
          The main start of the web server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

servletServer

protected com.caucho.server.http.ServletServer servletServer
Constructor Detail

ResinServer

public ResinServer(java.lang.String[] argv,
                   boolean isHttp)
            throws java.lang.Exception
Create a new Resin server.
Parameters:
argv - the command-line to initialize Resin with
isHttp - default to http
Method Detail

isClosed

public boolean isClosed()
Returns true if the server has shut down.

init

public void init(boolean allowHttp)
          throws java.lang.Exception
Initialize the server, binding to TCP and starting the threads.

close

public void close()
           throws java.lang.Exception
Close the server, the TCP sockets and the threads.

closeImpl

protected void closeImpl()
Stub so JniServer can close down gracefully.

handleShutdown

public void handleShutdown()
Called when the server shuts down.
Specified by:
handleShutdown in interface com.caucho.server.ShutdownListener

main

public static void main(java.lang.String[] argv,
                        boolean isHttp)
                 throws java.lang.Exception
The main start of the web server.
 -conf resin.conf   : alternate configuration file
 -port port         : set the server's portt
 -deadwait          : graceful shutdown when stdin closes.