Class DefaultLockPruneService
java.lang.Object
com.broadleafcommerce.subscription.service.DefaultLockPruneService
- All Implemented Interfaces:
org.springframework.context.Lifecycle,org.springframework.context.Phased,org.springframework.context.SmartLifecycle
public class DefaultLockPruneService
extends Object
implements org.springframework.context.SmartLifecycle
ClusterService responsible for interval polling workflows whose retention period have
expired and deleting them.-
Field Summary
FieldsFields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE -
Constructor Summary
ConstructorsConstructorDescriptionDefaultLockPruneService(SubscriptionLockRepository<JpaSubscriptionLock> repository, org.springframework.scheduling.TaskScheduler scheduler, SubscriptionLockProperties properties) -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.SmartLifecycle
getPhase, stop
-
Field Details
-
started
protected boolean started
-
-
Constructor Details
-
DefaultLockPruneService
public DefaultLockPruneService(SubscriptionLockRepository<JpaSubscriptionLock> repository, org.springframework.scheduling.TaskScheduler scheduler, SubscriptionLockProperties properties)
-
-
Method Details
-
isRunning
public boolean isRunning()- Specified by:
isRunningin interfaceorg.springframework.context.Lifecycle
-
isAutoStartup
public boolean isAutoStartup()- Specified by:
isAutoStartupin interfaceorg.springframework.context.SmartLifecycle
-
start
public void start()- Specified by:
startin interfaceorg.springframework.context.Lifecycle
-
stop
public void stop()- Specified by:
stopin interfaceorg.springframework.context.Lifecycle
-
cleanup
protected void cleanup()Remove expired locks in batches. -
getPause
protected long getPause()Get a random pause interval between the min and max subscription lock poll interval.- Returns:
- the pause interval
-
isStarted
public boolean isStarted()
-