public abstract class AbstractNonBlockingReceiveOperationHandler extends Object implements ReceiveOperationHandler
Modifier and Type | Field and Description |
---|---|
protected boolean |
nonBlocking |
protected int |
nonBlockingFactor |
Constructor and Description |
---|
AbstractNonBlockingReceiveOperationHandler() |
Modifier and Type | Method and Description |
---|---|
protected abstract Object |
doReceiveBlocking(Object template,
GigaSpace gigaSpace,
long receiveTimeout)
Performs a receive operations in a blocking manner.
|
protected abstract Object |
doReceiveNonBlocking(Object template,
GigaSpace gigaSpace)
Performs a receive operations in a non blocking manner.
|
Object |
receive(Object template,
GigaSpace gigaSpace,
long receiveTimeout)
Performs the receive operation.
|
void |
setNonBlocking(boolean nonBlocking)
Allows to configure the take operation to be performed in a non blocking manner.
|
void |
setNonBlockingFactor(int nonBlockingFactor)
The factor (number of times) to perform the receive operation when working in non blocking mode within
the given receive timeout.
|
protected boolean nonBlocking
protected int nonBlockingFactor
public AbstractNonBlockingReceiveOperationHandler()
public void setNonBlocking(boolean nonBlocking)
If configured to use non blocking, will perform setNonBlockingFactor(int)
number of non blocking operations (default to 10) within the receive timeout.
public void setNonBlockingFactor(int nonBlockingFactor)
10
.public Object receive(Object template, GigaSpace gigaSpace, long receiveTimeout) throws DataAccessException
doReceiveBlocking(Object,org.openspaces.core.GigaSpace,long)
and expect it to block for the receive timeout (or until a match is found). If non blocking, will perform
setNonBlockingFactor(int)
number of doReceiveNonBlocking(Object,org.openspaces.core.GigaSpace)
operations within the receive timeout (default factor is 10).receive
in interface ReceiveOperationHandler
template
- The template to use for the receive operation.gigaSpace
- The GigaSpace interface to perform the receive operations withreceiveTimeout
- Receive timeout valuenull
indicating no receive occurred. Single object
or an array of objects indicating the receive operation result.DataAccessException
protected abstract Object doReceiveBlocking(Object template, GigaSpace gigaSpace, long receiveTimeout) throws DataAccessException
DataAccessException
protected abstract Object doReceiveNonBlocking(Object template, GigaSpace gigaSpace) throws DataAccessException
DataAccessException
Copyright © GigaSpaces.