Servertec iws
Documentation
Conventions
Command Line
Java API
AccessLogEntry
DString
ErrorLogEntry
EventLogEntry
iws
Logger
ServletManager
Utils

Servlet API
Servlets
Config Files
Classes
Directory Tree

Return

 

java.lang.Object
 |
 +--stec.iws.iws

public final class iws

Contains main entry point and global methods.

Fields

Field Description
aliases Used to access, add, remove and change aliases.
hosts Used to access, add, remove and change virtual hosts.
messages Used to access, add, remove and change messages.
mimetypes Used to access, add, remove and change mimetypes.
resources Used to access, add, remove and change resources.
servlets Used to access, add, remove and change servlets.

Methods

Method Description
getBaseDirectory Returns the base directory or archive that Servertec Internet Server uses to run from.
getMimeType Returns the MIME type of the specified file.
getServerVersion Returns the current version of Servertec Internet Server.
getStartTime Returns the time in milliseconds since January 1, 1970 UTC when the server was started.
log Used to log exceptions or errors messages.
main Main entry point.
shutdown Used by administration thread to shutdown Servertec Internet Server.

aliases

Used to access, add, remove and change aliases.

Syntax

public static Hashtable aliases

Notes

Aliases are automatically loaded when the server is started.

Example

iws.aliases.put("/scripts", "/cgi-bin")

hosts

Used to access, add, remove and change virtual hosts.

Syntax

public static Hashtable hosts

Notes

Hosts are automatically loaded when the server is started.

Example

iws.hosts.put("iob", "./servers/iob")

messages

Used to access, add, remove and change messages.

Syntax

public static Hashtable messages

Notes

Messages are automatically loaded when the server is started.

Example

iws.messages.put("200", "200 OK")

mimetypes

Used to access, add, remove and change mimetypes.

Syntax

public static Hashtable mimetypes

Notes

Mimetypes are automatically loaded when the server is started.

Example

iws.mimetypes.put(".htm", "text/html")

resources

Used to access, add, remove and change resources.

Syntax

public static Hashtable resources

Notes

Resources are automatically loaded when the server is started.

Example

iws.resources.put("/protected", "default")

servlets

Used to access, add, remove and change servlets.

Syntax

public static Hashtable servlets

Notes

Servlets are automatically loaded when the server is started.

Example

iws.servlets.put("FileServlet", "stec.iws.FileServlet")

destroy

Stops the Servertec Internet Server runtime environment.

Syntax

public final static void destroy()

Parameters

None

Returns

Nothing

Throws

Nothing

Example

iws.destroy();

getBaseDirectory

Returns the base directory or archive that Servertec Internet Server uses to run from.

Syntax

public final static String getBaseDirectory()

Parameters

None

Returns

String the base directory or archive file.

Throws

Nothing

Notes

A files MIME, Multipurpose Internet Mail Extension, type is a Web protocol for defining a files type.

Example

String base_dir = iws.getBaseDirectory();

getMimeType

Returns the MIME type of the specified file.

Syntax

public final static String getMimeType(String filename)

Parameters

filename the filename to use.

Returns

String the associated mime type.

Throws

Nothing

Notes

A files MIME, Multipurpose Internet Mail Extension, type is a Web protocol for defining a files type.

Example

String mimetype = iws.getMimeType(filename);

getServerVersion

Returns the current version of Servertec Internet Server.

Syntax

public final static String getServerVersion()

Parameters

None

Returns

String the current version of Servertec Internet Server.

Throws

Nothing

Example

String version = iws.getServerVersion();

getStartTime

Returns the time in milliseconds since January 1, 1970 UTC when the server was started.

Syntax

public final static long getStartTime()

Parameters

None

Returns

long the time in milliseconds since January 1, 1970 UTC when the server was started.

Throws

Nothing

Example

long start_time = iws.getStartTime();

log

Used to log exceptions or errors messages.

Syntax

public final static void log(Throwable exception)
public final static void log(String message)
public final static void log(Throwable exception, String message)

Parameters

exception an Error or Exception object.
message event message to log.

Returns

Nothing

Throws

Nothing

Example

iws.destroy();

main

Main entry point.

Syntax

public final static void main(String args) throws Exception

Parameters

args command line arguments.

Returns

Nothing

Notes

Called by Java VM when server is started. Initialized and starts the server.

Throws

Exception Thrown if any error occurs while the server is being initialized or started.

Example

iws.main(args);

shutdown

Used by administration thread to shutdown Servertec Internet Server.

Syntax

public final static void shutdown(int returnCode)

Parameters

returnCode the return code to return to the iws wrapper.

0 to stop the server or 0x7fff to restart the server.

Returns

Nothing

Throws

Nothing

Example

iws.shutdown(0);
 top of page
Copyright © 1998-2005 Servertec. All rights reserved.
Privacy Statement.
Last Modified: Mon Sep 05 14:25:45 EDT 2005