Package org.flowable.common.spring
Class CommonAutoDeploymentStrategy<E>
java.lang.Object
org.flowable.common.spring.CommonAutoDeploymentStrategy<E>
- All Implemented Interfaces:
AutoDeploymentStrategy<E>
- Direct Known Subclasses:
AbstractCmmnAutoDeploymentStrategy
,AbstractDmnAutoDeploymentStrategy
,AbstractEventAutoDeploymentStrategy
,AbstractProcessAutoDeploymentStrategy
public abstract class CommonAutoDeploymentStrategy<E>
extends Object
implements AutoDeploymentStrategy<E>
Common base class for implementations of
AutoDeploymentStrategy
.
It has support for using a lock manager to lock before doing the deployment.- Author:
- Filip Hrisafov
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CommonAutoDeploymentProperties
protected org.slf4j.Logger
-
Constructor Summary
ConstructorsConstructorDescriptionCommonAutoDeploymentStrategy
(CommonAutoDeploymentProperties deploymentProperties) -
Method Summary
Modifier and TypeMethodDescriptionvoid
deployResources
(String deploymentNameHint, Resource[] resources, E engine) Performs deployment for the provided resources, using the provided name as a hint and the providedengine
to perform deployment(s).protected abstract void
deployResourcesInternal
(String deploymentNameHint, Resource[] resources, E engine) Methods that should be implemented by sub classes to perform the actual deployment.protected String
determineLockName
(String deploymentNameHint) protected String
determineResourceName
(Resource resource) Determines the name to be used for the provided resource.protected abstract String
Gets the deployment mode this strategy handles.protected abstract LockManager
getLockManager
(E engine, String deploymentNameHint) Get the lock manager with the givenengine
and thedeploymentNameHint
.boolean
handlesMode
(String mode) Determines whether the strategy handles deployments for the provided deployment mode.boolean
boolean
void
setDeploymentProperties
(CommonAutoDeploymentProperties deploymentProperties)
-
Field Details
-
logger
protected org.slf4j.Logger logger -
deploymentProperties
-
-
Constructor Details
-
CommonAutoDeploymentStrategy
public CommonAutoDeploymentStrategy() -
CommonAutoDeploymentStrategy
-
-
Method Details
-
getDeploymentMode
Gets the deployment mode this strategy handles.- Returns:
- the name of the deployment mode
-
getLockManager
Get the lock manager with the givenengine
and 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
-
determineLockName
-
handlesMode
Description copied from interface:AutoDeploymentStrategy
Determines whether the strategy handles deployments for the provided deployment mode.- Specified by:
handlesMode
in interfaceAutoDeploymentStrategy<E>
- Parameters:
mode
- the mode to determine handling for- Returns:
- true if the strategy handles the mode; false otherwise
-
deployResources
Description copied from interface:AutoDeploymentStrategy
Performs deployment for the provided resources, using the provided name as a hint and the providedengine
to perform deployment(s).- Specified by:
deployResources
in 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, 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
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
-
setDeploymentProperties
-
isUseLockForDeployments
public boolean isUseLockForDeployments() -
getDeploymentLockWaitTime
-
isThrowExceptionOnDeploymentFailure
public boolean isThrowExceptionOnDeploymentFailure() -
getLockName
-