|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.data.gemfire.listener.ContinuousQueryListenerContainer
public class ContinuousQueryListenerContainer
Container providing asynchronous behaviour for GemFire continuous queries.
Field Summary | |
---|---|
static String |
DEFAULT_THREAD_NAME_PREFIX
Default thread name prefix: "ContinousQueryListenerContainer-". |
protected org.apache.commons.logging.Log |
logger
Logger available to subclasses |
Constructor Summary | |
---|---|
ContinuousQueryListenerContainer()
|
Method Summary | |
---|---|
void |
addListener(ContinuousQueryDefinition cqQuery)
Adds a query definition to the (potentially running) container. |
void |
afterPropertiesSet()
|
protected TaskExecutor |
createDefaultTaskExecutor()
Creates a default TaskExecutor. |
void |
destroy()
|
protected void |
executeListener(ContinuousQueryListener listener,
com.gemstone.gemfire.cache.query.CqEvent event)
Execute the specified listener. |
int |
getPhase()
|
protected void |
handleListenerException(Throwable ex)
Handle the given exception that arose during listener execution. |
protected void |
invokeErrorHandler(Throwable ex)
Invoke the registered ErrorHandler, if any. |
boolean |
isActive()
Return whether this container is currently active, that is, whether it has been set up but not shut down yet. |
boolean |
isAutoStartup()
|
boolean |
isRunning()
|
void |
setBeanName(String name)
|
void |
setCache(com.gemstone.gemfire.cache.RegionService cache)
Set the underlying cache used for registering queries. |
void |
setErrorHandler(ErrorHandler errorHandler)
Set an ErrorHandler to be invoked in case of any uncaught exceptions thrown while processing a event. |
void |
setPoolName(String poolName)
Set the name of the Pool used for performing the queries by this container. |
void |
setQueryListeners(Set<ContinuousQueryDefinition> queries)
Attaches the given query definitions. |
void |
setQueryService(com.gemstone.gemfire.cache.query.QueryService service)
Set the query service to be used by this container. |
void |
setTaskExecutor(Executor taskExecutor)
Sets the task executor used for running the event listeners when messages are received. |
void |
start()
|
void |
stop()
|
void |
stop(Runnable callback)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final org.apache.commons.logging.Log logger
public static final String DEFAULT_THREAD_NAME_PREFIX
Constructor Detail |
---|
public ContinuousQueryListenerContainer()
Method Detail |
---|
public void afterPropertiesSet()
afterPropertiesSet
in interface InitializingBean
protected TaskExecutor createDefaultTaskExecutor()
The default implementation builds a SimpleAsyncTaskExecutor
with the specified bean name (or the class name, if no bean name specified) as thread name prefix.
SimpleAsyncTaskExecutor.SimpleAsyncTaskExecutor(String)
public void destroy() throws Exception
destroy
in interface DisposableBean
Exception
public boolean isAutoStartup()
isAutoStartup
in interface SmartLifecycle
public void stop(Runnable callback)
stop
in interface SmartLifecycle
public int getPhase()
getPhase
in interface Phased
public boolean isRunning()
isRunning
in interface Lifecycle
public void start()
start
in interface Lifecycle
public void stop()
stop
in interface Lifecycle
protected void executeListener(ContinuousQueryListener listener, com.gemstone.gemfire.cache.query.CqEvent event)
handleListenerException(java.lang.Throwable)
public final boolean isActive()
protected void handleListenerException(Throwable ex)
The default implementation logs the exception at error level. This can be overridden in subclasses.
ex
- the exception to handleprotected void invokeErrorHandler(Throwable ex)
ex
- the uncaught error that arose during event processing.setErrorHandler(org.springframework.util.ErrorHandler)
public void setBeanName(String name)
setBeanName
in interface BeanNameAware
public void setTaskExecutor(Executor taskExecutor)
SimpleAsyncTaskExecutor
will be used by default.
The task executor can be adjusted depending on the work done by the listeners and the number of
messages coming in.
taskExecutor
- The taskExecutor to set.public void setErrorHandler(ErrorHandler errorHandler)
public void setCache(com.gemstone.gemfire.cache.RegionService cache)
cache
- cache used for registering queriespublic void setQueryService(com.gemstone.gemfire.cache.query.QueryService service)
service
- query service used by the containerpublic void setPoolName(String poolName)
Pool
used for performing the queries by this container.
poolName
- the name of the pool to be used by the containerpublic void setQueryListeners(Set<ContinuousQueryDefinition> queries)
queries
- set of queriespublic void addListener(ContinuousQueryDefinition cqQuery)
cqQuery
- cqQuery definition
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |