Package javassist.tools.rmi
Class AppletServer
- java.lang.Object
-
- javassist.tools.web.Webserver
-
- javassist.tools.rmi.AppletServer
-
public class AppletServer extends Webserver
An AppletServer object is a web server that an ObjectImporter communicates with. It makes the objects specified byexportObject()remotely accessible from applets. If the classes of the exported objects are requested by the client-side JVM, this web server sends proxy classes for the requested classes.- See Also:
ObjectImporter
-
-
Field Summary
-
Fields inherited from class javassist.tools.web.Webserver
debugDir, htmlfileBase
-
-
Constructor Summary
Constructors Constructor Description AppletServer(int port)Constructs a web server.AppletServer(int port, ClassPool src)Constructs a web server.AppletServer(String port)Constructs a web server.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddoReply(InputStream in, OutputStream out, String cmd)Processes a request from a web browser (an ObjectImporter).intexportObject(String name, Object obj)Exports an object.voidrun()Begins the HTTP service.-
Methods inherited from class javassist.tools.web.Webserver
addTranslator, end, logging, logging, logging, logging2, main, setClassPool
-
-
-
-
Constructor Detail
-
AppletServer
public AppletServer(String port) throws IOException, NotFoundException, CannotCompileException
Constructs a web server.- Parameters:
port- port number- Throws:
IOExceptionNotFoundExceptionCannotCompileException
-
AppletServer
public AppletServer(int port) throws IOException, NotFoundException, CannotCompileExceptionConstructs a web server.- Parameters:
port- port number- Throws:
IOExceptionNotFoundExceptionCannotCompileException
-
AppletServer
public AppletServer(int port, ClassPool src) throws IOException, NotFoundException, CannotCompileExceptionConstructs a web server.- Parameters:
port- port numbersrc- the source of classs files.- Throws:
IOExceptionNotFoundExceptionCannotCompileException
-
-
Method Detail
-
exportObject
public int exportObject(String name, Object obj) throws CannotCompileException
Exports an object. This method produces the bytecode of the proxy class used to access the exported object. A remote applet can load the proxy class and call a method on the exported object.- Parameters:
name- the name used for looking the object up.obj- the exported object.- Returns:
- the object identifier
- Throws:
CannotCompileException- See Also:
ObjectImporter.lookupObject(String)
-
doReply
public void doReply(InputStream in, OutputStream out, String cmd) throws IOException, BadHttpRequest
Processes a request from a web browser (an ObjectImporter).- Overrides:
doReplyin classWebserverout- the output stream to a clientcmd- the command received from a client- Throws:
IOExceptionBadHttpRequest
-
-