Top Description Fields Constructors Methods
org.eclipse.persistence.platform.server

public final Class ServerPlatformUtils

extends Object
Class Inheritance
Imports
java.lang.reflect.Constructor, .InvocationTargetException, java.security.AccessController, .PrivilegedActionException, java.util.ArrayList, .List, org.eclipse.persistence.config.PersistenceUnitProperties, org.eclipse.persistence.exceptions.ServerPlatformException, org.eclipse.persistence.internal.security.PrivilegedAccessHelper, .PrivilegedClassForName, .PrivilegedGetConstructorFor, .PrivilegedInvokeConstructor, org.eclipse.persistence.internal.sessions.AbstractSession, .PropertiesHandler, org.eclipse.persistence.logging.AbstractSessionLog, .SessionLog, org.eclipse.persistence.platform.server.glassfish.GlassfishPlatformDetector, org.eclipse.persistence.platform.server.was.WebSpherePlatformDetector, org.eclipse.persistence.platform.server.wls.WebLogicPlatformDetector, org.eclipse.persistence.sessions.DatabaseSession

A utility class to interact with ServerPlatforms.

Field Summary

Modifier and TypeField and Description
private static final List<ServerPlatformDetector>
private static String
private static final String

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static ServerPlatform

Returns:

initialized instance of ServerPlatform
createServerPlatform
(DatabaseSession
DatabaseSession which will be passed to the constructor of ServerPlatform
session
,
String
fully qualified name of the ServerPlatform implementation to initialize
platformClass
,
ClassLoader
ClassLoader to look up given platformClass
loader
)

Create an instance of ServerPlatform from parameters passed in.

public static String

Returns:

The target-server class string that represents platform that is currently running. Return null if unknown.
detectServerPlatform
(AbstractSession session)

private static Class<? extends ServerPlatform>
findClass(String className, ClassLoader loader)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

PLATFORMSback to summary
private static final List<ServerPlatformDetector> PLATFORMS
SERVER_PLATFORM_CLSback to summary
private static String SERVER_PLATFORM_CLS
UNKNOWN_MARKERback to summary
private static final String UNKNOWN_MARKER

Constructor Detail

ServerPlatformUtilsback to summary
private ServerPlatformUtils()

Method Detail

createServerPlatformback to summary
public static ServerPlatform createServerPlatform(DatabaseSession session, String platformClass, ClassLoader loader)

Create an instance of ServerPlatform from parameters passed in.

Parameters
session:DatabaseSession

DatabaseSession which will be passed to the constructor of ServerPlatform

platformClass:String

fully qualified name of the ServerPlatform implementation to initialize

loader:ClassLoader

ClassLoader to look up given platformClass

Returns:ServerPlatform

initialized instance of ServerPlatform

Exceptions
ServerPlatformException:
if supplied platformClass is not found, can not be initialized, or is null.
See Also
ServerPlatformBase#ServerPlatformBase(DatabaseSession)
detectServerPlatformback to summary
public static String detectServerPlatform(AbstractSession session)
Returns:String

The target-server class string that represents platform that is currently running. Return null if unknown.

findClassback to summary
private static Class<? extends ServerPlatform> findClass(String className, ClassLoader loader) throws ClassNotFoundException, PrivilegedActionException