webcore.webserver.application
Class WWWServerConsole

java.lang.Object
  |
  +--webcore.webserver.application.WWWServerConsole
All Implemented Interfaces:
java.util.EventListener, WebServerListener

public class WWWServerConsole
extends java.lang.Object
implements WebServerListener

Application to start a webserver. Joni: lisätty mahdollisuus antaa porttinumerot parametrina main-metodille


Constructor Summary
WWWServerConsole(java.lang.String documentBase)
           
WWWServerConsole(java.lang.String sslDocumentBase, java.lang.String ksPath, java.lang.String pass)
           
WWWServerConsole(java.lang.String documentBase, java.lang.String sslDocumentBase, java.lang.String ksPath, java.lang.String pass)
           
WWWServerConsole(java.lang.String documentBase, java.lang.String sslDocumentBase, java.lang.String ksPath, java.lang.String pass, int port, int sslPort)
          Toinen konstruktori jolle voi antaa porttinumerot parametrina
 
Method Summary
static void main(java.lang.String[] args)
          Starts the web server.
 void minorErrorOccured(WebServerEvent e)
          Called when a minor IO error occurs which is acceptable by the HTTP protocol.
 void requested(WebServerEvent e)
          Called when an HTTP request comes in.
static void start(java.lang.String[] args, int port, int SSLport)
          Apumetodi joka kutsuu main-metodia
 void startedListening(WebServerEvent e)
          Called when the webserver has started listening in response to the start method.
 void stoppedListening(WebServerEvent e)
          Called when the webserver has stopped listening in response to the terminate method of an unrecoverable Exception.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WWWServerConsole

public WWWServerConsole(java.lang.String documentBase,
                        java.lang.String sslDocumentBase,
                        java.lang.String ksPath,
                        java.lang.String pass)

WWWServerConsole

public WWWServerConsole(java.lang.String documentBase,
                        java.lang.String sslDocumentBase,
                        java.lang.String ksPath,
                        java.lang.String pass,
                        int port,
                        int sslPort)
Toinen konstruktori jolle voi antaa porttinumerot parametrina


WWWServerConsole

public WWWServerConsole(java.lang.String documentBase)

WWWServerConsole

public WWWServerConsole(java.lang.String sslDocumentBase,
                        java.lang.String ksPath,
                        java.lang.String pass)
Method Detail

main

public static void main(java.lang.String[] args)
Starts the web server.
     Usage: documentBase, REDIRECT | ssldocumentBase keystorePath keystorePass
 			| documentBase ssldocumentBase keystorePath keystorePass
 
documentBase is the path to the document base.
ssldocumentBase is the document base for ssl server
if 3 arguments are provided, the ssl server starts
if 4 arguments are provided, both the non-ssl and ssl servers are started. (If documentBase is the text "REDIRECT" then the non-ssl server will redirect browsers to the https server.)

Note:java keystores allow separate keystore key passwords, this application expects the keystore password and all key passwords to be the same.


start

public static void start(java.lang.String[] args,
                         int port,
                         int SSLport)
Apumetodi joka kutsuu main-metodia


startedListening

public void startedListening(WebServerEvent e)
Description copied from interface: WebServerListener
Called when the webserver has started listening in response to the start method.

Specified by:
startedListening in interface WebServerListener

stoppedListening

public void stoppedListening(WebServerEvent e)
Description copied from interface: WebServerListener
Called when the webserver has stopped listening in response to the terminate method of an unrecoverable Exception.

Specified by:
stoppedListening in interface WebServerListener

minorErrorOccured

public void minorErrorOccured(WebServerEvent e)
Description copied from interface: WebServerListener
Called when a minor IO error occurs which is acceptable by the HTTP protocol. (Especially that clients can close connections without notifying the server.)

Specified by:
minorErrorOccured in interface WebServerListener

requested

public void requested(WebServerEvent e)
Description copied from interface: WebServerListener
Called when an HTTP request comes in. The listener may just log the request, or process it completely. If the request is processed by the listener, the Processed property of the HTTPRequest should be set to true.

Specified by:
requested in interface WebServerListener