docs.roxen.comBack to normal mode
DocsRoxen2.1Programmer ManualJava
Copyright © 2001, Roxen Internet Software
Suggestions, comments & compliments
manuals@roxen.com

Module

: Class Module

com.roxen.roxen
Class Module


java.lang.Object
|
+--com.roxen.roxen.Module
Direct Known Subclasses:
AbstractLocationModule
public abstract class Module
extends java.lang.Object

The base class for Roxen modules. All modules must inherit this class, directly or indirectly.

Each module should also implement one or more of the specific module type interfaces.

See Also:
LocationModule, ParserModule, FileExtensionModule, LastResortModule, ProviderModule, ExperimentalModule, SecurityModule, UniqueModule

Field Summary
static int TYPE_DIR
          Constant for directory name type module variables
static int TYPE_DIR_LIST
          Constant for directory name list type module variables
static int TYPE_FILE
          Constant for file name type module variables
static int TYPE_FILE_LIST
          Constant for file name list type module variables
static int TYPE_FLAG
          Constant for boolean type module variables
static int TYPE_FLOAT
          Constant for floating point type module variables
static int TYPE_FONT
          Constant for font name type module variables
static int TYPE_INT
          Constant for integer type module variables
static int TYPE_INT_LIST
          Constant for integer list type module variables
static int TYPE_LOCATION
          Constant for URL path type module variables
static int TYPE_MODULE
          Constant for module type module variables
static int TYPE_MULTIPLE_INT
          The same as TYPE_INT_LIST
static int TYPE_MULTIPLE_STRING
          The same as TYPE_STRING_LIST
static int TYPE_PASSWORD
          Constant for string type module variables
static int TYPE_STRING
          Constant for string type module variables
static int TYPE_STRING_LIST
          Constant for string list type module variables
static int TYPE_TEXT
          The same as TYPE_TEXT_FIELD
static int TYPE_TEXT_FIELD
          Constant for free format text type module variables
static int TYPE_TOGGLE
          The same as TYPE_FLAG
static int VAR_DEVELOPER
          Constant for developer option variable flag.
static int VAR_EXPERT
          Constant for expert mode variable flag.
static int VAR_INITIAL
          Constant for initial configuration variable flag.
static int VAR_MORE
          Constant for advanced option variable flag.
 
Constructor Summary
Module()
           
 
Method Summary
protected  void defvar(java.lang.String var, java.lang.Object value, java.lang.String name, int type)
          Create an undocumented module varible.
protected  void defvar(java.lang.String var, java.lang.Object value, java.lang.String name, int type, java.lang.String doc)
          Create a module varible.
protected  RoxenResponse findInternal(java.lang.String f, RoxenRequest id)
          Request an internal resource from this module.
abstract  java.lang.String info()
          Returns the documentation for the module
 RoxenConfiguration myConfiguration()
          Returns the configuration object of the virtual server in which this module is enabled
 java.lang.Object query(java.lang.String name)
          Get the current value of a module variable
 int queryInt(java.lang.String name)
          Get the current value of a TYPE_INT or TYPE_FLAG module variable
protected  java.lang.String queryInternalLocation()
          Returns the URL path of the internal mount point that has been created for this module.
abstract  java.lang.String queryName()
          Returns the name of the module
 java.lang.String queryString(java.lang.String name)
          Get the current value of a module variable of one of the string types.
protected  void set(java.lang.String name, int value)
          Set the contents of a TYPE_INT or TYPE_FLAG module variable to a new value
protected  void set(java.lang.String name, java.lang.Object value)
          Set the contents of a module variable to a new value
protected  void start()
          Prepare the module for servicing requests
 java.lang.String status()
          Produce information about the current status of the module
protected  void stop()
          Inform the module that it is about to be taken out of service
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_STRING


public static final int TYPE_STRING
Constant for string type module variables

TYPE_FILE


public static final int TYPE_FILE
Constant for file name type module variables

TYPE_INT


public static final int TYPE_INT
Constant for integer type module variables

TYPE_DIR


public static final int TYPE_DIR
Constant for directory name type module variables

TYPE_STRING_LIST


public static final int TYPE_STRING_LIST
Constant for string list type module variables

TYPE_MULTIPLE_STRING


public static final int TYPE_MULTIPLE_STRING
The same as TYPE_STRING_LIST

TYPE_INT_LIST


public static final int TYPE_INT_LIST
Constant for integer list type module variables

TYPE_MULTIPLE_INT


public static final int TYPE_MULTIPLE_INT
The same as TYPE_INT_LIST

TYPE_FLAG


public static final int TYPE_FLAG
Constant for boolean type module variables

TYPE_TOGGLE


public static final int TYPE_TOGGLE
The same as TYPE_FLAG

TYPE_DIR_LIST


public static final int TYPE_DIR_LIST
Constant for directory name list type module variables

TYPE_FILE_LIST


public static final int TYPE_FILE_LIST
Constant for file name list type module variables

TYPE_LOCATION


public static final int TYPE_LOCATION
Constant for URL path type module variables

TYPE_TEXT_FIELD


public static final int TYPE_TEXT_FIELD
Constant for free format text type module variables

TYPE_TEXT


public static final int TYPE_TEXT
The same as TYPE_TEXT_FIELD

TYPE_PASSWORD


public static final int TYPE_PASSWORD
Constant for string type module variables

TYPE_FLOAT


public static final int TYPE_FLOAT
Constant for floating point type module variables

TYPE_MODULE


public static final int TYPE_MODULE
Constant for module type module variables

TYPE_FONT


public static final int TYPE_FONT
Constant for font name type module variables

VAR_EXPERT


public static final int VAR_EXPERT
Constant for expert mode variable flag. Set this flag to make the variable show only in expert mode.

VAR_MORE


public static final int VAR_MORE
Constant for advanced option variable flag. Set this flag to make the variable show only when advanced options are enabled.

VAR_DEVELOPER


public static final int VAR_DEVELOPER
Constant for developer option variable flag. Set this flag to make the variable show only when developer options are enabled.

VAR_INITIAL


public static final int VAR_INITIAL
Constant for initial configuration variable flag. Set this flag for variables that need to be configured when the module is created.
Constructor Detail

Module


public Module()
Method Detail

queryName


public abstract java.lang.String queryName()
Returns the name of the module
Returns:
the module's name

info


public abstract java.lang.String info()
Returns the documentation for the module
Returns:
an HTML string containing brief online documentation

myConfiguration


public RoxenConfiguration myConfiguration()
Returns the configuration object of the virtual server in which this module is enabled
Returns:
the configuration

queryInternalLocation


protected java.lang.String queryInternalLocation()
Returns the URL path of the internal mount point that has been created for this module.
Returns:
the URL path

findInternal


protected RoxenResponse findInternal(java.lang.String f,
RoxenRequest id)
Request an internal resource from this module.
Parameters:
f - the path of the resource relative to the location of this module
id - the request object
Returns:
a response, or null if no such file exists.

status


public java.lang.String status()
Produce information about the current status of the module
Returns:
a status message, or null if no information is available

start


protected void start()
Prepare the module for servicing requests

stop


protected void stop()
Inform the module that it is about to be taken out of service

defvar


protected void defvar(java.lang.String var,
java.lang.Object value,
java.lang.String name,
int type,
java.lang.String doc)
Create a module varible. This method must be called from the modules constructor.
Parameters:
var - a name by which this variables is identified internally
value - the default value for this variable
name - a human-readable name for this variable
type - a TYPE_-constant selecting the type of this variable, optionally ORed with any VAR_ flags
doc - an HTML string containing brief documentation for the variable

defvar


protected void defvar(java.lang.String var,
java.lang.Object value,
java.lang.String name,
int type)
Create an undocumented module varible. This method must be called from the modules constructor.
Parameters:
var - a name by which this variables is identified internally
value - the default value for this variable
name - a human-readable name for this variable
type - a TYPE_-constant selecting the type of this variable, optionally ORed with any VAR_ flags

query


public java.lang.Object query(java.lang.String name)
Get the current value of a module variable
Parameters:
name - the internal name of the variable
Returns:
the value of the variable

queryInt


public int queryInt(java.lang.String name)
Get the current value of a TYPE_INT or TYPE_FLAG module variable
Parameters:
name - the internal name of the variable
Returns:
the value of the variable

queryString


public java.lang.String queryString(java.lang.String name)
Get the current value of a module variable of one of the string types.
Parameters:
name - the internal name of the variable
Returns:
the value of the variable

set


protected void set(java.lang.String name,
java.lang.Object value)
Set the contents of a module variable to a new value
Parameters:
name - the internal name of the variable
value - the new value

set


protected void set(java.lang.String name,
int value)
Set the contents of a TYPE_INT or TYPE_FLAG module variable to a new value
Parameters:
name - the internal name of the variable
value - the new value