javassist.tools.rmi

Class AppletServer

public class AppletServer extends Webserver

An AppletServer object is a web server that an ObjectImporter communicates with. It makes the objects specified by exportObject() 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

Constructor Summary
AppletServer(String port)
Constructs a web server.
AppletServer(int port)
Constructs a web server.
AppletServer(int port, ClassPool src)
Constructs a web server.
Method Summary
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.

Constructor Detail

AppletServer

public AppletServer(String port)
Constructs a web server.

Parameters: port port number

AppletServer

public AppletServer(int port)
Constructs a web server.

Parameters: port port number

AppletServer

public AppletServer(int port, ClassPool src)
Constructs a web server.

Parameters: port port number src the source of classs files.

Method Detail

doReply

public void doReply(InputStream in, OutputStream out, String cmd)
Processes a request from a web browser (an ObjectImporter).

exportObject

public int exportObject(String name, Object obj)
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

See Also: lookupObject

run

public void run()
Begins the HTTP service.
Javassist, a Java-bytecode translator toolkit.
Copyright (C) 1999-2006 Shigeru Chiba. All Rights Reserved.