org.jboss.web
Class WebServer

java.lang.Object
  |
  +--org.jboss.web.WebServer
All Implemented Interfaces:
java.lang.Runnable

public class WebServer
extends java.lang.Object
implements java.lang.Runnable

A mini webserver that should be embedded in another application. It can server any file that is available from classloaders that are registered with it, including class-files. Its primary purpose is to simplify dynamic class-loading in RMI. Create an instance of it, register a classloader with your classes, start it, and you'll be able to let RMI-clients dynamically download classes from it. It is configured by editing either the dynaserver.default file in dynaserver.jar (not recommended), or by adding a file dynaserver.properties in the same location as the dynaserver.jar file (recommended). It can also be configured by calling any methods programmatically prior to startup.

Version:
$Revision: 1.4 $
Author:
$Author: osh $

Constructor Summary
WebServer()
           
 
Method Summary
 void addClassLoader(java.lang.ClassLoader cl)
           
 void addMimeType(java.lang.String extension, java.lang.String type)
           
protected  void debug(java.lang.String msg)
           
protected  byte[] getBytes(java.net.URL url)
           
protected  java.lang.String getMimeType(java.lang.String path)
           
protected  java.lang.String getPath(java.io.BufferedReader in)
          Returns the path to the class file obtained from parsing the HTML header.
 int getPort()
           
 boolean isDebug()
           
protected  void listen()
           
 void removeClassLoader(java.lang.ClassLoader cl)
           
 void run()
           
 void setDebug(boolean d)
           
 void setPort(int p)
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebServer

public WebServer()
Method Detail

setPort

public void setPort(int p)

getPort

public int getPort()

setDebug

public void setDebug(boolean d)

isDebug

public boolean isDebug()

addMimeType

public void addMimeType(java.lang.String extension,
                        java.lang.String type)

start

public void start()
           throws java.io.IOException

stop

public void stop()

addClassLoader

public void addClassLoader(java.lang.ClassLoader cl)

removeClassLoader

public void removeClassLoader(java.lang.ClassLoader cl)

run

public void run()
Specified by:
run in interface java.lang.Runnable

debug

protected void debug(java.lang.String msg)

listen

protected void listen()

getPath

protected java.lang.String getPath(java.io.BufferedReader in)
                            throws java.io.IOException
Returns the path to the class file obtained from parsing the HTML header.

getBytes

protected byte[] getBytes(java.net.URL url)
                   throws java.lang.Exception

getMimeType

protected java.lang.String getMimeType(java.lang.String path)


Copyright © 2000 The JBoss Organization. All Rights Reserved.