Package org.ow2.clif.util
Class CodeServer
- java.lang.Object
-
- java.net.ServerSocket
-
- org.ow2.clif.util.CodeServer
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,java.lang.Runnable
public class CodeServer extends java.net.ServerSocket implements java.lang.RunnableThis 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:
- reads from the socket an UTF String representing the class or resource name
- writes a positive int stating the resource or class file length or a negative int providing an error code (resource/class not found or resource/class too big).
- if the class/resource file has been found and can be transfered, all of its bytes are written in the socket.
- the socket is not closed by the code server, except when an exception occurs while handling the socket.
- Author:
- Bruno Dillenseger
- See Also:
ClifClassLoader
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDEFAULT_PATHstatic intDEFAULT_PORTstatic intNO_SUCH_RESOURCEstatic java.lang.StringPATH_SEPARATORstatic intRESOURCE_TOO_BIG
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidlaunch(java.net.InetAddress localAddr, int port, java.lang.String extdir, java.lang.String path)voidrun()-
Methods inherited from class java.net.ServerSocket
accept, bind, bind, close, getChannel, getInetAddress, getLocalPort, getLocalSocketAddress, getOption, getReceiveBufferSize, getReuseAddress, getSoTimeout, implAccept, isBound, isClosed, setOption, setPerformancePreferences, setReceiveBufferSize, setReuseAddress, setSocketFactory, setSoTimeout, supportedOptions, toString
-
-
-
-
Field Detail
-
DEFAULT_PORT
public static final int DEFAULT_PORT
- See Also:
- Constant Field Values
-
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
-
-