Class DefaultRetryClusterService
java.lang.Object
com.broadleafcommerce.common.messaging.notification.DefaultRetryClusterService
- All Implemented Interfaces:
RetryClusterService,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanFactoryAware,org.springframework.context.Lifecycle,org.springframework.context.Phased,org.springframework.context.SmartLifecycle
public class DefaultRetryClusterService
extends Object
implements RetryClusterService, org.springframework.beans.factory.BeanFactoryAware, org.springframework.context.SmartLifecycle
- Author:
- Jeff Fischer
-
Field Summary
Fields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE -
Constructor Summary
ConstructorsConstructorDescriptionDefaultRetryClusterService(List<NotificationStateRepository> repositories, NotificationHandler notificationHandler, DurableNotificationProperties properties, String messageType, List<IgnoredNotificationStateRepository> ignoredRepositories, com.broadleafcommerce.common.extension.data.DataRouteReference reference) -
Method Summary
Modifier and TypeMethodDescriptionprotected RetryHandlerbuildRetryHandler(NotificationStateRepository repository) intgetPhase()booleanbooleanbooleanWhether a node on the cluster has already been started as a leader.voidsetBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) voidstart()Start the node as a leader in the cluster.voidstart(List<Consumer<RetryHandlerStatus>> consumers) Start the cluster service with a list of consumers for retry handler status eventsvoidstop()Stop the node as a leader in the cluster.void
-
Constructor Details
-
DefaultRetryClusterService
public DefaultRetryClusterService(List<NotificationStateRepository> repositories, NotificationHandler notificationHandler, DurableNotificationProperties properties, String messageType, List<IgnoredNotificationStateRepository> ignoredRepositories, com.broadleafcommerce.common.extension.data.DataRouteReference reference)
-
-
Method Details
-
isAutoStartup
public boolean isAutoStartup()- Specified by:
isAutoStartupin interfaceorg.springframework.context.SmartLifecycle
-
stop
- Specified by:
stopin interfaceorg.springframework.context.SmartLifecycle
-
isRunning
public boolean isRunning()- Specified by:
isRunningin interfaceorg.springframework.context.Lifecycle
-
getPhase
public int getPhase()- Specified by:
getPhasein interfaceorg.springframework.context.Phased- Specified by:
getPhasein interfaceorg.springframework.context.SmartLifecycle
-
setBeanFactory
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) throws org.springframework.beans.BeansException - Specified by:
setBeanFactoryin interfaceorg.springframework.beans.factory.BeanFactoryAware- Throws:
org.springframework.beans.BeansException
-
start
Description copied from interface:RetryClusterServiceStart the cluster service with a list of consumers for retry handler status events- Specified by:
startin interfaceRetryClusterService- Parameters:
consumers- consumers for retry handler status events. May be null.
-
start
public void start()Description copied from interface:RetryClusterServiceStart the node as a leader in the cluster.- Specified by:
startin interfaceorg.springframework.context.Lifecycle- Specified by:
startin interfaceRetryClusterService
-
isStarted
public boolean isStarted()Description copied from interface:RetryClusterServiceWhether a node on the cluster has already been started as a leader.- Specified by:
isStartedin interfaceRetryClusterService- Returns:
- Whether a node on the cluster has already been started as a leader.
-
stop
public void stop()Description copied from interface:RetryClusterServiceStop the node as a leader in the cluster.- Specified by:
stopin interfaceorg.springframework.context.Lifecycle- Specified by:
stopin interfaceRetryClusterService
-
buildRetryHandler
-