GigaSpaces XAP 7.0 API

org.openspaces.events.notify
Class SimpleNotifyEventListenerContainer

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.notify.AbstractNotifyEventListenerContainer
                      extended by org.openspaces.events.notify.SimpleNotifyEventListenerContainer
All Implemented Interfaces:
EventListener, ServiceDetailsProvider, ServiceMonitorsProvider, BeanNameAware, DisposableBean, InitializingBean, ApplicationContextAware, ApplicationListener, Lifecycle

public class SimpleNotifyEventListenerContainer
extends AbstractNotifyEventListenerContainer

A simple notification based container allowing to register a SpaceDataEventListener that will be triggered by notifications. Uses AbstractNotifyEventListenerContainer for configuration of different notification registration parameters and transactional semantics.

The container can automatically take the notified event data (using GigaSpace.take(Object)) if the setPerformTakeOnNotify(boolean) is set to true. Defaults to false. If the flag is set to true, setIgnoreEventOnNullTake(boolean) can control of the event will be propagated to the event listener if the take operation returned null.

Author:
kimchy

Field Summary
 
Fields inherited from class org.openspaces.events.notify.AbstractNotifyEventListenerContainer
COM_TYPE_MULTICAST, COM_TYPE_MULTIPLEX, COM_TYPE_PREFIX, COM_TYPE_UNICAST
 
Fields inherited from class org.openspaces.events.AbstractEventListenerContainer
failedEvents, processedEvents
 
Fields inherited from class org.openspaces.events.AbstractSpaceListeningContainer
beanName, logger
 
Constructor Summary
SimpleNotifyEventListenerContainer()
           
 
Method Summary
protected  void closeSession()
           
protected  void doAfterStart()
           
protected  void doBeforeStop()
           
protected  void doInitialize()
          A callback to perform custom initialization steps.
protected  void doShutdown()
          Perform any custom shutdown operations.
 ServiceDetails[] getServicesDetails()
          Retruns one or more service details that the service exposes.
 ServiceMonitors[] getServicesMonitors()
          Retruns one or more service details that the service exposes.
protected  void registerListener()
           
 void setIgnoreEventOnNullTake(boolean ignoreEventOnNullTake)
          If set to true, will not propagate the event if the take operation returned null.
 void setPerformTakeOnNotify(boolean performTakeOnNotify)
          If set to true will remove the event from the space using take operation.
 
Methods inherited from class org.openspaces.events.notify.AbstractNotifyEventListenerContainer
createDataEventSession, createEventSessionConfig, createEventSessionFactory, getBatchSize, getBatchTime, getCommType, getNotifyLeaseExpire, getNotifyTake, getNotifyUnmatched, getNotifyUpdate, getNotifyWrite, getRenewDuration, getRenewExpiration, getRenewRTT, initialize, invokeListenerWithTransaction, invokeListenerWithTransaction, isAutoRenew, isBatchEnabled, isFifo, isGuaranteed, isNotifyAll, isNotifyLeaseExpire, isNotifyTake, isNotifyUnmatched, isNotifyUpdate, isNotifyWrite, isPassArrayAsIs, isReplicateNotifyTemplate, isTriggerNotifyTemplate, registerListener, setAutoRenew, setBatchSize, setBatchTime, setComType, setComTypeName, setFifo, setGuaranteed, setLeaseListener, setListenerLease, setNotifyAll, setNotifyFilter, setNotifyLeaseExpire, setNotifyTake, setNotifyUnmatched, setNotifyUpdate, setNotifyWrite, setPassArrayAsIs, setRenewDuration, setRenewExpiration, setRenewRTT, setReplicateNotifyTemplate, setTriggerNotifyTemplate, validateConfiguration
 
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
afterPropertiesSet, getReceiveTemplate, getTemplate, isPerformSnapshot, setPerformSnapshot, setTemplate
 
Methods inherited from class org.openspaces.events.AbstractEventListenerContainer
doStart, executeListener, getActualEventListener, getApplicationContext, getEventListener, getEventListenerClass, getFailedEvents, getProcessedEvents, handleListenerException, invokeExceptionListener, invokeListener, setApplicationContext, setEventListener, setEventListenerRef
 
Methods inherited from class org.openspaces.events.AbstractSpaceListeningContainer
destroy, doRescheduleTask, 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

SimpleNotifyEventListenerContainer

public SimpleNotifyEventListenerContainer()
Method Detail

setPerformTakeOnNotify

public void setPerformTakeOnNotify(boolean performTakeOnNotify)
If set to true will remove the event from the space using take operation. Default is false.


setIgnoreEventOnNullTake

public void setIgnoreEventOnNullTake(boolean ignoreEventOnNullTake)
If set to true, will not propagate the event if the take operation returned null. This flag only makes sense when setPerformTakeOnNotify(boolean) is set to true. Defaults to false.


doInitialize

protected void doInitialize()
                     throws DataAccessException
Description copied from class: AbstractSpaceListeningContainer
A callback to perform custom initialization steps.

Specified by:
doInitialize in class AbstractSpaceListeningContainer
Throws:
DataAccessException

doShutdown

protected void doShutdown()
                   throws DataAccessException
Description copied from class: AbstractSpaceListeningContainer
Perform any custom shutdown operations.

Specified by:
doShutdown in class AbstractSpaceListeningContainer
Throws:
DataAccessException
See Also:
AbstractSpaceListeningContainer.shutdown()

doAfterStart

protected void doAfterStart()
                     throws DataAccessException
Overrides:
doAfterStart in class AbstractSpaceListeningContainer
Throws:
DataAccessException

doBeforeStop

protected void doBeforeStop()
                     throws DataAccessException
Overrides:
doBeforeStop in class AbstractSpaceListeningContainer
Throws:
DataAccessException

registerListener

protected void registerListener()
                         throws DataAccessException
Throws:
DataAccessException

closeSession

protected void closeSession()

getServicesDetails

public ServiceDetails[] getServicesDetails()
Description copied from interface: ServiceDetailsProvider
Retruns one or more service details that the service exposes.


getServicesMonitors

public ServiceMonitors[] getServicesMonitors()
Description copied from interface: ServiceMonitorsProvider
Retruns one or more service details that the service exposes.


GigaSpaces XAP 7.0 API

Copyright © GigaSpaces.