Class DefaultProcessStateService
java.lang.Object
com.broadleafcommerce.search.index.core.AbstractProcessStateService
com.broadleafcommerce.search.index.core.DefaultProcessStateService
- All Implemented Interfaces:
Distributable,EventPublisher,ProcessStateService,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware
public class DefaultProcessStateService
extends AbstractProcessStateService
implements org.springframework.context.ApplicationContextAware
Default implementation of the ProcessStateService interface. This component is for use within a
single JVM and assumes that the Spring ApplicationContext is configured to raise synchronous,
in-VM events.
- Author:
- Kelly Tisdell (ktisdell)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal intgetClusterMemberCount(com.broadleafcommerce.search.api.type.IndexableType type) Returns the number of cluster members that may be working together to process data.final booleanIndicates if this component is designed for use across JVMs.voidLightweight interface to publish an event.voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) Methods inherited from class com.broadleafcommerce.search.index.core.AbstractProcessStateService
endProcessState, failFast, failFast, failFast, getCorrelationId, getCurrentProcessStateHolder, getInstance, isFailed, isMaster, isProcessStateEnabled, startProcessState
-
Constructor Details
-
DefaultProcessStateService
public DefaultProcessStateService()
-
-
Method Details
-
publishEvent
Description copied from interface:EventPublisherLightweight interface to publish an event. This component will delegate directly to Spring if it's not distributable. Otherwise, it will publish to whatever distributed event system is available (e.g. Kafka, JMS, RabbitMQ, Ignite Events, etc.) In the case of distributed events, the system should delegate to Spring on arrival of the event.- Specified by:
publishEventin interfaceEventPublisher- Parameters:
event- the event to publish
-
isDistributed
public final boolean isDistributed()Description copied from interface:DistributableIndicates if this component is designed for use across JVMs.- Specified by:
isDistributedin interfaceDistributable- Returns:
- whether this component can be distributed across JVMs
-
getClusterMemberCount
public final int getClusterMemberCount(com.broadleafcommerce.search.api.type.IndexableType type) Description copied from interface:ProcessStateServiceReturns the number of cluster members that may be working together to process data. IfDistributable.isDistributed()is false, then this should ALWAYS return 1.- Specified by:
getClusterMemberCountin interfaceProcessStateService- Parameters:
type- the indexable type for which to get the cluster member count- Returns:
- the number of cluster members that may be working together to process data
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) - Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware
-