Class ArchivePollingContainer

All Implemented Interfaces:
InternalDumpProcessor, EventListener, SpaceDataEventListener<Object>, ProcessingUnitContainerContextAware, ServiceDetailsProvider, ServiceMonitorsProvider, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener<org.springframework.context.ApplicationEvent>, org.springframework.context.Lifecycle

public class ArchivePollingContainer extends SimplePollingEventListenerContainer implements SpaceDataEventListener<Object>
Takes objects specified in the template into the archive handler defined by setArchiveHandler(ArchiveOperationHandler) This container can be used to take (remove) objects from the Space and persist them into an external service.
Since:
9.1.1
Author:
Itai Frenkel
  • Constructor Details

    • ArchivePollingContainer

      public ArchivePollingContainer()
  • Method Details

    • setArchiveHandler

      public void setArchiveHandler(ArchiveOperationHandler archiveHandler)
    • validateConfiguration

      protected void validateConfiguration()
      Description copied from class: AbstractEventListenerContainer
      Validate the configuration of this container.
      Overrides:
      validateConfiguration in class SimplePollingEventListenerContainer
    • initialize

      public void initialize()
      Description copied from class: AbstractEventListenerContainer
      Initialize this container. If this container is not configured with "activeWhenPrimary" flag set to true will call AbstractEventListenerContainer.doStart() (if it is set to true, lifecycle of the container will be controlled by the current space mode). AbstractEventListenerContainer.doInitialize() will be called for additional initialization after the possible AbstractEventListenerContainer.doStart() call.
      Overrides:
      initialize in class SimplePollingEventListenerContainer
      See Also:
    • onEvent

      public void onEvent(Object data, GigaSpace gigaSpace, org.springframework.transaction.TransactionStatus txStatus, Object source)
      Description copied from interface: SpaceDataEventListener
      An event callback with the actual data object of the event.
      Specified by:
      onEvent in interface SpaceDataEventListener<Object>
      Parameters:
      data - The actual data object of the event
      gigaSpace - A GigaSpace instance that can be used to perform additional operations against the space
      txStatus - An optional transaction status allowing to rollback a transaction programmatically
      source - Optional additional data or the actual source event data object (where relevant)
    • setBatchSize

      public void setBatchSize(int batchSize)
      Parameters:
      batchSize - - The maximum number of objects to hand over to the archiver in one method call. This parameter has affect only if the archive handler ArchiveOperationHandler.supportsBatchArchiving()
    • getBatchSize

      public int getBatchSize()
    • getNonBlockingSleep

      public long getNonBlockingSleep()
    • setNonBlockingSleep

      public void setNonBlockingSleep(long nonBlockingSleepMilliseconds)
      In case the space is a proxy to a remote clustered space we use non-blocking take operation for polling. If the take returned without any object the thread sleeps for 100 milliseconds. Use this method to set the sleep timeout to a different value.
      Parameters:
      nonBlockingSleepMilliseconds - - the time to sleep if take returned no values (milliseconds)
    • isUseFifoGrouping

      public boolean isUseFifoGrouping()
    • setUseFifoGrouping

      public void setUseFifoGrouping(boolean useFifoGrouping)
      Enables take operations that are performed with FIFO Grouping enabled