GigaSpaces XAP 9.7.2 API

org.openspaces.events.polling.receive
Class MultiExclusiveReadReceiveOperationHandler

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

public class MultiExclusiveReadReceiveOperationHandler
extends AbstractFifoGroupingReceiveOperationHandler

First tries and perform a GigaSpace.readMultiple(Object,int,int) using the provided template, configured maxEntries (defaults to 50) and the configured fifoGroups (default to false).

If no values are returned, will perform a blocking read operation using GigaSpace.read(Object,long,int).

Read operations are performed under an exclusive read lock which mimics the similar behavior as take without actually taking the entry from the space.

Author:
kimchy

Field Summary
 
Fields inherited from class org.openspaces.events.polling.receive.AbstractFifoGroupingReceiveOperationHandler
useFifoGrouping
 
Fields inherited from class org.openspaces.events.polling.receive.AbstractMemoryOnlySearchReceiveOperationHandler
useMemoryOnlySearch
 
Fields inherited from class org.openspaces.events.polling.receive.AbstractNonBlockingReceiveOperationHandler
nonBlocking, nonBlockingFactor
 
Constructor Summary
MultiExclusiveReadReceiveOperationHandler()
           
 
Method Summary
protected  Object doReceiveBlocking(Object template, GigaSpace gigaSpace, long receiveTimeout)
          First tries and perform a GigaSpace.readMultiple(Object,int,int) using the provided template, configured maxEntries (defaults to 50) and the configured fifoGroups (default to false).
protected  Object doReceiveNonBlocking(Object template, GigaSpace gigaSpace)
          Perform a GigaSpace.readMultiple(Object,int,int) using the provided template, configured maxEntries (defaults to 50) and the configured fifoGroups (default to false).
 void setMaxEntries(int maxEntries)
          Sets the max entries the initial take multiple operation will perform.
 String toString()
           
 
Methods inherited from class org.openspaces.events.polling.receive.AbstractFifoGroupingReceiveOperationHandler
isUseFifoGrouping, setUseFifoGrouping
 
Methods inherited from class org.openspaces.events.polling.receive.AbstractMemoryOnlySearchReceiveOperationHandler
isUseMemoryOnlySearch, setUseMemoryOnlySearch
 
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, wait, wait, wait
 

Constructor Detail

MultiExclusiveReadReceiveOperationHandler

public MultiExclusiveReadReceiveOperationHandler()
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.readMultiple(Object,int,int) using the provided template, configured maxEntries (defaults to 50) and the configured fifoGroups (default to false). If no values are returned, will perform a blocking read operation using GigaSpace.read(Object,long,int).

Read operations are performed under an exclusive read lock which mimics the similar behavior as take without actually taking the entry from the space.

Specified by:
doReceiveBlocking in class AbstractNonBlockingReceiveOperationHandler
Throws:
DataAccessException

doReceiveNonBlocking

protected Object doReceiveNonBlocking(Object template,
                                      GigaSpace gigaSpace)
                               throws DataAccessException
Perform a GigaSpace.readMultiple(Object,int,int) using the provided template, configured maxEntries (defaults to 50) and the configured fifoGroups (default to false).

Read operations are performed under an exclusive read lock which mimics the similar behavior as take without actually taking the entry from the space.

Specified by:
doReceiveNonBlocking in class AbstractNonBlockingReceiveOperationHandler
Throws:
DataAccessException

toString

public String toString()
Overrides:
toString in class Object

GigaSpaces XAP 9.7.2 API

Copyright © GigaSpaces.