GigaSpaces XAP 7.0 API

org.openspaces.events.polling.receive
Class MultiTakeReceiveOperationHandler

java.lang.Object
  extended by org.openspaces.events.polling.receive.AbstractNonBlockingReceiveOperationHandler
      extended by org.openspaces.events.polling.receive.MultiTakeReceiveOperationHandler
All Implemented Interfaces:
ReceiveOperationHandler

public class MultiTakeReceiveOperationHandler
extends AbstractNonBlockingReceiveOperationHandler

First tries and perform a GigaSpace.takeMultiple(Object,int) using the provided template and configured maxEntries (defaults to 50). If no values are returned, will perform a blocking take operation using GigaSpace.take(Object,long).

Author:
kimchy

Constructor Summary
MultiTakeReceiveOperationHandler()
           
 
Method Summary
protected  Object doReceiveBlocking(Object template, GigaSpace gigaSpace, long receiveTimeout)
          First tries and perform a GigaSpace.takeMultiple(Object,int) using the provided template and configured maxEntries (defaults to 50).
protected  Object doReceiveNonBlocking(Object template, GigaSpace gigaSpace)
          Performs a non blocking GigaSpace.takeMultiple(Object, int).
 void setMaxEntries(int maxEntries)
          Sets the max entries the initial take multiple operation will perform.
 
Methods inherited from class org.openspaces.events.polling.receive.AbstractNonBlockingReceiveOperationHandler
receive, setNonBlocking, setNonBlockingFactor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiTakeReceiveOperationHandler

public MultiTakeReceiveOperationHandler()
Method Detail

setMaxEntries

public void setMaxEntries(int maxEntries)
Sets the max entries the initial take multiple operation will perform.


doReceiveBlocking

protected Object doReceiveBlocking(Object template,
                                   GigaSpace gigaSpace,
                                   long receiveTimeout)
                            throws DataAccessException
First tries and perform a GigaSpace.takeMultiple(Object,int) using the provided template and configured maxEntries (defaults to 50). If no values are returned, will perform a blocking take operation using GigaSpace.take(Object,long).

Specified by:
doReceiveBlocking in class AbstractNonBlockingReceiveOperationHandler
Throws:
DataAccessException

doReceiveNonBlocking

protected Object doReceiveNonBlocking(Object template,
                                      GigaSpace gigaSpace)
                               throws DataAccessException
Performs a non blocking GigaSpace.takeMultiple(Object, int).

Specified by:
doReceiveNonBlocking in class AbstractNonBlockingReceiveOperationHandler
Throws:
DataAccessException

GigaSpaces XAP 7.0 API

Copyright © GigaSpaces.