GigaSpaces XAP 10.0.1 API

org.openspaces.archive
Class ArchivePollingContainer

java.lang.Object
  extended by org.openspaces.events.AbstractSpaceListeningContainer
      extended by org.openspaces.events.AbstractEventListenerContainer
          extended by org.openspaces.events.AbstractTemplateEventListenerContainer
              extended by org.openspaces.events.AbstractTransactionalEventListenerContainer
                  extended by org.openspaces.events.polling.AbstractPollingEventListenerContainer
                      extended by org.openspaces.events.polling.SimplePollingEventListenerContainer
                          extended by org.openspaces.archive.ArchivePollingContainer
All Implemented Interfaces:
com.gigaspaces.internal.dump.InternalDumpProcessor, EventListener, SpaceDataEventListener<Object>, ServiceDetailsProvider, ServiceMonitorsProvider, Aware, BeanNameAware, DisposableBean, InitializingBean, ApplicationContextAware, ApplicationListener<ApplicationEvent>, 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

Field Summary
 
Fields inherited from class org.openspaces.events.polling.SimplePollingEventListenerContainer
DEFAULT_RECOVERY_INTERVAL, DEFAULT_THREAD_NAME_PREFIX
 
Fields inherited from class org.openspaces.events.polling.AbstractPollingEventListenerContainer
DEFAULT_RECEIVE_TIMEOUT
 
Fields inherited from class org.openspaces.events.AbstractTransactionalEventListenerContainer
disableTransactionValidation
 
Fields inherited from class org.openspaces.events.AbstractEventListenerContainer
exceptionHandler, failedEvents, processedEvents
 
Fields inherited from class org.openspaces.events.AbstractSpaceListeningContainer
beanName, logger
 
Constructor Summary
ArchivePollingContainer()
           
 
Method Summary
 int getBatchSize()
           
 long getNonBlockingSleep()
           
 void initialize()
          Initialize this container.
 boolean isUseFifoGrouping()
           
 void onEvent(Object data, GigaSpace gigaSpace, TransactionStatus txStatus, Object source)
          An event callback with the actual data object of the event.
 void setArchiveHandler(ArchiveOperationHandler archiveHandler)
           
 void setBatchSize(int batchSize)
           
 void setNonBlockingSleep(long nonBlockingSleepMilliseconds)
          In case the space is a proxy to a remote clustered space we use non-blocking take operation for polling.
 void setUseFifoGrouping(boolean useFifoGrouping)
          Enables take operations that are performed with FIFO Grouping enabled
protected  void validateConfiguration()
          Validate the configuration of this container.
 
Methods inherited from class org.openspaces.events.polling.SimplePollingEventListenerContainer
createDefaultTaskExecutor, doAfterStart, doBeforeStop, doInitialize, doRescheduleTask, doShutdown, eventReceived, getActiveConsumerCount, getConcurrentConsumers, getIdleTaskExecutionLimit, getMaxConcurrentConsumers, getMaxEventsPerTask, getName, getScheduledConsumerCount, getServicesDetails, getServicesMonitors, handleListenerSetupFailure, process, recoverAfterListenerSetupFailure, refreshConnectionUntilSuccessful, scheduleNewInvokerIfAppropriate, setConcurrentConsumers, setIdleTaskExecutionLimit, setMaxConcurrentConsumers, setMaxEventsPerTask, setRecoveryInterval, setTaskExecutor, sleepInbetweenRecoveryAttempts
 
Methods inherited from class org.openspaces.events.polling.AbstractPollingEventListenerContainer
doReceiveAndExecute, getReceiveOperationHandler, getReceiveTimeout, getTriggerOperationHandler, isPassArrayAsIs, receiveAndExecute, receiveEvent, setPassArrayAsIs, setReceiveOperationHandler, setReceiveTimeout, setTriggerOperationHandler
 
Methods inherited from class org.openspaces.events.AbstractTransactionalEventListenerContainer
getTransactionDefinition, getTransactionManager, getTransactionManagerName, isTransactional, setDisableTransactionValidation, setTransactionIsolationLevel, setTransactionIsolationLevelName, setTransactionManager, setTransactionName, setTransactionTimeout
 
Methods inherited from class org.openspaces.events.AbstractTemplateEventListenerContainer
getReceiveTemplate, getTemplate, isDynamicTemplate, isPerformSnapshot, setDynamicTemplate, setPerformSnapshot, setTemplate
 
Methods inherited from class org.openspaces.events.AbstractEventListenerContainer
doStart, executeListener, getActualEventListener, getApplicationContext, getEventListener, getEventListenerClass, getExceptionHandler, getFailedEvents, getProcessedEvents, handleListenerException, invokeExceptionListener, invokeListener, setApplicationContext, setEventListener, setEventListenerRef, setExceptionHandler
 
Methods inherited from class org.openspaces.events.AbstractSpaceListeningContainer
afterPropertiesSet, destroy, doStop, getBeanName, getGigaSpace, getStatus, isActive, isRunning, message, onApplicationEvent, rescheduleTaskIfNecessary, setActiveWhenPrimary, setAutoStart, setBeanName, setGigaSpace, setRegisterSpaceModeListener, shutdown, start, stop, waitWhileNotRunning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArchivePollingContainer

public ArchivePollingContainer()
Method Detail

setArchiveHandler

public void setArchiveHandler(ArchiveOperationHandler archiveHandler)

validateConfiguration

protected void validateConfiguration()
Description copied from class: AbstractSpaceListeningContainer
Validate the configuration of this container.

Overrides:
validateConfiguration in class AbstractPollingEventListenerContainer

initialize

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

Overrides:
initialize in class SimplePollingEventListenerContainer
See Also:
AbstractSpaceListeningContainer.onApplicationEvent(org.springframework.context.ApplicationEvent)

onEvent

public void onEvent(Object data,
                    GigaSpace gigaSpace,
                    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#supportsAtomicBatchArchiving()

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


GigaSpaces XAP 10.0.1 API

Copyright © GigaSpaces.