Package org.glassfish.jdbcruntime
Class JdbcRuntimeExtension
- java.lang.Object
-
- org.glassfish.jdbcruntime.JdbcRuntimeExtension
-
- All Implemented Interfaces:
ConnectorRuntimeExtension
@Service public class JdbcRuntimeExtension extends Object implements ConnectorRuntimeExtension
- Author:
- Shalini M
-
-
Field Summary
Fields Modifier and Type Field Description protected static Loggerloggerprotected ConnectorRuntimeruntime
-
Constructor Summary
Constructors Constructor Description JdbcRuntimeExtension()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<Resource>getAllSystemRAResourcesAndPools()Return the collection of system resources and pools.DeferredResourceConfiggetDeferredResourceConfig(Object resource, Object pool, String resType, String raName)PoolInfogetPoolNameFromResourceJndiName(ResourceInfo resourceInfo)Gets the Pool name that this JDBC resource points to.StringgetResourceType(ConfigBeanProxy cb)booleanisConnectionPoolReferredInServerInstance(PoolInfo poolInfo)Determines if a JDBC connection pool is referred in a server-instance via resource-refsObjectlookupDataSourceInDAS(ResourceInfo resourceInfo)Get a wrapper datasource specified by the jdbcjndi name This API is intended to be used in the DAS.voidregisterDataSourceDefinitions(Application application)voidunRegisterDataSourceDefinitions(Application application)
-
-
-
Field Detail
-
logger
protected static final Logger logger
-
runtime
protected ConnectorRuntime runtime
-
-
Method Detail
-
getAllSystemRAResourcesAndPools
public Collection<Resource> getAllSystemRAResourcesAndPools()
Description copied from interface:ConnectorRuntimeExtensionReturn the collection of system resources and pools.- Specified by:
getAllSystemRAResourcesAndPoolsin interfaceConnectorRuntimeExtension- Returns:
- collection of system resources and pools.
-
registerDataSourceDefinitions
public void registerDataSourceDefinitions(Application application)
- Specified by:
registerDataSourceDefinitionsin interfaceConnectorRuntimeExtension
-
unRegisterDataSourceDefinitions
public void unRegisterDataSourceDefinitions(Application application)
- Specified by:
unRegisterDataSourceDefinitionsin interfaceConnectorRuntimeExtension
-
lookupDataSourceInDAS
public Object lookupDataSourceInDAS(ResourceInfo resourceInfo) throws 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 interfaceConnectorRuntimeExtension- Parameters:
resourceInfo- the jndi name of the resource- Returns:
- DataSource representing the resource.
- Throws:
ConnectorRuntimeException
-
getPoolNameFromResourceJndiName
public PoolInfo getPoolNameFromResourceJndiName(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 interfaceConnectorRuntimeExtension- 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(PoolInfo poolInfo)
Determines if a JDBC connection pool is referred in a server-instance via resource-refs- Specified by:
isConnectionPoolReferredInServerInstancein interfaceConnectorRuntimeExtension- Parameters:
poolInfo- pool-name- Returns:
- boolean true if pool is referred in this server instance as well enabled, false otherwise
-
getResourceType
public String getResourceType(ConfigBeanProxy cb)
- Specified by:
getResourceTypein interfaceConnectorRuntimeExtension
-
getDeferredResourceConfig
public DeferredResourceConfig getDeferredResourceConfig(Object resource, Object pool, String resType, String raName) throws ConnectorRuntimeException
- Specified by:
getDeferredResourceConfigin interfaceConnectorRuntimeExtension- Throws:
ConnectorRuntimeException
-
-