loader
Class ClassServer

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--loader.ClassServer

public class ClassServer
extends java.lang.Thread


This class together with WorkerClassLoader is the server part of NetworkClassLoader.

This class, which executes in a Thread uses java.net.ServerSocket.
It listens on a port (default 5050) for incoming connections.
For every connection a new thread (a WorkerClassLoader) is generated with the following parameters:
clientSocket - socket for the brand new connection.
classCache - a cache, which is global in the server of classes which have already been loaded.

Version:
1.2 August 2000
Author:
Lorenzo Bettini - bettini@dsi.unifi.it, Donato Cappetta - cappetta@infomedia.it
See Also:
Thread

Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ClassServer(int port)
          Costruttore.
 
Method Summary
protected  void finalize()
          Empty cache.
 void run()
          An infinite loop for listening for incoming connections.
For every new accepted connection a new thread is created for communicating with the client.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClassServer

public ClassServer(int port)
            throws java.net.UnknownHostException,
                   java.io.IOException
Costruttore.
Parameters:
port - port for serverSocket, if port = 0 default (5050) is considered.
Throws:
java.net.UnknownHostException - No name is associated with this machine.
java.io.IOException - I/O error.
Method Detail

run

public void run()
An infinite loop for listening for incoming connections.
For every new accepted connection a new thread is created for communicating with the client.
Overrides:
run in class java.lang.Thread

finalize

protected void finalize()
Empty cache.
Overrides:
finalize in class java.lang.Object