Package org.openspaces.archive
Class ArchivePollingContainer
java.lang.Object
com.gigaspaces.internal.server.space.polling.PollingAncestor
org.openspaces.events.AbstractEventListenerContainer
org.openspaces.events.polling.SimplePollingEventListenerContainer
org.openspaces.archive.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
-
Field Summary
Fields inherited from class org.openspaces.events.polling.SimplePollingEventListenerContainer
DEFAULT_KEEP_ALIVE_RETRIES, DEFAULT_RECEIVE_TIMEOUT, DEFAULT_RECOVERY_INTERVAL, DEFAULT_THREAD_NAME_PREFIXFields inherited from class org.openspaces.events.AbstractEventListenerContainer
beanName, disableTransactionValidation, exceptionHandler, logger, snapshotTemplateThreadLocal -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintlongvoidInitialize this container.booleanvoidonEvent(Object data, GigaSpace gigaSpace, org.springframework.transaction.TransactionStatus txStatus, Object source) An event callback with the actual data object of the event.voidsetArchiveHandler(ArchiveOperationHandler archiveHandler) voidsetBatchSize(int batchSize) voidsetNonBlockingSleep(long nonBlockingSleepMilliseconds) In case the space is a proxy to a remote clustered space we use non-blocking take operation for polling.voidsetUseFifoGrouping(boolean useFifoGrouping) Enables take operations that are performed with FIFO Grouping enabledprotected voidValidate the configuration of this container.Methods inherited from class org.openspaces.events.polling.SimplePollingEventListenerContainer
createDefaultTaskExecutor, doAfterStart, doBeforeStop, doInitialize, doReceiveAndExecute, doRescheduleTask, doShutdown, dump, eventReceived, getActiveConsumerCount, getConcurrentConsumers, getEventListenerContainerType, getIdleTaskExecutionLimit, getKeepAliveRetries, getMaxConcurrentConsumers, getMaxEventsPerTask, getName, getReceiveOperationHandler, getReceiveTimeout, getScheduledConsumerCount, getServicesDetails, getServicesMonitors, getTriggerOperationHandler, handleListenerSetupFailure, isPassArrayAsIs, receiveAndExecute, receiveEvent, recoverAfterListenerSetupFailure, refreshConnectionUntilSuccessful, scheduleNewInvokerIfAppropriate, setConcurrentConsumers, setIdleTaskExecutionLimit, setKeepAliveRetries, setMaxConcurrentConsumers, setMaxEventsPerTask, setPassArrayAsIs, setReceiveOperationHandler, setReceiveTimeout, setRecoveryInterval, setTaskExecutor, setTriggerOperationHandler, sleepInbetweenRecoveryAttemptsMethods inherited from class org.openspaces.events.AbstractEventListenerContainer
afterPropertiesSet, destroy, doStart, doStop, executeListener, getActualEventListener, getApplicationContext, getBeanName, getEventListener, getEventListenerClass, getExceptionHandler, getFailedEvents, getGigaSpace, getProcessedEvents, getReceiveTemplate, getStatus, getTemplate, getTransactionDefinition, getTransactionManager, getTransactionManagerName, handleListenerException, incrementFailedEvents, invokeExceptionListener, invokeListener, isActive, isDynamicTemplate, isPerformSnapshot, isRunning, isTransactional, message, onApplicationEvent, process, registerMetrics, requiresStopStart, rescheduleTaskIfNecessary, setActiveWhenPrimary, setApplicationContext, setAutoStart, setBeanName, setDisableTransactionValidation, setDynamicTemplate, setEventListener, setEventListenerRef, setExceptionHandler, setGigaSpace, setPerformSnapshot, setProcessingUnitContainerContext, setRegisterSpaceModeListener, setTemplate, setTransactionIsolationLevel, setTransactionIsolationLevelName, setTransactionManager, setTransactionName, setTransactionTimeout, shutdown, spacename, start, stop, unregisterMetrics, waitWhileNotRunningMethods inherited from class com.gigaspaces.internal.server.space.polling.PollingAncestor
destroyRegistryMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.ApplicationListener
supportsAsyncExecutionMethods inherited from interface com.gigaspaces.internal.dump.InternalDumpProcessor
getDumpFileReportLocation, setDumpFileReportLocation
-
Constructor Details
-
ArchivePollingContainer
public ArchivePollingContainer()
-
-
Method Details
-
setArchiveHandler
-
validateConfiguration
protected void validateConfiguration()Description copied from class:AbstractEventListenerContainerValidate the configuration of this container.- Overrides:
validateConfigurationin classSimplePollingEventListenerContainer
-
initialize
public void initialize()Description copied from class:AbstractEventListenerContainerInitialize this container. If this container is not configured with "activeWhenPrimary" flag set totruewill callAbstractEventListenerContainer.doStart()(if it is set totrue, lifecycle of the container will be controlled by the current space mode).AbstractEventListenerContainer.doInitialize()will be called for additional initialization after the possibleAbstractEventListenerContainer.doStart()call. -
onEvent
public void onEvent(Object data, GigaSpace gigaSpace, org.springframework.transaction.TransactionStatus txStatus, Object source) Description copied from interface:SpaceDataEventListenerAn event callback with the actual data object of the event.- Specified by:
onEventin interfaceSpaceDataEventListener<Object>- Parameters:
data- The actual data object of the eventgigaSpace- A GigaSpace instance that can be used to perform additional operations against the spacetxStatus- An optional transaction status allowing to rollback a transaction programmaticallysource- 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 handlerArchiveOperationHandler.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
-