|
GigaSpaces XAP 9.7.2 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.openspaces.events.polling.receive.AbstractNonBlockingReceiveOperationHandler
public abstract class AbstractNonBlockingReceiveOperationHandler
Support class to perform either non blocking or blocking receive operation.
Field Summary | |
---|---|
protected boolean |
nonBlocking
|
protected int |
nonBlockingFactor
|
Constructor Summary | |
---|---|
AbstractNonBlockingReceiveOperationHandler()
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean nonBlocking
protected int nonBlockingFactor
Constructor Detail |
---|
public AbstractNonBlockingReceiveOperationHandler()
Method Detail |
---|
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 value
null
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
|
GigaSpaces XAP 9.7.2 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |