org.objectweb.proactive.core.rmi
Class ClassServer

java.lang.Object
  extended byorg.objectweb.proactive.core.rmi.ClassServer
All Implemented Interfaces:
java.lang.Runnable

public class ClassServer
extends java.lang.Object
implements java.lang.Runnable


Field Summary
static int DEFAULT_SERVER_BASE_PORT
           
protected static int DEFAULT_SERVER_PORT_INCREMENT
           
protected  java.lang.String hostname
           
protected static org.apache.log4j.Logger logger
           
protected static int MAX_RETRY
           
protected  java.lang.String paths
           
protected static int port
           
 
Constructor Summary
protected ClassServer()
          Constructs a ClassServer that listens on a random port.
protected ClassServer(int port_)
           
protected ClassServer(int port_, java.lang.String paths)
          Constructs a ClassServer that listens on port and obtains a class's bytecodes using the method getBytes.
  ClassServer(java.lang.String paths)
          Constructs a ClassFileServer.
 
Method Summary
 java.lang.String getHostname()
           
static int getServerSocketPort()
           
static java.lang.String getUrl()
           
static boolean isPortAlreadyBound(int port)
           
 void run()
          The "listen" thread that accepts a connection to the server, parses the header to obtain the class file name and sends back the bytecodes for the class (or error if the class is not found or the response was malformed).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static org.apache.log4j.Logger logger

DEFAULT_SERVER_BASE_PORT

public static final int DEFAULT_SERVER_BASE_PORT
See Also:
Constant Field Values

DEFAULT_SERVER_PORT_INCREMENT

protected static int DEFAULT_SERVER_PORT_INCREMENT

MAX_RETRY

protected static int MAX_RETRY

port

protected static int port

hostname

protected java.lang.String hostname

paths

protected java.lang.String paths
Constructor Detail

ClassServer

protected ClassServer()
               throws java.io.IOException
Constructs a ClassServer that listens on a random port. The port number used is the first one found free starting from a default base port. obtains a class's bytecodes using the method getBytes.

Throws:
java.io.IOException - if the ClassServer could not listen on any port.

ClassServer

protected ClassServer(int port_)
               throws java.io.IOException

ClassServer

protected ClassServer(int port_,
                      java.lang.String paths)
               throws java.io.IOException
Constructs a ClassServer that listens on port and obtains a class's bytecodes using the method getBytes.

Parameters:
port_ - the port number
Throws:
java.io.IOException - if the ClassServer could not listen on port.

ClassServer

public ClassServer(java.lang.String paths)
            throws java.io.IOException
Constructs a ClassFileServer.

Parameters:
paths - the classpath where the server locates classes
Method Detail

isPortAlreadyBound

public static boolean isPortAlreadyBound(int port)

getServerSocketPort

public static int getServerSocketPort()

getHostname

public java.lang.String getHostname()

getUrl

public static java.lang.String getUrl()

run

public void run()
The "listen" thread that accepts a connection to the server, parses the header to obtain the class file name and sends back the bytecodes for the class (or error if the class is not found or the response was malformed).

Specified by:
run in interface java.lang.Runnable


Copyright 2001-2005 INRIA All Rights Reserved.