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 RetryHandler
buildRetryHandler(NotificationStateRepository repository)
int
getPhase()
boolean
isAutoStartup()
boolean
isRunning()
boolean
isStarted()
Whether a node on the cluster has already been started as a leader.void
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
void
start()
Start the node as a leader in the cluster.void
stop()
Stop the node as a leader in the cluster.void
stop(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:
isAutoStartup
in interfaceorg.springframework.context.SmartLifecycle
-
stop
public void stop(Runnable callback)
- Specified by:
stop
in interfaceorg.springframework.context.SmartLifecycle
-
isRunning
public boolean isRunning()
- Specified by:
isRunning
in interfaceorg.springframework.context.Lifecycle
-
getPhase
public int getPhase()
- Specified by:
getPhase
in interfaceorg.springframework.context.Phased
- Specified by:
getPhase
in interfaceorg.springframework.context.SmartLifecycle
-
setBeanFactory
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) throws org.springframework.beans.BeansException
- Specified by:
setBeanFactory
in interfaceorg.springframework.beans.factory.BeanFactoryAware
- Throws:
org.springframework.beans.BeansException
-
start
public void start()
Description copied from interface:RetryClusterService
Start the node as a leader in the cluster.- Specified by:
start
in interfaceorg.springframework.context.Lifecycle
- Specified by:
start
in interfaceRetryClusterService
-
isStarted
public boolean isStarted()
Description copied from interface:RetryClusterService
Whether a node on the cluster has already been started as a leader.- Specified by:
isStarted
in interfaceRetryClusterService
- Returns:
- Whether a node on the cluster has already been started as a leader.
-
stop
public void stop()
Description copied from interface:RetryClusterService
Stop the node as a leader in the cluster.- Specified by:
stop
in interfaceorg.springframework.context.Lifecycle
- Specified by:
stop
in interfaceRetryClusterService
-
buildRetryHandler
protected RetryHandler buildRetryHandler(NotificationStateRepository repository)
-
-