Class Container
- java.lang.Object
-
- com.opensymphony.module.sitemesh.util.Container
-
public final class Container extends Object
Utility for determining the Servlet Container the application is running in. Currently supported containers: Tomcat, Resin, Orion, OC4J, WebLogic, HPAS, JRun, Websphere.Usage:
if (Container.get() == Container.TOMCAT) { .... }
- Version:
- $Revision: 1.2 $
- Author:
- Joe Walnes
-
-
Field Summary
Fields Modifier and Type Field Description private static Map
classMappings
A map containing classes that can be searched for, and which container they are typically found in.static int
HPAS
static int
JRUN
static int
ORION
static int
RESIN
private static int
result
static int
TOMCAT
static int
UNKNOWN
static int
WEBLOGIC
static int
WEBSPHERE
-
Constructor Summary
Constructors Constructor Description Container()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
get()
Get the current container.private static String
searchForClosestClass(Map classMappings)
Walk up the classloader hierachy and attempt to find a class in the classMappings Map that can be loaded.
-
-
-
Field Detail
-
UNKNOWN
public static final int UNKNOWN
- See Also:
- Constant Field Values
-
TOMCAT
public static final int TOMCAT
- See Also:
- Constant Field Values
-
RESIN
public static final int RESIN
- See Also:
- Constant Field Values
-
ORION
public static final int ORION
- See Also:
- Constant Field Values
-
WEBLOGIC
public static final int WEBLOGIC
- See Also:
- Constant Field Values
-
HPAS
public static final int HPAS
- See Also:
- Constant Field Values
-
JRUN
public static final int JRUN
- See Also:
- Constant Field Values
-
WEBSPHERE
public static final int WEBSPHERE
- See Also:
- Constant Field Values
-
result
private static int result
-
classMappings
private static Map classMappings
A map containing classes that can be searched for, and which container they are typically found in.
-
-