|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectits.element.OutputQueue
Returns ITS frames to the waiting OutputBuffers according to the state in each OutputCookie. Implements the precedence semantics of ITS frames (e.g. that Dictionary has precedence over Data) OutputQueue contains a slot for each of the ITS frame types which holds the most recently received frame of that type. The OutputCookie is owned by the OutputBuffer but is opaque to that class, it contains state maintained by OutputQueue. When an OutputBuffer tries to read a frame from the OutputQueue, the OutputQueue checks the OutputCookie to determine if the OutputBuffer has already seen the frame in the slot. If the OutputBuffer has already processed all frames held by the OutputQueue, the OutputBuffer waits. The OutputQueue implements the precedence of frames types through the order in which the slots are checked: first Schema, then Contents, then Extractor, and finally Data. At each slot, the current frame is sent if the OutputCookie indicates, otherwise OutputQueue moves to the next slot
| Constructor Summary | |
OutputQueue()
creates an empty OutputQueue |
|
| Method Summary | |
void |
add(ItsFrame newFrame)
add adds a frame in the appropriate slot and notifies waiting threads |
ItsFrame |
get(OutputCookie cookie)
returns the appropriate frame after examining the cookie, it may wait if there is nothing there |
int |
getTimeout()
|
void |
setTimeout(int timeout)
For each OutputBuffer thread created by the ConnectionDaemon, if the given timeout value (in milliseconds) elapses without a new ItsFrame being added to the OutputQueue, the thread will expire and its socket will be closed. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public OutputQueue()
| Method Detail |
public void add(ItsFrame newFrame)
add in interface FrameTargetnewFrame - contains the new ItsFrame
public ItsFrame get(OutputCookie cookie)
throws java.lang.InterruptedException,
java.io.InterruptedIOException
java.lang.InterruptedException - if the wait was interrupted
java.io.InterruptedIOException - if the timeout period elapsed during a waitpublic void setTimeout(int timeout)
public int getTimeout()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||