| java.lang.Object javassist.tools.web.Webserver
All known Subclasses: javassist.tools.rmi.AppletServer, sample.evolve.DemoServer,
Webserver | public class Webserver (Code) | | A web server for running sample programs.
This enables a Java program to instrument class files loaded by
web browsers for applets. Since the (standard) security manager
does not allow an applet to create and use a class loader,
instrumenting class files must be done by this web server.
Note: although this class is included in the Javassist API,
it is provided as a sample implementation of the web server using
Javassist. Especially, there might be security flaws in this server.
Please use this with YOUR OWN RISK.
|
Field Summary | |
public String | debugDir If this field is not null, the class files taken from
ClassPool are written out under the directory
specified by this field. | public String | htmlfileBase The top directory of html (and .gif, .class, ...) files. | protected Translator | translator |
Constructor Summary | |
public | Webserver(String port) Constructs a web server. | public | Webserver(int port) Constructs a web server. |
debugDir | public String debugDir(Code) | | If this field is not null, the class files taken from
ClassPool are written out under the directory
specified by this field. The directory name must not end
with a directory separator.
|
htmlfileBase | public String htmlfileBase(Code) | | The top directory of html (and .gif, .class, ...) files.
It must end with the directory separator such as "/".
(For portability, "/" should be used as the directory separator.
Javassist automatically translates "/" into a platform-dependent
character.)
If this field is null, the top directory is the current one where
the JVM is running.
If the given URL indicates a class file and the class file
is not found under the directory specified by this variable,
then Class.getResourceAsStream() is called
for searching the Java class paths.
|
Webserver | public Webserver(String port) throws IOException(Code) | | Constructs a web server.
Parameters: port - port number |
Webserver | public Webserver(int port) throws IOException(Code) | | Constructs a web server.
Parameters: port - port number |
logging | public void logging(String msg)(Code) | | Prints a log message.
|
logging2 | public void logging2(String msg)(Code) | | Prints a log message with indentation.
|
main | public static void main(String[] args) throws IOException(Code) | | Starts a web server.
The port number is specified by the first argument.
|
run | public void run()(Code) | | Begins the HTTP service.
|
setClassPool | public void setClassPool(ClassPool loader)(Code) | | Requests the web server to use the specified
ClassPool object for obtaining a class file.
|
|
|