GigaSpaces XAP 8.0 API
Class AbstractTemplateEventListenerContainer

  extended by
      extended by
          extended by
All Implemented Interfaces:
EventListener, ServiceDetailsProvider, ServiceMonitorsProvider, BeanNameAware, DisposableBean, InitializingBean, ApplicationContextAware, ApplicationListener<ApplicationEvent>, Lifecycle
Direct Known Subclasses:

public abstract class AbstractTemplateEventListenerContainer
extends AbstractEventListenerContainer

A simple base class that provides support methods for Template based event listeners.

There are several ways a template can be provided. The first is by explicitly setting it using setTemplate(Object). The second option is for the event listener to implement an interface called EventTemplateProvider. The last option is to annotate a method within the event listener that will return the actual template using EventTemplate annotation.


Field Summary
Fields inherited from class
exceptionHandler, failedEvents, processedEvents
Fields inherited from class
beanName, logger
Constructor Summary
Method Summary
 void afterPropertiesSet()
          Delegates to AbstractSpaceListeningContainer.validateConfiguration() and AbstractSpaceListeningContainer.initialize().
protected  Object getReceiveTemplate()
          Returns the template to be used for receive operations.
protected  Object getTemplate()
          Returns the template that will be used.
 void initialize()
          Initialize this container.
protected  boolean isPerformSnapshot()
 void setPerformSnapshot(boolean performSnapshot)
          If set to true will perform snapshot operation on the provided template before invoking registering as an event listener.
 void setTemplate(Object template)
          Sets the specified template to be used with the polling space operation.
Methods inherited from class
doStart, executeListener, getActualEventListener, getApplicationContext, getEventListener, getEventListenerClass, getExceptionHandler, getFailedEvents, getProcessedEvents, handleListenerException, invokeExceptionListener, invokeListener, setApplicationContext, setEventListener, setEventListenerRef, setExceptionHandler
Methods inherited from class
destroy, doAfterStart, doBeforeStop, doInitialize, doRescheduleTask, doShutdown, doStop, getBeanName, getGigaSpace, getStatus, isActive, isRunning, message, onApplicationEvent, rescheduleTaskIfNecessary, setActiveWhenPrimary, setAutoStart, setBeanName, setGigaSpace, setRegisterSpaceModeListener, shutdown, start, stop, validateConfiguration, waitWhileNotRunning
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.openspaces.pu.service.ServiceDetailsProvider
Methods inherited from interface org.openspaces.pu.service.ServiceMonitorsProvider

Constructor Detail


public AbstractTemplateEventListenerContainer()
Method Detail


public void afterPropertiesSet()
Description copied from class: AbstractSpaceListeningContainer
Delegates to AbstractSpaceListeningContainer.validateConfiguration() and AbstractSpaceListeningContainer.initialize().

Specified by:
afterPropertiesSet in interface InitializingBean
afterPropertiesSet in class AbstractSpaceListeningContainer


public void initialize()
                throws DataAccessException
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.

initialize in class AbstractEventListenerContainer
See Also:


public void setTemplate(Object template)
Sets the specified template to be used with the polling space operation.

See Also:


protected Object getTemplate()
Returns the template that will be used. Note, in order to perform receive operations, the getReceiveTemplate() should be used.


protected Object getReceiveTemplate()
Returns the template to be used for receive operations. If setPerformSnapshot(boolean) is set to true (the default) will return the snapshot of the provided template.


public void setPerformSnapshot(boolean performSnapshot)
If set to true will perform snapshot operation on the provided template before invoking registering as an event listener.

See Also:


protected boolean isPerformSnapshot()

GigaSpaces XAP 8.0 API

Copyright © GigaSpaces.