C D F G I J L M N P R S W

C

ClassPacket - class loader.ClassPacket.
It is used to sent the class byte array to the requester.

It could also store some further information.
ClassPacket(byte[]) - Constructor for class loader.ClassPacket
Costructor for the byte array
ClassPacket(String) - Constructor for class loader.ClassPacket
Costructor for errors
ClassServer - class loader.ClassServer.

This class together with WorkerClassLoader is the server part of NetworkClassLoader.
ClassServer(int) - Constructor for class loader.ClassServer
Costruttore.
connect() - Method in class loader.NetworkClassLoader
connect to the ClassServer
ConnectClassServerException - exception loader.ConnectClassServerException.
When there are connection problem to the server.
ConnectClassServerException(String) - Constructor for class loader.ConnectClassServerException
 
createLocalResourceFile(String, byte[]) - Method in class loader.NetworkClassLoader
create the local file for the resource and return the URL.
createLocalResourceName(String) - Method in class loader.NetworkClassLoader
it creates a name for the local file that will store the resource contents.

D

disconnect() - Method in class loader.NetworkClassLoader
Close the connection to the ClassServer

F

finalize() - Method in class loader.ClassServer
Empty cache.
findClass(String) - Method in class loader.NetworkClassLoader
Required method.
findResource(String) - Method in class loader.NetworkClassLoader
 

G

getClassBytes() - Method in class loader.ClassPacket
return the byte array
getClassBytes(String) - Method in class loader.WorkerClassServer
get the bytes for the requested class
getError() - Method in class loader.ResourcePacket
return the string for the error
getLocalResourceURL(File) - Method in class loader.NetworkClassLoader
open the local file for the resource and return the URL.
getResourceBytes() - Method in class loader.ResourcePacket
return the byte array
getResourceBytes(String) - Method in class loader.WorkerClassServer
get the bytes for the requested resource
getResourceName() - Method in class loader.ResourceRequest
return the name of the resource
getResourceType() - Method in class loader.ResourceRequest
return the type of the resource

I

isOK() - Method in class loader.ResourcePacket
if no error happened

J

JavaPackageException - exception loader.JavaPackageException.
The exception is generated when we try to load a class of package java.* from a source that is different from the local file system.
The JVM provides java.* classes with particular privilidges.
This is why it is forbidden such a loading operation.
JavaPackageException(String) - Constructor for class loader.JavaPackageException
 

L

loadClass(String, boolean) - Method in class loader.NetworkClassLoader
Not required.
loadClassFromServer(String) - Method in class loader.NetworkClassLoader
Read the class from the network and return a byte array.
loadResource(InputStream) - Method in class loader.WorkerClassServer
read a file from a stream and returns a byte array.
loadResourceFromServer(String, String) - Method in class loader.NetworkClassLoader
Read the class from the network and return a byte array.

M

main(String[]) - Static method in class loader.RunLoader
 
main(String[]) - Static method in class loader.RunServer
 

N

NetworkClassLoader - class loader.NetworkClassLoader.

Load a class from the local file system or from the network.
When a class is loaded with this loader, this loader becomes the default loader.
NetworkClassLoader() - Constructor for class loader.NetworkClassLoader
default constructor
NetworkClassLoader(String, int) - Constructor for class loader.NetworkClassLoader
Costructor.

P

Print(String) - Method in class loader.NetworkClassLoader
Print on the screen with indentation to show the nesting of the calls.

R

ResourcePacket - class loader.ResourcePacket.
It is used to sent the class byte array to the requester.

It could also store some further information.
ResourcePacket(byte[]) - Constructor for class loader.ResourcePacket
Costructor for the byte array
ResourcePacket(String) - Constructor for class loader.ResourcePacket
Costructor for errors
ResourceRequest - class loader.ResourceRequest.
It is used to sent the request for a resource to the server.

It could also store some further information.
ResourceRequest(String, String) - Constructor for class loader.ResourceRequest
Costructor
run() - Method in class loader.ClassServer
An infinite loop for listening for incoming connections.
For every new accepted connection a new thread is created for communicating with the client.
run() - Method in class loader.WorkerClassServer
A loop waiting for a class name.
RunLoader - class loader.RunLoader.
The class which executes the NetworkClassLoader.

syntax: java RunLoader hostname port nameclass (no .class)
Example: java RunLoader gemini 5050 Main

Note: newInstance() method uses default constructor of the class.
RunLoader() - Constructor for class loader.RunLoader
 
RunServer - class loader.RunServer.

Class which executes ClassServer.
Syntax: java RunServer port
default port is 5050.
RunServer() - Constructor for class loader.RunServer
 

S

sendPacket(byte[]) - Method in class loader.WorkerClassServer
send a byte array packet to the client
sendPacket(String) - Method in class loader.WorkerClassServer
send an error packet to the client
sendRequest(String, String) - Method in class loader.NetworkClassLoader
send a request to the server

W

WorkerClassServer - class loader.WorkerClassServer.
class which handles communication with NetworkClassLoader.

It waits for a class request (the name is a String).
The requested class is searched first in the cache (a byte array cache), and then in CLASSPATH of the server machine.
WorkerClassServer(Socket, Hashtable) - Constructor for class loader.WorkerClassServer
Constructor.
writePacket(ResourcePacket) - Method in class loader.WorkerClassServer
write a packet to the socket

C D F G I J L M N P R S W