GigaSpaces XAP 9.0 API

org.openspaces.events.polling.trigger
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
 boolean isUseTriggerAsTemplate()
          Controls 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.
 Object 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 Detail

triggerReceive

Object triggerReceive(Object template,
                      GigaSpace gigaSpace,
                      long receiveTimeout)
                      throws 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 null value, it means that the receive operation should take place. If it returns a null value, 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 with
receiveTimeout - Receive timeout value
Throws:
DataAccessException

isUseTriggerAsTemplate

boolean isUseTriggerAsTemplate()
Controls 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. If false is returned, the actual template configured in the polling event container will be used.


GigaSpaces XAP 9.0 API

Copyright © GigaSpaces.