Class Container
java.lang.Object
com.opensymphony.module.sitemesh.util.Container
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
FieldsModifier and TypeFieldDescriptionprivate static Map
A map containing classes that can be searched for, and which container they are typically found in.static final int
static final int
static final int
static final int
private static int
static final int
static final int
static final int
static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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 Details
-
UNKNOWN
public static final int UNKNOWN- See Also:
-
TOMCAT
public static final int TOMCAT- See Also:
-
RESIN
public static final int RESIN- See Also:
-
ORION
public static final int ORION- See Also:
-
WEBLOGIC
public static final int WEBLOGIC- See Also:
-
HPAS
public static final int HPAS- See Also:
-
JRUN
public static final int JRUN- See Also:
-
WEBSPHERE
public static final int WEBSPHERE- See Also:
-
result
private static int result -
classMappings
A map containing classes that can be searched for, and which container they are typically found in.
-
-
Constructor Details
-
Container
public Container()
-
-
Method Details
-
get
public static int get()Get the current container. -
searchForClosestClass
Walk up the classloader hierachy and attempt to find a class in the classMappings Map that can be loaded.- Returns:
- Name of the match class, or null if not found.
-