Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Project Rio
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jini.rio.tools.webster
Class Webster

    java.lang.Object
      org.jini.rio.tools.webster.Webster

All Implemented Interfaces:
  Runnable

    public class Webster

extends Object
implements Runnable

Webster is a HTTP server which can serve code from multiple codebases. Environment variables used to control Webster are as follows:

org.jini.rio.tools.webster.port | Sets the port for webster to use | 0
| org.jini.rio.tools.webster.root | Root directory to serve code from. Webster supports multiple root directories which are separated by a `;` | System.getProperty(user.home)

Constructor Summary
`Webster()` Create a new Webster.
`Webster(int port)` Create a new Webster
`Webster(int port, String roots)` Create a new Webster
`Webster(int port, String roots, String bindAddress)` Create a new Webster
`Webster(int port, String roots, String bindAddress, int minThreads, int maxThreads)` Create a new Webster
`Webster(String roots)` Create a new Webster
`Webster(String[] options, LifeCycle lifeCycle)` Create a new Webster, compatible with the ServiceStarter mechanism in Jini 2.0

Method Summary
`protected String[]` | `expandRoots()`
`String` | `getAddress()` Get address that Webster is bound to
`int` | `getPort()` Get the port Webster is bound to
`String` | `getRoots()` Get the roots Webster is serving
`static void` | `main(String[] args)`
`protected File` | `parseFileName(String filename)`
`void` | `run()`
`void` | `terminate()` Terminate a running Webster instance

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

Constructor Detail

### Webster

    public Webster()
            throws BindException

  Create a new Webster. The port is determined by the org.jini.rio.tools.webster.port system property. If the org.jini.rio.tools.webster.port system property does not exist, an anonynous port will be allocated.

  Throws:
    `BindException` - if Webster cannot create a socket

### Webster

    public Webster(int port)
            throws BindException

  Create a new Webster

  Parameters:
    `port` - The port to use
  Throws:
    `BindException` - if Webster cannot create a socket

### Webster

    public Webster(String roots)
            throws BindException

  Create a new Webster

  Parameters:
    `roots` - The root(s) to serve code from. This is a semi-colin delimited list of directories
  Throws:
    `BindException` - if Webster cannot create a socket

### Webster

    public Webster(int port,
                   String roots)
            throws BindException

  Create a new Webster

  Parameters:
    `port` - The port to use
    `roots` - The root(s) to serve code from. This is a semi-colin delimited list of directories
  Throws:
    `BindException` - if Webster cannot create a socket

### Webster

    public Webster(int port,
                   String roots,
                   String bindAddress)
            throws BindException

  Create a new Webster

  Parameters:
    `port` - The port to use
    `roots` - The root(s) to serve code from. This is a semi-colin delimited list of directories
    `bindAddress` - TCP/IP address which Webster should bind to (null implies no specific address)
  Throws:
    `BindException` - if Webster cannot create a socket

### Webster

    public Webster(int port,
                   String roots,
                   String bindAddress,
                   int minThreads,
                   int maxThreads)
            throws BindException

  Create a new Webster

  Parameters:
    `port` - The port to use
    `roots` - The root(s) to serve code from. This is a semi-colin delimited list of directories
    `bindAddress` - TCP/IP address which Webster should bind to (null implies no specific address)
    `minThreads` - Minimum threads to use in the ThreadPool
    `maxThreads` - Minimum threads to use in the ThreadPool
  Throws:
    `BindException` - if Webster cannot create a socket

### Webster

    public Webster(String[] options,
                   LifeCycle lifeCycle)
            throws BindException

  Create a new Webster, compatible with the ServiceStarter mechanism in Jini 2.0

  Parameters:
    `options` - String[] of options. Valid options are [-port port], [-roots list-of-roots], [-bindAddress address], [-minThreads minThreads], [-maxThreads maxThreads] [-soTimeout soTimeout]
    `lifeCycle` - The LifeCycle object, may be null
  Throws:
    `BindException` - if Webster cannot create a socket

Method Detail

### getRoots

    public String getRoots()

  Get the roots Webster is serving

  Returns:
    The roots Webster is serving as a semicolon delimited String

### getAddress

    public String getAddress()

  Get address that Webster is bound to

  Returns:
    The host address the server socket Webster is using is bound to. If the socket is null, return null.

### terminate

    public void terminate()

  Terminate a running Webster instance

### getPort

    public int getPort()

  Get the port Webster is bound to

  Returns:
    Te port Webster is bound to

### run

    public void run()

  Specified by:
    `run` in interface `Runnable`

### parseFileName

    protected File parseFileName(String filename)

### expandRoots

    protected String[] expandRoots()

### main

    public static void main(String[] args)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Project Rio
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © Project Rio.