org.ow2.clif.util
Class CodeServer

java.lang.Object
  extended by java.net.ServerSocket
      extended by org.ow2.clif.util.CodeServer
All Implemented Interfaces:
java.lang.Runnable

public class CodeServer
extends java.net.ServerSocket
implements java.lang.Runnable

This class implements a Java resource or class server. The typical client of this code server is the ClifClassLoader. The requested resource or class is first looked for in jar files in CLIF's extension libraries directory. Then, current directory and directories set by property clif.codeserver.path are visited, in this order. The property, when set, should contain a ';' separated list of directory paths.

In detail, the codeserver listens on a given port, and upon any connection request:

As of current implementation, class/resource files bigger than 2GB can't be transfered.

Author:
Bruno Dillenseger
See Also:
ClifClassLoader

Field Summary
static java.lang.String DEFAULT_PATH
           
static int NO_SUCH_RESOURCE
           
static java.lang.String PATH_SEPARATOR
           
static int RESOURCE_TOO_BIG
           
 
Method Summary
static void launch(java.net.InetAddress localAddr, int port, java.lang.String extdir, java.lang.String path)
           
 void run()
           
 
Methods inherited from class java.net.ServerSocket
accept, bind, bind, close, getChannel, getInetAddress, getLocalPort, getLocalSocketAddress, getReceiveBufferSize, getReuseAddress, getSoTimeout, implAccept, isBound, isClosed, setPerformancePreferences, setReceiveBufferSize, setReuseAddress, setSocketFactory, setSoTimeout, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NO_SUCH_RESOURCE

public static final int NO_SUCH_RESOURCE
See Also:
Constant Field Values

RESOURCE_TOO_BIG

public static final int RESOURCE_TOO_BIG
See Also:
Constant Field Values

DEFAULT_PATH

public static final java.lang.String DEFAULT_PATH
See Also:
Constant Field Values

PATH_SEPARATOR

public static final java.lang.String PATH_SEPARATOR
See Also:
Constant Field Values
Method Detail

launch

public static void launch(java.net.InetAddress localAddr,
                          int port,
                          java.lang.String extdir,
                          java.lang.String path)
                   throws java.io.IOException
Throws:
java.io.IOException

run

public void run()
Specified by:
run in interface java.lang.Runnable