Top Description Fields Constructors Methods
javassist.tools.rmi

public Class AppletServer

Additional top-level class in compilation unit: ExportedObject.

extends Webserver
Class Inheritance
Imports
java.io.DataInputStream, .IOException, .InputStream, .InvalidClassException, .NotSerializableException, .ObjectInputStream, .ObjectOutputStream, .OutputStream, java.lang.reflect.Method, java.util.Hashtable, .List, .Map, .Vector, javassist.CannotCompileException, .ClassPool, .NotFoundException, javassist.tools.web.BadHttpRequest, .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
javassist.tools.rmi.ObjectImporter

Field Summary

Modifier and TypeField and Description
private Map<String, ExportedObject>
private List<ExportedObject>
private static final byte[]
private StubGenerator
Inherited from javassist.tools.web.Webserver:
debugDirhtmlfileBasetranslator

Constructor Summary

AccessConstructor and Description
public
AppletServer(String
port number
port
)

Constructs a web server.

public
AppletServer(int
port number
port
)

Constructs a web server.

public
AppletServer(int
port number
port
,
ClassPool
the source of classs files.
src
)

Constructs a web server.

private
AppletServer(ClassPool loader, StubGenerator gen, int port)

Method Summary

Modifier and TypeMethod and Description
private Object
public void
doReply(InputStream in, OutputStream
the output stream to a client
out
,
String
the command received from a client
cmd
)

Overrides javassist.tools.web.Webserver.doReply.

Processes a request from a web browser (an ObjectImporter).

public synchronized int

Returns:

the object identifier
exportObject
(String
the name used for looking the object up.
name
,
Object
the exported object.
obj
)

Exports an object.

private void
private void
private Object[]
public void
run()

Overrides javassist.tools.web.Webserver.run.

Begins the HTTP service.

Inherited from javassist.tools.web.Webserver:
addTranslatorendlogginglogginglogginglogging2mainsetClassPool

Field Detail

exportedNamesback to summary
private Map<String, ExportedObject> exportedNames
exportedObjectsback to summary
private List<ExportedObject> exportedObjects
okHeaderback to summary
private static final byte[] okHeader
stubGenback to summary
private StubGenerator stubGen

Constructor Detail

AppletServerback to summary
public AppletServer(String port) throws IOException, NotFoundException, CannotCompileException

Constructs a web server.

Parameters
port:String

port number

AppletServerback to summary
public AppletServer(int port) throws IOException, NotFoundException, CannotCompileException

Constructs a web server.

Parameters
port:int

port number

AppletServerback to summary
public AppletServer(int port, ClassPool src) throws IOException, NotFoundException, CannotCompileException

Constructs a web server.

Parameters
port:int

port number

src:ClassPool

the source of classs files.

AppletServerback to summary
private AppletServer(ClassPool loader, StubGenerator gen, int port) throws IOException, NotFoundException, CannotCompileException

Method Detail

convertRvalueback to summary
private Object convertRvalue(Object rvalue) throws CannotCompileException
doReplyback to summary
public void doReply(InputStream in, OutputStream out, String cmd) throws IOException, BadHttpRequest

Overrides javassist.tools.web.Webserver.doReply.

Processes a request from a web browser (an ObjectImporter).

Parameters
out:OutputStream

Doc from javassist.tools.web.Webserver.doReply.

the output stream to a client

cmd:String

Doc from javassist.tools.web.Webserver.doReply.

the command received from a client

Annotations
@Override
exportObjectback to summary
public synchronized 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:String

the name used for looking the object up.

obj:Object

the exported object.

Returns:int

the object identifier

See Also
javassist.tools.rmi.ObjectImporter#lookupObject(String)
lookupNameback to summary
private void lookupName(String cmd, InputStream ins, OutputStream outs) throws IOException
processRMIback to summary
private void processRMI(InputStream ins, OutputStream outs) throws IOException
readParametersback to summary
private Object[] readParameters(ObjectInputStream in) throws IOException, ClassNotFoundException
runback to summary
public void run()

Overrides javassist.tools.web.Webserver.run.

Begins the HTTP service.

Annotations
@Override