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
-
-
Constructor Summary
Constructors Constructor Description DefaultRetryClusterService(List<NotificationStateRepository> repositories, NotificationHandler notificationHandler, DurableNotificationProperties properties, String messageType, List<IgnoredNotificationStateRepository> ignoredRepositories, com.broadleafcommerce.common.extension.data.DataRouteReference reference)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected RetryHandlerbuildRetryHandler(NotificationStateRepository repository)intgetPhase()booleanisAutoStartup()booleanisRunning()booleanisStarted()Whether 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.voidstop()Stop the node as a leader in the cluster.voidstop(Runnable callback)
-
-
-
Constructor Detail
-
DefaultRetryClusterService
public DefaultRetryClusterService(List<NotificationStateRepository> repositories, NotificationHandler notificationHandler, DurableNotificationProperties properties, String messageType, List<IgnoredNotificationStateRepository> ignoredRepositories, com.broadleafcommerce.common.extension.data.DataRouteReference reference)
-
-
Method Detail
-
isAutoStartup
public boolean isAutoStartup()
- Specified by:
isAutoStartupin interfaceorg.springframework.context.SmartLifecycle
-
stop
public void stop(Runnable callback)
- 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
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
protected RetryHandler buildRetryHandler(NotificationStateRepository repository)
-
-