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 Details

    • DefaultProcessStateService

      public DefaultProcessStateService()
  • Method Details

    • publishEvent

      public void publishEvent(SearchIndexProcessEvent event)
      Description copied from interface: EventPublisher
      Lightweight 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:
      publishEvent in interface EventPublisher
      Parameters:
      event - the event to publish
    • isDistributed

      public final boolean isDistributed()
      Description copied from interface: Distributable
      Indicates if this component is designed for use across JVMs.
      Specified by:
      isDistributed in interface Distributable
      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: ProcessStateService
      Returns the number of cluster members that may be working together to process data. If Distributable.isDistributed() is false, then this should ALWAYS return 1.
      Specified by:
      getClusterMemberCount in interface ProcessStateService
      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:
      setApplicationContext in interface org.springframework.context.ApplicationContextAware