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

public Interface ServerPlatform

Known Direct Implementers
org.eclipse.persistence.platform.server.ServerPlatformBase
Imports
java.sql.SQLException, jakarta.persistence.spi.PersistenceUnitInfo, org.eclipse.persistence.internal.databaseaccess.Accessor, org.eclipse.persistence.internal.helper.JPAClassLoaderHolder, org.eclipse.persistence.internal.sessions.AbstractSession, org.eclipse.persistence.sessions.DatabaseSession, .ExternalTransactionController

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

Modifier and TypeMethod and Description
public void
clearStatementCache(Connection connection)

INTERNAL: Clears statement cache of the wrapper connection.

public 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.

public void
disableRuntimeServices()

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

public DatabaseSession

Returns:

DatabaseSession
getDatabaseSession
()

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

public Class<? extends ExternalTransactionController>

Returns:

Class externalTransactionControllerClass
getExternalTransactionControllerClass
()

INTERNAL: getExternalTransactionControllerClass(): Answer the class of external transaction controller to use For this server platform.

public int
getJNDIConnectorLookupType()

INTERNAL: Get JNDIConnector lookupType value for this platform.

public String

Returns:

String moduleName
getModuleName
()

INTERNAL: getModuleName(): Answer the name of the module (jar name) that my session is associated with.

public JPAClassLoaderHolder

Returns:

ClassLoaderHolder - a composite object containing the classLoader and the flag that is true if the classLoader returned is temporary
getNewTempClassLoader
(PersistenceUnitInfo
- the persistence unit info
puInfo
)

INTERNAL: JIRA EJBTHREE-572 requires that we use the real classLoader in place of the getNewTempClassLoader().

public String

Returns:

partition ID
getPartitionID
()

INTERNAL: Get Partition ID.

public SessionLog

Returns:

org.eclipse.persistence.logging.SessionLog
getServerLog
()

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

public String

Returns:

String serverNameAndVersion
getServerNameAndVersion
()

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

public int
getThreadPoolSize()

Return the thread pool size.

public void
initializeExternalTransactionController()

INTERNAL: initializeExternalTransactionController(): Populate the DatabaseSession's external transaction controller with an instance of my transaction controller class.

public boolean

Returns:

boolean isJTAEnabled
isJTAEnabled
()

INTERNAL: isJTAEnabled(): Answer true if the DatabaseSession's external transaction controller class will be populated with my transaction controller class at runtime.

public boolean

Returns:

boolean isRuntimeServicesEnabled
isRuntimeServicesEnabled
()

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

public boolean
isRuntimeServicesEnabledDefault()

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

public void
launchContainerRunnable(Runnable
the instance of runnable to be "started"
runnable
)

INTERNAL: launchContainerRunnable(Runnable runnable): Use the container library to start the provided Runnable.

public void
registerMBean()

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

public void
setExternalTransactionControllerClass(Class<? extends ExternalTransactionController> newClass)

INTERNAL: setExternalTransactionControllerClass(Class newClass): Set the class of external transaction controller to use in the DatabaseSession.

public void
setThreadPoolSize(int threadPoolSize)

Set the thread pool size.

public boolean

Returns:

boolean
shouldUseDriverManager
()

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

public void
shutdown()

INTERNAL: perform any require shutdown tasks.

public void
unregisterMBean()

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

public Connection
unwrapConnection(Connection connection)

INTERNAL: This method is used to unwrap the oracle connection wrapped by the application server.

public boolean

Returns:

true if server supports partitions, false otherwise
usesPartitions
()

INTERNAL: Some servers may support partitioning

public boolean
wasFailureCommunicationBased(SQLException exception, Accessor connection, 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

clearStatementCacheback to summary
public void clearStatementCache(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.

disableJTAback to summary
public 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()
disableRuntimeServicesback to summary
public 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()
getDatabaseSessionback to summary
public DatabaseSession getDatabaseSession()

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

Returns:DatabaseSession

DatabaseSession

getExternalTransactionControllerClassback to summary
public Class<? extends ExternalTransactionController> 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<? extends ExternalTransactionController>

Class externalTransactionControllerClass

See Also
org.eclipse.persistence.transaction.JTATransactionController, isJTAEnabled(), disableJTA(), initializeExternalTransactionController()
getJNDIConnectorLookupTypeback to summary
public int getJNDIConnectorLookupType()

INTERNAL: Get JNDIConnector lookupType value for this platform.

getModuleNameback to summary
public 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

String moduleName

getNewTempClassLoaderback to summary
public 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:PersistenceUnitInfo

- the persistence unit info

Returns:JPAClassLoaderHolder

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.JPAClassLoaderHolder
getPartitionIDback to summary
public String getPartitionID()

INTERNAL: Get Partition ID.

Returns:String

partition ID

getServerLogback to summary
public SessionLog getServerLog()

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

Returns:SessionLog

org.eclipse.persistence.logging.SessionLog

getServerNameAndVersionback to summary
public String getServerNameAndVersion()

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

Returns:String

String serverNameAndVersion

getThreadPoolSizeback to summary
public int getThreadPoolSize()

Return the thread pool size.

initializeExternalTransactionControllerback to summary
public 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
isJTAEnabledback to summary
public 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

boolean isJTAEnabled

See Also
getExternalTransactionControllerClass(), disableJTA()
isRuntimeServicesEnabledback to summary
public 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

boolean isRuntimeServicesEnabled

See Also
disableRuntimeServices()
isRuntimeServicesEnabledDefaultback to summary
public 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.

launchContainerRunnableback to summary
public void launchContainerRunnable(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"

registerMBeanback to summary
public void registerMBean()

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

See Also
isRuntimeServicesEnabled(), disableRuntimeServices(), unregisterMBean()
setExternalTransactionControllerClassback to summary
public void setExternalTransactionControllerClass(Class<? extends ExternalTransactionController> 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
org.eclipse.persistence.transaction.JTATransactionController, isJTAEnabled(), disableJTA(), initializeExternalTransactionController()
setThreadPoolSizeback to summary
public void setThreadPoolSize(int threadPoolSize)

Set the thread pool size.

shouldUseDriverManagerback to summary
public boolean shouldUseDriverManager()

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

Returns:boolean

boolean

shutdownback to summary
public void shutdown()

INTERNAL: perform any require shutdown tasks.

unregisterMBeanback to summary
public void unregisterMBean()

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

See Also
isRuntimeServicesEnabled(), disableRuntimeServices(), registerMBean()
unwrapConnectionback to summary
public Connection unwrapConnection(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

usesPartitionsback to summary
public boolean usesPartitions()

INTERNAL: Some servers may support partitioning

Returns:boolean

true if server supports partitions, false otherwise

wasFailureCommunicationBasedback to summary
public boolean wasFailureCommunicationBased(SQLException exception, Accessor connection, 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.