|
GigaSpaces XAP 9.1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.openspaces.events.adapter.TaskExecutorEventListenerAdapter
public class TaskExecutorEventListenerAdapter
An adapter that delegates the execution of a SpaceDataEventListener
to Spring TaskExecutor
implementation (usually to be executed in a different thread).
Very handy when using notifications in order to release the notification thread.
Defualt task executor uses SimpleAsyncTaskExecutor
which creates a new thread for each
request.
TaskExecutor
Constructor Summary | |
---|---|
TaskExecutorEventListenerAdapter()
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
Initializes the task executor adapter. |
Object |
getActualEventListener()
|
void |
onEvent(Object data,
GigaSpace gigaSpace,
TransactionStatus txStatus,
Object source)
Listens for events and and delegates them to the setDelegate(org.openspaces.events.SpaceDataEventListener)
to be executed using the provided setTaskExecutor(org.springframework.core.task.TaskExecutor) . |
void |
setDelegate(SpaceDataEventListener delegate)
Sets the delegate that will invoked using the task executor. |
void |
setTaskExecutor(TaskExecutor taskExecutor)
Sets the task executor to be used to delegate the execution of the delegate listener. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TaskExecutorEventListenerAdapter()
Method Detail |
---|
public void setTaskExecutor(TaskExecutor taskExecutor)
delegate
listener.
Defualts to SimpleAsyncTaskExecutor
which creates a new thread for each
request.
public void setDelegate(SpaceDataEventListener delegate)
public void afterPropertiesSet() throws Exception
taskExecutor
is
provided will create a default one using SimpleAsyncTaskExecutor
.
afterPropertiesSet
in interface InitializingBean
Exception
public Object getActualEventListener()
getActualEventListener
in interface EventListenerAdapter
public void onEvent(Object data, GigaSpace gigaSpace, TransactionStatus txStatus, Object source)
setDelegate(org.openspaces.events.SpaceDataEventListener)
to be executed using the provided setTaskExecutor(org.springframework.core.task.TaskExecutor)
.
onEvent
in interface SpaceDataEventListener
data
- The actual data object of the eventgigaSpace
- A GigaSpace instance that can be used to perform additional operations against the
spacetxStatus
- An optional transaction status allowing to rollback a transaction programmaticallysource
- Optional additional data or the actual source event data object (where relevant)
|
GigaSpaces XAP 9.1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |