Class ContinuousQueryMessageProducer
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.endpoint.AbstractEndpoint
org.springframework.integration.endpoint.MessageProducerSupport
org.springframework.integration.endpoint.ExpressionMessageProducerSupport
org.springframework.integration.gemfire.inbound.ContinuousQueryMessageProducer
- All Implemented Interfaces:
Aware
,BeanFactoryAware
,BeanNameAware
,DisposableBean
,InitializingBean
,SmartInitializingSingleton
,ApplicationContextAware
,Lifecycle
,Phased
,SmartLifecycle
,ContinuousQueryListener
,ExpressionCapable
,MessageProducer
,IntegrationPattern
,NamedComponent
,ManageableLifecycle
,ManageableSmartLifecycle
,TrackableComponent
public class ContinuousQueryMessageProducer extends ExpressionMessageProducerSupport implements 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, Artem Bilan
-
Field Summary
Fields inherited from class org.springframework.integration.endpoint.AbstractEndpoint
lifecycleCondition, lifecycleLock
Fields inherited from class org.springframework.integration.context.IntegrationObjectSupport
EXPRESSION_PARSER
-
Constructor Summary
Constructors Constructor Description ContinuousQueryMessageProducer(ContinuousQueryListenerContainer queryListenerContainer, String query)
-
Method Summary
Modifier and Type Method Description String
getComponentType()
Subclasses may implement this method to provide component type information.void
onEvent(org.apache.geode.cache.query.CqEvent event)
protected void
onInit()
Subclasses may implement this for initialization logic.void
setDurable(boolean durable)
void
setQueryName(String queryName)
void
setSupportedEventTypes(CqEventType... eventTypes)
Methods inherited from class org.springframework.integration.endpoint.ExpressionMessageProducerSupport
evaluatePayloadExpression, setIntegrationEvaluationContext, setPayloadExpression, setPayloadExpressionString
Methods inherited from class org.springframework.integration.endpoint.MessageProducerSupport
afterSingletonsInstantiated, buildErrorMessage, doStart, doStop, getErrorChannel, getErrorMessageAttributes, getIntegrationPatternType, getMessagingTemplate, getOutputChannel, sendErrorMessageIfNecessary, sendMessage, setErrorChannel, setErrorChannelName, setErrorMessageStrategy, setOutputChannel, setOutputChannelName, setSendTimeout, setShouldTrack, subscribeToPublisher
Methods inherited from class org.springframework.integration.endpoint.AbstractEndpoint
destroy, doStop, getPhase, getRole, isActive, isAutoStartup, isRunning, setAutoStartup, setPhase, setRole, start, stop, stop
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, 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.support.context.NamedComponent
getBeanName, getComponentName
-
Constructor Details
-
ContinuousQueryMessageProducer
public ContinuousQueryMessageProducer(ContinuousQueryListenerContainer queryListenerContainer, String query)- Parameters:
queryListenerContainer
- aContinuousQueryListenerContainer
query
- the query string
-
-
Method Details
-
setQueryName
- Parameters:
queryName
- optional query name
-
setDurable
public void setDurable(boolean durable)- Parameters:
durable
- true if the query is a durable subscription
-
setSupportedEventTypes
-
getComponentType
Description copied from class:IntegrationObjectSupport
Subclasses may implement this method to provide component type information.- Specified by:
getComponentType
in interfaceNamedComponent
- Overrides:
getComponentType
in classIntegrationObjectSupport
-
onInit
protected void onInit()Description copied from class:IntegrationObjectSupport
Subclasses may implement this for initialization logic.- Overrides:
onInit
in classExpressionMessageProducerSupport
-
onEvent
public void onEvent(org.apache.geode.cache.query.CqEvent event)- Specified by:
onEvent
in interfaceContinuousQueryListener
-