@Service(value="blScheduledDeployManager") @ManagedResource(objectName="org.broadleafcommerce:name=ScheduledDeployManager", description="Manages processing of scheduled deployments", currencyTimeLimit=15) public class ScheduledDeployManagerImpl extends Object implements ScheduledDeployManager, org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>
Modifier and Type | Class and Description |
---|---|
static class |
ScheduledDeployManagerImpl.ConsumeJob |
static class |
ScheduledDeployManagerImpl.HeartBeatJob |
static class |
ScheduledDeployManagerImpl.PurgeMasterJob |
Modifier and Type | Field and Description |
---|---|
protected org.springframework.context.ApplicationContext |
context |
protected Map<String,SystemEventFactory> |
eventFactories |
protected DatabaseSystemEventNode |
eventNode |
protected boolean |
isMaster |
protected long |
jobThreadPoolCount |
protected boolean |
masterDeployNodeEnabled |
protected long |
masterNodeHeartbeatIntervalSeconds
Number of seconds between each hearbeat check event for a node.
|
protected long |
nodePurgeIntervalSeconds
Number of seconds between each polling attempt to the database in search of defunct nodes to purge.
|
protected long |
nodePurgeThresholdSeconds
Number of seconds a node can miss heartbeat detection before determining that the node has become defunct.
|
protected boolean |
pause |
protected long |
pollingIntervalSeconds
Number of seconds between each polling attempt to the database in search of new deploy system events to process.
|
protected org.quartz.Scheduler |
scheduler |
protected DatabaseSystemEventDao |
systemEventDao |
protected org.springframework.transaction.PlatformTransactionManager |
transactionManager |
protected org.broadleafcommerce.common.util.StreamingTransactionCapableUtil |
transUtil |
Constructor and Description |
---|
ScheduledDeployManagerImpl() |
Modifier and Type | Method and Description |
---|---|
Map<String,SystemEventFactory> |
getEventFactories()
Retrieve the list of factories responsible for creating
SystemEvent instances
upon job execution. |
DatabaseSystemEventNode |
getEventNode()
This ScheduledJobManager instance is also a node in the cluster.
|
long |
getJobThreadPoolCount()
The number of Quartz thread available for jobs execution.
|
long |
getMasterNodeHeartbeatIntervalSeconds()
The amount of time between each heartbeat update for this node, if active.
|
long |
getNodePurgeIntervalSeconds()
The amount of time between each master purge attempt.
|
long |
getNodePurgeThresholdSeconds()
The amount of time an active master is allowed to not update it's heartbeat status before being a purge candidate.
|
org.quartz.Scheduler |
getScheduler()
Retrieve the internal Quartz scheduler instance.
|
boolean |
isMaster() |
boolean |
isPause()
Whether this node is paused.
|
void |
onApplicationEvent(org.springframework.context.event.ContextRefreshedEvent event) |
void |
reset()
Programatically remove this node from master/active status.
|
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
setEventFactories(Map<String,SystemEventFactory> eventFactories) |
void |
setEventNode(DatabaseSystemEventNode eventNode) |
void |
setJobThreadPoolCount(long jobThreadPoolCount) |
void |
setMaster(boolean master) |
void |
setMasterNodeHeartbeatIntervalSeconds(long masterNodeHeartbeatIntervalSeconds) |
void |
setNodePurgeIntervalSeconds(long nodePurgeIntervalSeconds) |
void |
setNodePurgeThresholdSeconds(long nodePurgeThresholdSeconds) |
void |
setPause(boolean pause) |
void |
stop() |
protected void |
suspend(boolean pause) |
protected org.broadleafcommerce.common.util.StreamingTransactionCapableUtil transUtil
protected org.springframework.transaction.PlatformTransactionManager transactionManager
protected DatabaseSystemEventNode eventNode
protected DatabaseSystemEventDao systemEventDao
@Value(value="${master.deploy.node.heartbeat.interval.seconds:10}") protected long masterNodeHeartbeatIntervalSeconds
@Value(value="${deploy.node.purge.threshold.seconds:60}") protected long nodePurgeThresholdSeconds
@Value(value="${deploy.node.purge.interval.seconds:30}") protected long nodePurgeIntervalSeconds
@Value(value="${database.deploy.event.polling.interval.seconds:5}") protected long pollingIntervalSeconds
@Value(value="${master.deploy.node.enabled:true}") protected boolean masterDeployNodeEnabled
protected org.springframework.context.ApplicationContext context
protected long jobThreadPoolCount
protected org.quartz.Scheduler scheduler
protected Map<String,SystemEventFactory> eventFactories
protected boolean pause
protected boolean isMaster
public void onApplicationEvent(org.springframework.context.event.ContextRefreshedEvent event)
onApplicationEvent
in interface org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>
@PreDestroy public void stop()
stop
in interface ScheduledDeployManager
public void reset()
ScheduledDeployManager
reset
in interface ScheduledDeployManager
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException
public long getMasterNodeHeartbeatIntervalSeconds()
ScheduledDeployManager
getMasterNodeHeartbeatIntervalSeconds
in interface ScheduledDeployManager
public void setMasterNodeHeartbeatIntervalSeconds(long masterNodeHeartbeatIntervalSeconds)
setMasterNodeHeartbeatIntervalSeconds
in interface ScheduledDeployManager
@ManagedAttribute(description="Number of seconds a node can miss heartbeat detection before determining that the node has become defunct.", currencyTimeLimit=15) public long getNodePurgeThresholdSeconds()
ScheduledDeployManager
getNodePurgeThresholdSeconds
in interface ScheduledDeployManager
@ManagedAttribute(description="Number of seconds a node can miss heartbeat detection before determining that the node has become defunct.", currencyTimeLimit=15) public void setNodePurgeThresholdSeconds(long nodePurgeThresholdSeconds)
setNodePurgeThresholdSeconds
in interface ScheduledDeployManager
public long getNodePurgeIntervalSeconds()
ScheduledDeployManager
getNodePurgeIntervalSeconds
in interface ScheduledDeployManager
public void setNodePurgeIntervalSeconds(long nodePurgeIntervalSeconds)
setNodePurgeIntervalSeconds
in interface ScheduledDeployManager
@ManagedAttribute(description="Whether or not deploy processing is currently paused.", currencyTimeLimit=15) public boolean isPause()
ScheduledDeployManager
isPause
in interface ScheduledDeployManager
@ManagedAttribute(description="Whether or not deploy processing is currently paused.", currencyTimeLimit=15) public void setPause(boolean pause)
setPause
in interface ScheduledDeployManager
public long getJobThreadPoolCount()
ScheduledDeployManager
getJobThreadPoolCount
in interface ScheduledDeployManager
public void setJobThreadPoolCount(long jobThreadPoolCount)
setJobThreadPoolCount
in interface ScheduledDeployManager
public Map<String,SystemEventFactory> getEventFactories()
ScheduledDeployManager
SystemEvent
instances
upon job execution. Jobs, when fired, result in events. Event are then consumed, which is the end goal.getEventFactories
in interface ScheduledDeployManager
public void setEventFactories(Map<String,SystemEventFactory> eventFactories)
setEventFactories
in interface ScheduledDeployManager
public boolean isMaster()
isMaster
in interface ScheduledDeployManager
public void setMaster(boolean master)
setMaster
in interface ScheduledDeployManager
public org.quartz.Scheduler getScheduler()
ScheduledDeployManager
getScheduler
in interface ScheduledDeployManager
public DatabaseSystemEventNode getEventNode()
ScheduledDeployManager
DatabaseSystemEventNode
instance.getEventNode
in interface ScheduledDeployManager
public void setEventNode(DatabaseSystemEventNode eventNode)
setEventNode
in interface ScheduledDeployManager
protected void suspend(boolean pause)
Copyright © 2019. All rights reserved.