Package org.flowable.common.spring
Class CommonAutoDeploymentStrategy<E>
- java.lang.Object
-
- org.flowable.common.spring.CommonAutoDeploymentStrategy<E>
-
- All Implemented Interfaces:
AutoDeploymentStrategy<E>
public abstract class CommonAutoDeploymentStrategy<E> extends Object implements AutoDeploymentStrategy<E>
Common base class for implementations ofAutoDeploymentStrategy. It has support for using a lock manager to lock before doing the deployment.- Author:
- Filip Hrisafov
-
-
Field Summary
Fields Modifier and Type Field Description protected CommonAutoDeploymentPropertiesdeploymentPropertiesprotected org.slf4j.Loggerlogger
-
Constructor Summary
Constructors Constructor Description CommonAutoDeploymentStrategy()CommonAutoDeploymentStrategy(CommonAutoDeploymentProperties deploymentProperties)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voiddeployResources(String deploymentNameHint, org.springframework.core.io.Resource[] resources, E engine)Performs deployment for the provided resources, using the provided name as a hint and the providedengineto perform deployment(s).protected abstract voiddeployResourcesInternal(String deploymentNameHint, org.springframework.core.io.Resource[] resources, E engine)Methods that should be implemented by sub classes to perform the actual deployment.protected StringdetermineLockName(String deploymentNameHint)protected StringdetermineResourceName(org.springframework.core.io.Resource resource)Determines the name to be used for the provided resource.DurationgetDeploymentLockWaitTime()protected abstract StringgetDeploymentMode()Gets the deployment mode this strategy handles.CommonAutoDeploymentPropertiesgetDeploymentProperties()protected abstract LockManagergetLockManager(E engine, String deploymentNameHint)Get the lock manager with the givenengineand thedeploymentNameHint.StringgetLockName()booleanhandlesMode(String mode)Determines whether the strategy handles deployments for the provided deployment mode.booleanisThrowExceptionOnDeploymentFailure()booleanisUseLockForDeployments()voidsetDeploymentProperties(CommonAutoDeploymentProperties deploymentProperties)
-
-
-
Field Detail
-
logger
protected org.slf4j.Logger logger
-
deploymentProperties
protected CommonAutoDeploymentProperties deploymentProperties
-
-
Constructor Detail
-
CommonAutoDeploymentStrategy
public CommonAutoDeploymentStrategy()
-
CommonAutoDeploymentStrategy
public CommonAutoDeploymentStrategy(CommonAutoDeploymentProperties deploymentProperties)
-
-
Method Detail
-
getDeploymentMode
protected abstract String getDeploymentMode()
Gets the deployment mode this strategy handles.- Returns:
- the name of the deployment mode
-
getLockManager
protected abstract LockManager getLockManager(E engine, String deploymentNameHint)
Get the lock manager with the givenengineand thedeploymentNameHint. Used when the strategy has been configured to use lock for deployments.- Parameters:
engine- the engine that can be used to get the lock manager.deploymentNameHint- the deployment name hint- Returns:
- the lock manager
-
handlesMode
public boolean handlesMode(String mode)
Description copied from interface:AutoDeploymentStrategyDetermines whether the strategy handles deployments for the provided deployment mode.- Specified by:
handlesModein interfaceAutoDeploymentStrategy<E>- Parameters:
mode- the mode to determine handling for- Returns:
- true if the strategy handles the mode; false otherwise
-
deployResources
public void deployResources(String deploymentNameHint, org.springframework.core.io.Resource[] resources, E engine)
Description copied from interface:AutoDeploymentStrategyPerforms deployment for the provided resources, using the provided name as a hint and the providedengineto perform deployment(s).- Specified by:
deployResourcesin interfaceAutoDeploymentStrategy<E>- Parameters:
deploymentNameHint- the hint for the name of deployment(s) performedresources- the resources to be deployedengine- the engine to use for deployment(s)
-
deployResourcesInternal
protected abstract void deployResourcesInternal(String deploymentNameHint, org.springframework.core.io.Resource[] resources, E engine)
Methods that should be implemented by sub classes to perform the actual deployment. If use lock for deployments is used than this methods is called with an already acquired lock.- Parameters:
deploymentNameHint- the hint for the name of deployment(s) performedresources- the resources to be deployedengine- the engine to use for deployment(s)
-
determineResourceName
protected String determineResourceName(org.springframework.core.io.Resource resource)
Determines the name to be used for the provided resource.- Parameters:
resource- the resource to get the name for- Returns:
- the name of the resource
-
getDeploymentProperties
public CommonAutoDeploymentProperties getDeploymentProperties()
-
setDeploymentProperties
public void setDeploymentProperties(CommonAutoDeploymentProperties deploymentProperties)
-
isUseLockForDeployments
public boolean isUseLockForDeployments()
-
getDeploymentLockWaitTime
public Duration getDeploymentLockWaitTime()
-
isThrowExceptionOnDeploymentFailure
public boolean isThrowExceptionOnDeploymentFailure()
-
getLockName
public String getLockName()
-
-