org.xins.common.servlet.container
Class ServletClassLoader

java.lang.Object
  extended byorg.xins.common.servlet.container.ServletClassLoader

public class ServletClassLoader
extends Object

Class used to get the Servlet Class loader. The class loader returned is a child first class loader.

Version:
$Revision: 1.10 $ $Date: 2006/08/28 09:12:34 $
Author:
Anthony Goubard

Field Summary
static int USE_CLASSPATH_LIB
          Load the Servlet code from the WAR file and use the current classpath for the libraries.
static int USE_CURRENT_CLASSPATH
          Use the current class loader to load the servlet and the libraries.
static int USE_WAR_EXTERNAL_LIB
          Load the servlet code and the standard libraries from the CLASSPATH.
static int USE_WAR_LIB
          Load the servlet code and the libraries from the WAR file.
static int USE_XINS_LIB
          Load the servlet code from the WAR file and try to find the libraries in the same directory as this xins-common.jar and <:parent>/lib directory.
 
Constructor Summary
ServletClassLoader()
           
 
Method Summary
static ClassLoader getServletClassLoader(File warFile, int mode)
          Gest the class loader that will loader the servlet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

USE_CURRENT_CLASSPATH

public static final int USE_CURRENT_CLASSPATH
Use the current class loader to load the servlet and the libraries.

See Also:
Constant Field Values

USE_CLASSPATH_LIB

public static final int USE_CLASSPATH_LIB
Load the Servlet code from the WAR file and use the current classpath for the libraries.

See Also:
Constant Field Values

USE_XINS_LIB

public static final int USE_XINS_LIB
Load the servlet code from the WAR file and try to find the libraries in the same directory as this xins-common.jar and <:parent>/lib directory.

See Also:
Constant Field Values

USE_WAR_LIB

public static final int USE_WAR_LIB
Load the servlet code and the libraries from the WAR file. This may take some time as the libraries need to be extracted from the WAR file.

See Also:
Constant Field Values

USE_WAR_EXTERNAL_LIB

public static final int USE_WAR_EXTERNAL_LIB
Load the servlet code and the standard libraries from the CLASSPATH. Load the included external libraries from the WAR file.

See Also:
Constant Field Values
Constructor Detail

ServletClassLoader

public ServletClassLoader()
Method Detail

getServletClassLoader

public static ClassLoader getServletClassLoader(File warFile,
                                                int mode)
                                         throws IOException
Gest the class loader that will loader the servlet.

Parameters:
warFile - the WAR file containing the Servlet.
mode - the mode in which the servlet should be loaded. The possible values are USE_CURRENT_CLASSPATH, USE_CLASSPATH_LIB, USE_XINS_LIB, USE_WAR_LIB, USE_WAR_EXTERNAL_LIB.
Returns:
the Class loader to use to load the Servlet.
Throws:
IOException - if the file cannot be read or is incorrect.


See http://www.xins.org/.