Package org.glassfish.jdbcruntime
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCollection<com.sun.enterprise.config.serverbeans.Resource> com.sun.enterprise.connectors.DeferredResourceConfiggetDeferredResourceConfig(Object resource, Object pool, String resType, String raName) org.glassfish.resourcebase.resources.api.PoolInfogetPoolNameFromResourceJndiName(org.glassfish.resourcebase.resources.api.ResourceInfo resourceInfo) Gets the Pool name that this JDBC resource points to.getResourceType(org.jvnet.hk2.config.ConfigBeanProxy cb) booleanisConnectionPoolReferredInServerInstance(org.glassfish.resourcebase.resources.api.PoolInfo poolInfo) Determines if a JDBC connection pool is referred in a server-instance via resource-refslookupDataSourceInDAS(org.glassfish.resourcebase.resources.api.ResourceInfo resourceInfo) Get a wrapper datasource specified by the jdbcjndi name This API is intended to be used in the DAS.voidregisterDataSourceDefinitions(com.sun.enterprise.deployment.Application application) voidunRegisterDataSourceDefinitions(com.sun.enterprise.deployment.Application application)
-
Constructor Details
-
JdbcRuntimeExtension
public JdbcRuntimeExtension()
-
-
Method Details
-
getAllSystemRAResourcesAndPools
- Specified by:
getAllSystemRAResourcesAndPoolsin interfacecom.sun.enterprise.connectors.ConnectorRuntimeExtension
-
registerDataSourceDefinitions
public void registerDataSourceDefinitions(com.sun.enterprise.deployment.Application application) - Specified by:
registerDataSourceDefinitionsin interfacecom.sun.enterprise.connectors.ConnectorRuntimeExtension
-
unRegisterDataSourceDefinitions
public void unRegisterDataSourceDefinitions(com.sun.enterprise.deployment.Application application) - Specified by:
unRegisterDataSourceDefinitionsin interfacecom.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:
lookupDataSourceInDASin interfacecom.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:
getPoolNameFromResourceJndiNamein interfacecom.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:
isConnectionPoolReferredInServerInstancein interfacecom.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
- Specified by:
getResourceTypein interfacecom.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:
getDeferredResourceConfigin interfacecom.sun.enterprise.connectors.ConnectorRuntimeExtension- Throws:
com.sun.appserv.connectors.internal.api.ConnectorRuntimeException
-