public class ClassFileServer extends ClassServer
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
classpath
path to the default package.
|
Constructor and Description |
---|
ClassFileServer(int port,
java.lang.String classpath)
Constructs a ClassFileServer.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
getBytes(java.lang.String path)
Returns an array of bytes containing the bytecodes for
the class represented by the argument path.
|
static void |
main(java.lang.String[] args)
This method is for testing purposes only.
|
run, stop
public ClassFileServer(int port, java.lang.String classpath) throws java.io.IOException
classpath
- the classpath where the server locates classesjava.io.IOException
public byte[] getBytes(java.lang.String path) throws java.io.IOException, java.lang.ClassNotFoundException
getBytes
in class ClassServer
java.lang.ClassNotFoundException
- if the class corresponding
to path could not be loaded.java.io.IOException
- if error occurs reading the classpublic static void main(java.lang.String[] args)
java ClassFileServer
java -Djava.rmi.server.codebase=http://zaphod:2001/ RMIServer
new ClassFileServer(port, classpath);