Spring Integration

org.springframework.integration.gemfire.inbound
Class ContinuousQueryMessageProducer

java.lang.Object
  extended by org.springframework.integration.context.IntegrationObjectSupport
      extended by org.springframework.integration.endpoint.AbstractEndpoint
          extended by org.springframework.integration.endpoint.MessageProducerSupport
              extended by org.springframework.integration.gemfire.inbound.ContinuousQueryMessageProducer
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean, org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle, org.springframework.data.gemfire.listener.ContinuousQueryListener, NamedComponent, MessageProducer, TrackableComponent

public class ContinuousQueryMessageProducer
extends MessageProducerSupport
implements org.springframework.data.gemfire.listener.ContinuousQueryListener

Responds to a Gemfire continuous query (set using the #query field) that is constantly evaluated against a cache Region. This is much faster than re-querying the cache manually.

Since:
2.1
Author:
Josh Long, David Turanski

Constructor Summary
ContinuousQueryMessageProducer(org.springframework.data.gemfire.listener.ContinuousQueryListenerContainer queryListenerContainer, java.lang.String query)
           
 
Method Summary
protected  java.lang.Object evaluationResult(java.lang.Object payload)
           
 void onEvent(com.gemstone.gemfire.cache.query.CqEvent event)
           
protected  void onInit()
          Subclasses may implement this for initialization logic.
 void setDurable(boolean durable)
           
 void setPayloadExpression(java.lang.String payloadExpression)
           
 void setQueryName(java.lang.String queryName)
           
 void setSupportedEventTypes(CqEventType... eventTypes)
           
 
Methods inherited from class org.springframework.integration.endpoint.MessageProducerSupport
doStart, doStop, sendMessage, setErrorChannel, setOutputChannel, setSendTimeout, setShouldTrack
 
Methods inherited from class org.springframework.integration.endpoint.AbstractEndpoint
getPhase, isAutoStartup, isRunning, setAutoStartup, setPhase, setTaskScheduler, start, stop, stop
 
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport
afterPropertiesSet, getBeanFactory, getComponentName, getComponentType, getConversionService, getTaskScheduler, setBeanFactory, setBeanName, setComponentName, setConversionService, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.springframework.integration.context.NamedComponent
getComponentName, getComponentType
 

Constructor Detail

ContinuousQueryMessageProducer

public ContinuousQueryMessageProducer(org.springframework.data.gemfire.listener.ContinuousQueryListenerContainer queryListenerContainer,
                                      java.lang.String query)
Parameters:
queryListenerContainer - a ContinuousQueryListenerContainer
query - the query string
Method Detail

setQueryName

public void setQueryName(java.lang.String queryName)
Parameters:
queryName - optional query name

setDurable

public void setDurable(boolean durable)
Parameters:
durable - true if the query is a durable subscription

setSupportedEventTypes

public void setSupportedEventTypes(CqEventType... eventTypes)

onInit

protected void onInit()
Description copied from class: IntegrationObjectSupport
Subclasses may implement this for initialization logic.


onEvent

public void onEvent(com.gemstone.gemfire.cache.query.CqEvent event)
Specified by:
onEvent in interface org.springframework.data.gemfire.listener.ContinuousQueryListener

setPayloadExpression

public void setPayloadExpression(java.lang.String payloadExpression)

evaluationResult

protected java.lang.Object evaluationResult(java.lang.Object payload)

Spring Integration