Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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:
  `TcpServer`

Field Summary
`protected 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 allowHttp)` The main start of the web server.
`void` | `waitForExit()` Thread to wait until Resin should be stopped.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### servletServer

    protected 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.

### waitForExit

    public void waitForExit()

  Thread to wait until Resin should be stopped.

### 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 allowHttp)
                     throws java.lang.Exception

  The main start of the web server.

       -conf resin.conf   : alternate configuration file
       -port port         : set the server's portt

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD