org.opensubsystems.core.util
Class J2EEUtils

java.lang.Object
  extended by org.opensubsystems.core.util.J2EEUtils

public final class J2EEUtils
extends java.lang.Object

Collection of useful utilities to work with j2ee.

Version:
$Id: J2EEUtils.java,v 1.12 2007/01/07 06:14:00 bastafidli Exp $
Author:
Julo legeny
Code reviewer:
Miro Halas
Code reviewed:
1.9 2005/07/29 07:36:23 bastafidli

Field Summary
static int J2EE_SERVER_JBOSS
          Constant defining JBoss j2ee server.
static int J2EE_SERVER_JONAS
          Constant defining JOnAS j2ee server.
static int J2EE_SERVER_NO
          Constant defining no j2ee server.
static int J2EE_SERVER_UNINITIALIZED
          Constant defining j2ee server was not yet detected.
static int J2EE_SERVER_WEBLOGIC
          Constant defining WebLogic j2ee server.
static int J2EE_SERVER_WEBSPHERE
          Constant defining WebSphere j2ee server.
static java.lang.String JBOSS_IDENTIFIER
          Constant identifying JBoss j2ee server.
static java.lang.String JONAS_IDENTIFIER
          Constant identifying JOnAS j2ee server.
protected static int s_iDetectedServer
          Since J2EE server doesn't changes during execution we can cache the value for detected server.
static java.lang.String WEBLOGIC_IDENTIFIER
          Constant identifying WebLogic j2ee server.
static java.lang.String WEBSPHERE_IDENTIFIER
          Constant identifying WebSphere j2ee server.
 
Method Summary
protected static int detectJ2EEServerType(java.lang.String strIdentifier)
          Detect current running j2ee server based on the specified string because it is server specific.
static int getJ2EEServerType()
          Method detects and returns type of the current running j2ee server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

J2EE_SERVER_UNINITIALIZED

public static final int J2EE_SERVER_UNINITIALIZED
Constant defining j2ee server was not yet detected.

See Also:
Constant Field Values

J2EE_SERVER_NO

public static final int J2EE_SERVER_NO
Constant defining no j2ee server.

See Also:
Constant Field Values

J2EE_SERVER_JONAS

public static final int J2EE_SERVER_JONAS
Constant defining JOnAS j2ee server.

See Also:
Constant Field Values

J2EE_SERVER_JBOSS

public static final int J2EE_SERVER_JBOSS
Constant defining JBoss j2ee server.

See Also:
Constant Field Values

J2EE_SERVER_WEBLOGIC

public static final int J2EE_SERVER_WEBLOGIC
Constant defining WebLogic j2ee server.

See Also:
Constant Field Values

J2EE_SERVER_WEBSPHERE

public static final int J2EE_SERVER_WEBSPHERE
Constant defining WebSphere j2ee server.

See Also:
Constant Field Values

JONAS_IDENTIFIER

public static final java.lang.String JONAS_IDENTIFIER
Constant identifying JOnAS j2ee server. There is retrieved parent of the classloader because it identify jonas server. Using just classloader there is retireved particular web server identifier (jetty, tomcat, ...). ClassLoader parent for JOnAS 4.2.3: org.objectweb.jonas_lib.loader.SimpleWebappClassLoader

See Also:
Constant Field Values

JBOSS_IDENTIFIER

public static final java.lang.String JBOSS_IDENTIFIER
Constant identifying JBoss j2ee server. ClassLoader parent for JBoss 3.2.6 and 4.0.1: org.jboss.system.server.NoAnnotationURLClassLoader

See Also:
Constant Field Values

WEBLOGIC_IDENTIFIER

public static final java.lang.String WEBLOGIC_IDENTIFIER
Constant identifying WebLogic j2ee server. ClassLoader parent for BEA WebLogic 7.0 and 8.1: weblogic.utils.classloaders.GenericClassLoader

See Also:
Constant Field Values

WEBSPHERE_IDENTIFIER

public static final java.lang.String WEBSPHERE_IDENTIFIER
Constant identifying WebSphere j2ee server. ClassLoader parent for IBM WebSphere 6: com.ibm.ws.classloader.JarClassLoader

See Also:
Constant Field Values

s_iDetectedServer

protected static int s_iDetectedServer
Since J2EE server doesn't changes during execution we can cache the value for detected server.

Method Detail

getJ2EEServerType

public static int getJ2EEServerType()
Method detects and returns type of the current running j2ee server. For detecting actual running j2ee server we will use ClassLoader because it is server specific.

Returns:
int - representation of the curernt running j2ee server

detectJ2EEServerType

protected static int detectJ2EEServerType(java.lang.String strIdentifier)
Detect current running j2ee server based on the specified string because it is server specific.

Parameters:
strIdentifier - - string which should uniquely identify the AS
Returns:
int - representation of the current running j2ee server


Copyright © 2003 - 2006 OpenSubsystems s.r.o.