EclipseLink 2.4.2, build 'v20130514-5956486' API Reference

org.eclipse.persistence.platform.server
Interface ServerPlatform

All Known Implementing Classes:
CustomServerPlatform, GlassfishPlatform, JBossPlatform, JMXServerPlatformBase, NoServerPlatform, Oc4jPlatform, SAPNetWeaver_7_1_Platform, ServerPlatformBase, SunAS9ServerPlatform, WebLogic_10_Platform, WebLogic_9_Platform, WebLogicPlatform, WebSphere_6_1_Platform, WebSphere_7_Platform, WebSpherePlatform

public interface ServerPlatform

PUBLIC: This is the interface describing the behavior for ServerPlatformBase, and any other class that wants to provide behavior for a server. This interface provides the behavior for - Which external transaction controller to use - Whether or not to enable JTA (external transaction control) - How to register/unregister for runtime services (JMX/MBean) - Whether or not to enable runtime services - How to launch container Threads Any subclasses of ServerPlatformBase created by the user must implement this interface. public API: String getServerNameAndVersion()

See Also:
ServerPlatformBase

Method Summary
 void clearStatementCache(java.sql.Connection connection)
          INTERNAL: Clears statement cache of the wrapper connection.
 void disableJTA()
          INTERNAL: disableJTA(): Configure the receiver such that my external transaction controller class will be ignored, and will NOT be used to populate DatabaseSession's external transaction controller class at runtime.
 void disableRuntimeServices()
          INTERNAL: disableRuntimeServices(): Configure the receiver such that no JMX/MBean will be registered to provide runtime services for my DatabaseSession at runtime.
 DatabaseSession getDatabaseSession()
          INTERNAL: getDatabaseSession(): Answer the instance of DatabaseSession the receiver is helping.
 java.lang.Class getExternalTransactionControllerClass()
          INTERNAL: getExternalTransactionControllerClass(): Answer the class of external transaction controller to use For this server platform.
 java.lang.String getModuleName()
          INTERNAL: getModuleName(): Answer the name of the module (jar name) that my session is associated with.
 org.eclipse.persistence.internal.helper.JPAClassLoaderHolder getNewTempClassLoader(PersistenceUnitInfo puInfo)
          INTERNAL: JIRA EJBTHREE-572 requires that we use the real classLoader in place of the getNewTempClassLoader().
 SessionLog getServerLog()
          INTERNAL: getServerLog(): Return the ServerLog for this platform Return the default ServerLog in the base
 java.lang.String getServerNameAndVersion()
          PUBLIC: getServerNameAndVersion(): Talk to the relevant server class library, and get the server name and version
 int getThreadPoolSize()
          Return the thread pool size.
 void initializeExternalTransactionController()
          INTERNAL: initializeExternalTransactionController(): Populate the DatabaseSession's external transaction controller with an instance of my transaction controller class.
 boolean isJTAEnabled()
          INTERNAL: isJTAEnabled(): Answer true if the DatabaseSession's external transaction controller class will be populated with my transaction controller class at runtime.
 boolean isRuntimeServicesEnabled()
          INTERNAL: isRuntimeServicesEnabled(): Answer true if the JMX/MBean providing runtime services for the receiver's DatabaseSession will be deployed at runtime.
 boolean isRuntimeServicesEnabledDefault()
          INTERNAL: isRuntimeServicesEnabledDefault(): Answer true if the JMX/MBean providing runtime services for the receiver's DatabaseSession will be deployed at runtime.
 void launchContainerRunnable(java.lang.Runnable runnable)
          INTERNAL: launchContainerRunnable(Runnable runnable): Use the container library to start the provided Runnable.
 void registerMBean()
          INTERNAL: registerMBean(): Create and deploy the JMX MBean to provide runtime services for my databaseSession.
 void setExternalTransactionControllerClass(java.lang.Class newClass)
          INTERNAL: setExternalTransactionControllerClass(Class newClass): Set the class of external transaction controller to use in the DatabaseSession.
 void setThreadPoolSize(int threadPoolSize)
          Set the thread pool size.
 boolean shouldUseDriverManager()
          INTERNAL: shouldUseDriverManager(): Indicates whether DriverManager should be used while connecting DefaultConnector.
 void shutdown()
          INTERNAL: perform any require shutdown tasks.
 void unregisterMBean()
          INTERNAL: unregisterMBean(): Unregister the JMX MBean that was providing runtime services for my databaseSession.
 java.sql.Connection unwrapConnection(java.sql.Connection connection)
          INTERNAL: This method is used to unwrap the oracle connection wrapped by the application server.
 boolean wasFailureCommunicationBased(java.sql.SQLException exception, org.eclipse.persistence.internal.databaseaccess.Accessor connection, org.eclipse.persistence.internal.sessions.AbstractSession sessionForProfile)
          INTERNAL: A call to this method will perform a platform based check on the connection and exception error code to determine if the connection is still valid or if a communication error has occurred.
 

Method Detail

getDatabaseSession

DatabaseSession getDatabaseSession()
INTERNAL: getDatabaseSession(): Answer the instance of DatabaseSession the receiver is helping.

Returns:
DatabaseSession

getServerNameAndVersion

java.lang.String getServerNameAndVersion()
PUBLIC: getServerNameAndVersion(): Talk to the relevant server class library, and get the server name and version

Returns:
String serverNameAndVersion

getModuleName

java.lang.String getModuleName()
INTERNAL: getModuleName(): Answer the name of the module (jar name) that my session is associated with. Answer "unknown" if there is no module name available.

Returns:
String moduleName

getExternalTransactionControllerClass

java.lang.Class getExternalTransactionControllerClass()
INTERNAL: getExternalTransactionControllerClass(): Answer the class of external transaction controller to use For this server platform. This is read-only. If the subclasses of the ServerPlatformBase do not provide the Class desired, then a new subclass should be created to return the desired class.

Returns:
Class externalTransactionControllerClass
See Also:
JTATransactionController, isJTAEnabled(), disableJTA(), initializeExternalTransactionController()

setExternalTransactionControllerClass

void setExternalTransactionControllerClass(java.lang.Class newClass)
INTERNAL: setExternalTransactionControllerClass(Class newClass): Set the class of external transaction controller to use in the DatabaseSession. This is defined by the user via the sessions.xml.

See Also:
JTATransactionController, isJTAEnabled(), disableJTA(), initializeExternalTransactionController()

initializeExternalTransactionController

void initializeExternalTransactionController()
INTERNAL: initializeExternalTransactionController(): Populate the DatabaseSession's external transaction controller with an instance of my transaction controller class. To change the external transaction controller class, we recommend creating a subclass of ServerPlatformBase, and overriding getExternalTransactionControllerClass()

See Also:
ServerPlatformBase

isJTAEnabled

boolean isJTAEnabled()
INTERNAL: isJTAEnabled(): Answer true if the DatabaseSession's external transaction controller class will be populated with my transaction controller class at runtime. If the transaction controller class is overridden in the DatabaseSession, my transaction controller class will be ignored.

Returns:
boolean isJTAEnabled
See Also:
getExternalTransactionControllerClass(), disableJTA()

isRuntimeServicesEnabledDefault

boolean isRuntimeServicesEnabledDefault()
INTERNAL: isRuntimeServicesEnabledDefault(): Answer true if the JMX/MBean providing runtime services for the receiver's DatabaseSession will be deployed at runtime. Provide the default value for isRuntimeServicesEnabled() for a ServerPlatform. By default this is false but some platforms can choose to have MBeans deployed by default.


disableJTA

void disableJTA()
INTERNAL: disableJTA(): Configure the receiver such that my external transaction controller class will be ignored, and will NOT be used to populate DatabaseSession's external transaction controller class at runtime.

See Also:
getExternalTransactionControllerClass(), isJTAEnabled()

isRuntimeServicesEnabled

boolean isRuntimeServicesEnabled()
INTERNAL: isRuntimeServicesEnabled(): Answer true if the JMX/MBean providing runtime services for the receiver's DatabaseSession will be deployed at runtime.

Returns:
boolean isRuntimeServicesEnabled
See Also:
disableRuntimeServices()

disableRuntimeServices

void disableRuntimeServices()
INTERNAL: disableRuntimeServices(): Configure the receiver such that no JMX/MBean will be registered to provide runtime services for my DatabaseSession at runtime.

See Also:
isRuntimeServicesEnabled()

registerMBean

void registerMBean()
INTERNAL: registerMBean(): Create and deploy the JMX MBean to provide runtime services for my databaseSession.

See Also:
isRuntimeServicesEnabled(), disableRuntimeServices(), unregisterMBean()

unregisterMBean

void unregisterMBean()
INTERNAL: unregisterMBean(): Unregister the JMX MBean that was providing runtime services for my databaseSession.

See Also:
isRuntimeServicesEnabled(), disableRuntimeServices(), registerMBean()

shutdown

void shutdown()
INTERNAL: perform any require shutdown tasks.


getThreadPoolSize

int getThreadPoolSize()
Return the thread pool size.


setThreadPoolSize

void setThreadPoolSize(int threadPoolSize)
Set the thread pool size.


unwrapConnection

java.sql.Connection unwrapConnection(java.sql.Connection connection)
INTERNAL: This method is used to unwrap the oracle connection wrapped by the application server. TopLink needs this unwrapped connection for certain database vendor specific support. This is added as a workaround for bug 4460996


launchContainerRunnable

void launchContainerRunnable(java.lang.Runnable runnable)
INTERNAL: launchContainerRunnable(Runnable runnable): Use the container library to start the provided Runnable. Default behavior is to use Thread(runnable).start()

Parameters:
Runnable - runnable: the instance of runnable to be "started"

getServerLog

SessionLog getServerLog()
INTERNAL: getServerLog(): Return the ServerLog for this platform Return the default ServerLog in the base

Returns:
org.eclipse.persistence.logging.SessionLog

shouldUseDriverManager

boolean shouldUseDriverManager()
INTERNAL: shouldUseDriverManager(): Indicates whether DriverManager should be used while connecting DefaultConnector.

Returns:
boolean

wasFailureCommunicationBased

boolean wasFailureCommunicationBased(java.sql.SQLException exception,
                                     org.eclipse.persistence.internal.databaseaccess.Accessor connection,
                                     org.eclipse.persistence.internal.sessions.AbstractSession sessionForProfile)
INTERNAL: A call to this method will perform a platform based check on the connection and exception error code to determine if the connection is still valid or if a communication error has occurred. In the case of the server platform the connection pool itself may be tested. If a communication error has occurred then the query may be retried. If this platform is unable to determine if the error was communication based it will return false forcing the error to be thrown to the user.


getNewTempClassLoader

org.eclipse.persistence.internal.helper.JPAClassLoaderHolder getNewTempClassLoader(PersistenceUnitInfo puInfo)
INTERNAL: JIRA EJBTHREE-572 requires that we use the real classLoader in place of the getNewTempClassLoader(). The override code should stay in place until the UCL3 loader does not throw a NPE on loadClass()

Parameters:
puInfo - - the persistence unit info
Returns:
ClassLoaderHolder - a composite object containing the classLoader and the flag that is true if the classLoader returned is temporary
See Also:
org.eclipse.persistence.internal.helper.ClassLoaderHolder

clearStatementCache

void clearStatementCache(java.sql.Connection connection)
INTERNAL: Clears statement cache of the wrapper connection. Required by Oracle proxy authentication: currently connection statement cache becomes invalid on switching to/from proxy session. This method is called by OracleJDBC_10_1_0_2ProxyConnectionCustomizer before opening proxy session and before closing it.


EclipseLink 2.4.2, build 'v20130514-5956486' API Reference