Servertec | iws

Content Introduction Release Notes Features FAQs Requirements Installation Add-ons How To Change Log Future Plans Knowledge Base Documentation Conventions Users Reference iServer API AccessLogEntry Codecs Connection ConnectionPool... DString ErrorLogEntry EventLogEntry FileCache FileUpload IOHandler IOManager iws Logger MultiPartForm QuickSort Realm RealmAdmin... ServletManager Utils Servlet API CGI SSI Servlets Config Files Log Files Classes Directory Tree Samples Sales Legal Feedback |
    java.lang.Object
     |
     +--stec.iws.iws
public class iws Methods used to initialize, run and stop iServer. #### 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.
realms | Used to access, add, remove and change realms.
resources | Used to access, add, remove and change resources.
servlets | Used to access, add, remove and change servlets.
servletManager | Used to access the iServer Servlet Manager.
#### Methods
Method | Description
destroy | Stops the iServer runtime environment.
getBaseDirectory | Returns the base directory or archive that iServer uses to run from.
getMimeType | Returns the MIME type of the specified file.
getServerVersion | Returns the current version of iServer.
init | Initializes the iServer runtime environment.
log | Used to log exceptions or errors messages.
run | Starts and run iServer.
shutdown | Used by administration thread to shutdown iServer.
#### Example
    import stec.iws.iws;

    public class testServer
    {
        void static main(String[] args)
        {
            try
            {
                iws.init(args);

                iws.servlets.put("File", "stec.iws.FileServlet");
                iws.servletManager.loadServlet("File");

                iws.run();
            }
            catch(Exception ex)
            {
                log(ex);
            }
            finally
            {
                iws.destroy();
            }
        }
    }
### aliases Used to access, add, remove and change aliases. #### Syntax public static Hashtable aliases #### Notes Aliases are automatically loaded when iws.init() is called. #### 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 iws.init() is called. #### 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 iws.init() is called. #### 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 iws.init() is called. #### Example iws.mimetypes.put(".htm", "text/html") ### realms Used to access, add, remove and change realms. #### Syntax public static Hashtable realms #### Notes Realms are automatically loaded when iws.init() is called. #### Example iws.realms.put("default", "stec.iws.FileRealm") ### resources Used to access, add, remove and change resources. #### Syntax public static Hashtable resources #### Notes Resources are automatically loaded when iws.init() is called. #### 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 iws.init() is called. #### Example iws.servlets.put("FileServlet", "stec.iws.FileServlet") ### servletManager Used to access the iServer Servlet Manager. #### Syntax public static Hashtable servlets #### Notes Servlets are automatically loaded when iws.init() is called. #### Example iws.servlets.put("FileServlet", "stec.iws.FileServlet") ### destroy Stops the iServer runtime environment. #### Syntax public static void destroy() #### Parameters
None
#### Returns
Nothing
#### Throws
Nothing
#### Example iws.destroy(); ### getBaseDirectory Returns the base directory or archive that iServer uses to run from. #### Syntax public 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 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 iServer. #### Syntax public static String getServerVersion() #### Parameters
None
#### Returns
String | the current version of iServer.
#### Throws
Nothing
#### Example String version = iws.getServerVersion(); ### init Initializes the iServer runtime environment. #### Syntax public static void init(String[] args) public static void init(String arg) public static void init() #### Parameters
args | an array of strings containing arguments to iServer.
#### Returns
Nothing
#### Throws
Nothing
#### Notes Presently the only parameter is an optional base directory that iServer uses to find its configuration files. #### Example iws.init(args); ### log Used to log exceptions or errors messages. #### Syntax public static void log(Throwable exception) public static void log(String message) public 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(); ### run Starts and run iServer. #### Syntax public static void run() #### Parameters
None
#### Returns
Nothing
#### Throws
Nothing
#### Example iws.run(); ### shutdown Used by administration thread to shutdown iServer. #### Syntax public static void shutdown(int returnCode) #### Parameters
returnCode | the return code to return to the iws wrapper. 0 to stop iServer or 0x7fff to restart iServer.
#### Returns
Nothing
#### Throws
Nothing
#### Example iws.shutdown(0);
top of page
| Copyright © 1997-2000 Servertec. All rights reserved. Last Modified: Sun Jan 09 19:34:12 EST 2000