Package org.glassfish.jdbc.deployer
Class JdbcConnectionPoolDeployer
- java.lang.Object
-
- org.glassfish.jdbc.deployer.JdbcConnectionPoolDeployer
-
- All Implemented Interfaces:
ResourceDeployer
@Service @Singleton public class JdbcConnectionPoolDeployer extends Object implements ResourceDeployer
Handles Jdbc connection pool events in the server instance. When user adds a jdbc connection pool , the admin instance emits resource event. The jdbc connection pool events are propagated to this object. The methods can potentially be called concurrently, therefore implementation need to be synchronized.- Author:
- Tamil Vengan
-
-
Constructor Summary
Constructors Constructor Description JdbcConnectionPoolDeployer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactualDeployResource(Object resource, PoolInfo poolInfo)Deploy the resource into the server's runtime naming contextbooleancanDeploy(boolean postApplicationDeployment, Collection<Resource> allResources, Resource resource)A deployer can indicate whether a particular resource can be deployed before application deployment Used in case of application-scoped-resources eg: Embedded RAR resources are created after application (that has embedded .rar) deployment.ConnectorConnectionPoolcreateConnectorConnectionPool(JdbcConnectionPool adminPool, PoolInfo poolInfo)voiddeployResource(Object resource)Deploy the resource into the server's runtime naming contextvoiddeployResource(Object resource, String applicationName, String moduleName)Deploy the resource into the server's runtime naming context This API is used in cases where the "config" bean is not yet persisted in domain.xml and is part of the "config" transaction.voiddisableResource(Object resource)Disable the resource in the server's runtime naming contextvoidenableResource(Object resource)Enable the resource in the server's runtime naming contextClass[]getProxyClassesForDynamicReconfiguration()List of classes which need to be proxied for dynamic-reconfigurationbooleanhandles(Object resource)Indicates whether a particular resource deployer can handle the resource in questionvoidredeployResource(Object resource)Redeploy the resource into the server's runtime naming contextbooleansupportsDynamicReconfiguration()Indicates whether the resource deployer can handle transparent-dynamic-reconfiguration of resourcevoidundeployResource(Object resource)Undeploy the resource from the server's runtime naming contextvoidundeployResource(Object resource, String applicationName, String moduleName)Undeploy the resource from the server's runtime naming contextvoidvalidatePreservedResource(Application oldApp, Application newApp, Resource resource, Resources allResources)
-
-
-
Method Detail
-
deployResource
public void deployResource(Object resource, String applicationName, String moduleName) throws Exception
Deploy the resource into the server's runtime naming context This API is used in cases where the "config" bean is not yet persisted in domain.xml and is part of the "config" transaction.- Specified by:
deployResourcein interfaceResourceDeployer- Parameters:
resource- a resource object (eg. JmsResource)applicationName- application-namemoduleName- module-name- Throws:
Exception- thrown if fail
-
deployResource
public void deployResource(Object resource) throws Exception
Deploy the resource into the server's runtime naming context- Specified by:
deployResourcein interfaceResourceDeployer- Parameters:
resource- a resource object (eg. JmsResource)- Throws:
Exception- thrown if fail
-
canDeploy
public boolean canDeploy(boolean postApplicationDeployment, Collection<Resource> allResources, Resource resource)A deployer can indicate whether a particular resource can be deployed before application deployment Used in case of application-scoped-resources eg: Embedded RAR resources are created after application (that has embedded .rar) deployment.- Specified by:
canDeployin interfaceResourceDeployer- Parameters:
postApplicationDeployment- post-application-deploymentallResources- resources collection in which the resource being validated is present.resource- resource to be validated- Returns:
- boolean
-
actualDeployResource
public void actualDeployResource(Object resource, PoolInfo poolInfo)
Deploy the resource into the server's runtime naming context- Parameters:
resource- a resource object- Throws:
Exception- thrown if fail
-
undeployResource
public void undeployResource(Object resource, String applicationName, String moduleName) throws Exception
Undeploy the resource from the server's runtime naming context- Specified by:
undeployResourcein interfaceResourceDeployer- Parameters:
resource- a resource object (eg. JmsResource)applicationName- application-namemoduleName- module-name- Throws:
Exception- thrown if fail
-
undeployResource
public void undeployResource(Object resource) throws Exception
Undeploy the resource from the server's runtime naming context- Specified by:
undeployResourcein interfaceResourceDeployer- Parameters:
resource- a resource object (eg. JmsResource)- Throws:
Exception- thrown if fail
-
handles
public boolean handles(Object resource)
Indicates whether a particular resource deployer can handle the resource in question- Specified by:
handlesin interfaceResourceDeployer- Parameters:
resource- resource that need to be handled- Returns:
- boolean
-
supportsDynamicReconfiguration
public boolean supportsDynamicReconfiguration()
Description copied from interface:ResourceDeployerIndicates whether the resource deployer can handle transparent-dynamic-reconfiguration of resource- Specified by:
supportsDynamicReconfigurationin interfaceResourceDeployer- Returns:
- boolean indicating whether transparent-dynamic-reconfiguration is supported.
-
getProxyClassesForDynamicReconfiguration
public Class[] getProxyClassesForDynamicReconfiguration()
Description copied from interface:ResourceDeployerList of classes which need to be proxied for dynamic-reconfiguration- Specified by:
getProxyClassesForDynamicReconfigurationin interfaceResourceDeployer- Returns:
- list of classes
-
createConnectorConnectionPool
public ConnectorConnectionPool createConnectorConnectionPool(JdbcConnectionPool adminPool, PoolInfo poolInfo) throws ConnectorRuntimeException
- Throws:
ConnectorRuntimeException
-
redeployResource
public void redeployResource(Object resource) throws Exception
Redeploy the resource into the server's runtime naming context- Specified by:
redeployResourcein interfaceResourceDeployer- Parameters:
resource- a resource object- Throws:
Exception- thrown if fail
-
enableResource
public void enableResource(Object resource) throws Exception
Enable the resource in the server's runtime naming context- Specified by:
enableResourcein interfaceResourceDeployer- Parameters:
resource- a resource object- Throws:
UnsupportedOperationException- Currently we are not supporting this method.Exception- thrown if fail
-
disableResource
public void disableResource(Object resource) throws Exception
Disable the resource in the server's runtime naming context- Specified by:
disableResourcein interfaceResourceDeployer- Parameters:
resource- a resource object- Throws:
UnsupportedOperationException- Currently we are not supporting this method.Exception- thrown if fail
-
validatePreservedResource
public void validatePreservedResource(Application oldApp, Application newApp, Resource resource, Resources allResources) throws ResourceConflictException
- Specified by:
validatePreservedResourcein interfaceResourceDeployer- Throws:
ResourceConflictException
-
-