GigaSpaces XAP 7.0 API

org.openspaces.events.polling.trigger
Class ReadTriggerOperationHandler

java.lang.Object
  extended by org.openspaces.events.polling.trigger.ReadTriggerOperationHandler
All Implemented Interfaces:
TriggerOperationHandler

public class ReadTriggerOperationHandler
extends Object
implements TriggerOperationHandler

A trigger operation handler that performs read based on the provided template and returns its result.

Author:
kimchy

Constructor Summary
ReadTriggerOperationHandler()
           
 
Method Summary
 boolean isUseTriggerAsTemplate()
          Controls if the object returned from TriggerOperationHandler.triggerReceive(Object,org.openspaces.core.GigaSpace,long) will be used as the template for the receive operation by returning true.
 void setUseTriggerAsTemplate(boolean useTriggerAsTemplate)
          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)
          Uses GigaSpace.read(Object,long) and returns its result.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReadTriggerOperationHandler

public ReadTriggerOperationHandler()
Method Detail

setUseTriggerAsTemplate

public void setUseTriggerAsTemplate(boolean useTriggerAsTemplate)
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.

See Also:
TriggerOperationHandler.isUseTriggerAsTemplate()

isUseTriggerAsTemplate

public boolean isUseTriggerAsTemplate()
Description copied from interface: TriggerOperationHandler
Controls if the object returned from TriggerOperationHandler.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.

Specified by:
isUseTriggerAsTemplate in interface TriggerOperationHandler
See Also:
TriggerOperationHandler.isUseTriggerAsTemplate()

triggerReceive

public Object triggerReceive(Object template,
                             GigaSpace gigaSpace,
                             long receiveTimeout)
                      throws DataAccessException
Uses GigaSpace.read(Object,long) and returns its result.

Specified by:
triggerReceive in interface TriggerOperationHandler
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

GigaSpaces XAP 7.0 API

Copyright © GigaSpaces.