Interface TriggerOperationHandler
- All Known Implementing Classes:
ReadTriggerOperationHandler
public interface TriggerOperationHandler
Allows to perform a trigger receive operation which control if the active receive operation will
be performed in a polling event container. This feature is mainly used when having polling event
operations with transactions where the trigger receive operation is performed outside of a
transaction thus reducing the creation of transactions did not perform the actual receive
operation.
If the triggerReceive(Object, org.openspaces.core.GigaSpace, long) returns a non
null value, it means that the receive operation should take place. If it returns a
null value, no receive operation will be attempted.
A trigger operation handler can also control if the object returned from triggerReceive(Object, org.openspaces.core.GigaSpace, long) will be used as the template for
the receive operation by returning true in isUseTriggerAsTemplate(). If
false is returned, the actual template configured in the polling event container
will be used.
- Author:
- kimchy
-
Method Summary
Modifier and TypeMethodDescriptionbooleanControls if the object returned fromtriggerReceive(Object, org.openspaces.core.GigaSpace, long)will be used as the template for the receive operation by returningtrue.triggerReceive(Object template, GigaSpace gigaSpace, long receiveTimeout) Allows to perform a trigger receive operation which control if the active receive operation will be performed in a polling event container.
-
Method Details
-
triggerReceive
Object triggerReceive(Object template, GigaSpace gigaSpace, long receiveTimeout) throws org.springframework.dao.DataAccessException Allows to perform a trigger receive operation which control if the active receive operation will be performed in a polling event container. This feature is mainly used when having polling event operations with transactions where the trigger receive operation is performed outside of a transaction thus reducing the creation of transactions did not perform the actual receive operation.If this operation returns a non
nullvalue, it means that the receive operation should take place. If it returns anullvalue, no receive operation will be attempted.- Parameters:
template- The template to use for the receive operation.gigaSpace- The GigaSpace interface to perform the receive operations withreceiveTimeout- Receive timeout value- Throws:
org.springframework.dao.DataAccessException
-
isUseTriggerAsTemplate
boolean isUseTriggerAsTemplate()Controls if the object returned fromtriggerReceive(Object, org.openspaces.core.GigaSpace, long)will be used as the template for the receive operation by returningtrue. Iffalseis returned, the actual template configured in the polling event container will be used.
-