Interface ServerPlatform

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      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.
      int getJNDIConnectorLookupType()
      INTERNAL: Get JNDIConnector lookupType value for this 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().
      java.lang.String getPartitionID()
      INTERNAL: Get Partition ID.
      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 usesPartitions()
      INTERNAL: Some servers may support partitioning
      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()
      • 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()
      • 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 - : 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:
        JPAClassLoaderHolder
      • 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.
      • getJNDIConnectorLookupType

        int getJNDIConnectorLookupType()
        INTERNAL: Get JNDIConnector lookupType value for this platform.
      • usesPartitions

        boolean usesPartitions()
        INTERNAL: Some servers may support partitioning
        Returns:
        true if server supports partitions, false otherwise
      • getPartitionID

        java.lang.String getPartitionID()
        INTERNAL: Get Partition ID.
        Returns:
        partition ID