Class JdbcRuntimeExtension

java.lang.Object
org.glassfish.jdbcruntime.JdbcRuntimeExtension
All Implemented Interfaces:
com.sun.enterprise.connectors.ConnectorRuntimeExtension

@Service public class JdbcRuntimeExtension extends Object implements com.sun.enterprise.connectors.ConnectorRuntimeExtension
Author:
Shalini M
  • Constructor Details

    • JdbcRuntimeExtension

      public JdbcRuntimeExtension()
  • Method Details

    • getAllSystemRAResourcesAndPools

      public Collection<com.sun.enterprise.config.serverbeans.Resource> getAllSystemRAResourcesAndPools()
      Specified by:
      getAllSystemRAResourcesAndPools in interface com.sun.enterprise.connectors.ConnectorRuntimeExtension
    • registerDataSourceDefinitions

      public void registerDataSourceDefinitions(com.sun.enterprise.deployment.Application application)
      Specified by:
      registerDataSourceDefinitions in interface com.sun.enterprise.connectors.ConnectorRuntimeExtension
    • unRegisterDataSourceDefinitions

      public void unRegisterDataSourceDefinitions(com.sun.enterprise.deployment.Application application)
      Specified by:
      unRegisterDataSourceDefinitions in interface com.sun.enterprise.connectors.ConnectorRuntimeExtension
    • lookupDataSourceInDAS

      public JdbcDataSource lookupDataSourceInDAS(org.glassfish.resourcebase.resources.api.ResourceInfo resourceInfo) throws com.sun.appserv.connectors.internal.api.ConnectorRuntimeException
      Get a wrapper datasource specified by the jdbcjndi name This API is intended to be used in the DAS. The motivation for having this API is to provide the CMP backend/ JPA-Java2DB a means of acquiring a connection during the codegen phase. If a user is trying to deploy an JPA-Java2DB app on a remote server, without this API, a resource reference has to be present both in the DAS and the server instance. This makes the deployment more complex for the user since a resource needs to be forcibly created in the DAS Too. This API will mitigate this need.
      Specified by:
      lookupDataSourceInDAS in interface com.sun.enterprise.connectors.ConnectorRuntimeExtension
      Parameters:
      resourceInfo - the jndi name of the resource
      Returns:
      JdbcDataSource representing the resource.
      Throws:
      com.sun.appserv.connectors.internal.api.ConnectorRuntimeException
    • getPoolNameFromResourceJndiName

      public org.glassfish.resourcebase.resources.api.PoolInfo getPoolNameFromResourceJndiName(org.glassfish.resourcebase.resources.api.ResourceInfo resourceInfo)
      Gets the Pool name that this JDBC resource points to. In case of a PMF resource gets the pool name of the pool pointed to by jdbc resource being pointed to by the PMF resource
      Specified by:
      getPoolNameFromResourceJndiName in interface com.sun.enterprise.connectors.ConnectorRuntimeExtension
      Parameters:
      resourceInfo - the jndi name of the resource being used to get Connection from This resource can either be a pmf resource or a jdbc resource
      Returns:
      poolName of the pool that this resource directly/indirectly points to
    • isConnectionPoolReferredInServerInstance

      public boolean isConnectionPoolReferredInServerInstance(org.glassfish.resourcebase.resources.api.PoolInfo poolInfo)
      Determines if a JDBC connection pool is referred in a server-instance via resource-refs
      Specified by:
      isConnectionPoolReferredInServerInstance in interface com.sun.enterprise.connectors.ConnectorRuntimeExtension
      Parameters:
      poolInfo - pool-name
      Returns:
      boolean true if pool is referred in this server instance as well enabled, false otherwise
    • getResourceType

      public String getResourceType(org.jvnet.hk2.config.ConfigBeanProxy cb)
      Specified by:
      getResourceType in interface com.sun.enterprise.connectors.ConnectorRuntimeExtension
    • getDeferredResourceConfig

      public com.sun.enterprise.connectors.DeferredResourceConfig getDeferredResourceConfig(Object resource, Object pool, String resType, String raName) throws com.sun.appserv.connectors.internal.api.ConnectorRuntimeException
      Specified by:
      getDeferredResourceConfig in interface com.sun.enterprise.connectors.ConnectorRuntimeExtension
      Throws:
      com.sun.appserv.connectors.internal.api.ConnectorRuntimeException