|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
FIFO queue primitive. This primitive allows to pass data between
consumer and producer. Elements are fetched by consumer in First-In-First-Out
order. It is possible to pass objects of any type in the queue.
The only requirement is that it should be serializable (implements
java.io.Serializable
interface).
If class of the object (or of it's components) placed
in the queue by producer can not be located by consumer, then
JIPCClassNotFoundException
will be thrown at the consumer.
Length of message queue is unlimited.
If more than one consumer tries to get element from the queue,
thie requests will be satisfied in FIFO order.
Semantic of methods inherited from JIPCPrimitive
:
waitFor
reset
Field Summary |
Fields inherited from interface org.garret.jipc.JIPCPrimitive |
DEFAULT_RANK |
Method Summary | |
void |
broadcast(java.io.Serializable obj)
Broadcast message to all sessions currently connected to the queue. |
java.io.Serializable |
get()
Get element from the queue. |
java.io.Serializable |
get(long timeout)
Get element from the queue with timeout. |
java.io.Serializable |
priorityGet(int rank)
Get element from the queue. |
java.io.Serializable |
priorityGet(int rank,
long timeout)
Get element from the queue with timeout. |
void |
put(java.io.Serializable obj)
Put element at the end of the queue. |
int |
size()
Get number of elements in queue |
Methods inherited from interface org.garret.jipc.JIPCPrimitive |
alreadyExists, close, getName, priorityWait, priorityWait, reset, waitFor, waitFor |
Method Detail |
public void broadcast(java.io.Serializable obj) throws JIPCException, java.io.IOException
obj
- any not-null serializable object
JIPCException
java.io.IOException
public java.io.Serializable get() throws JIPCException, java.io.IOException
JIPCClassNotFoundException
will be thrown.
JIPCException
java.io.IOException
public java.io.Serializable get(long timeout) throws JIPCException, java.io.IOException
null
if timeout is expired before
any element was placed in the queue.
JIPCException
java.io.IOException
public java.io.Serializable priorityGet(int rank) throws JIPCException, java.io.IOException
JIPCClassNotFoundException
will be thrown.
rank
- processes will be placed in wait queue in the order of increasing
rank value and in the same order will be taken from the queue.
JIPCException
java.io.IOException
public java.io.Serializable priorityGet(int rank, long timeout) throws JIPCException, java.io.IOException
rank
- processes will be placed in wait queue in the order of increasing
rank value and in the same order will be taken from the queue.timeout
- operation timeout in millisoconds
null
if timeout is expired before
any element was placed in the queue.
JIPCException
java.io.IOException
public void put(java.io.Serializable obj) throws JIPCException, java.io.IOException
obj
- any not-null serializable object
JIPCException
java.io.IOException
public int size() throws JIPCException, java.io.IOException
JIPCException
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |