com.ibm.bsf.engines.rexx
Class RexxAndJava.SyncAddGet

java.lang.Object
  |
  +--com.ibm.bsf.engines.rexx.RexxAndJava.SyncAddGet
Enclosing class:
RexxAndJava

protected class RexxAndJava.SyncAddGet
extends java.lang.Object

Inner class to implement a Synchronized ReaderWriter, where a read on an empty Vector blocks the read, until a write occurs (with optional timeout).


Field Summary
private  java.util.Vector eventTextVector
          Vector to store the text sent by the eventListeners.
private  java.util.Vector eventTextVectorHigh
           
private  java.util.Vector eventTextVectorLow
           
 
Constructor Summary
protected RexxAndJava.SyncAddGet()
           
 
Method Summary
(package private)  void add(java.lang.Object o, int priority)
          Adds an object to the vector and makes sure that waiting threads are notified.
(package private)  java.lang.Object get(long millis)
          Get an object from the vector.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

eventTextVector

private java.util.Vector eventTextVector
Vector to store the text sent by the eventListeners.

eventTextVectorLow

private java.util.Vector eventTextVectorLow

eventTextVectorHigh

private java.util.Vector eventTextVectorHigh
Constructor Detail

RexxAndJava.SyncAddGet

protected RexxAndJava.SyncAddGet()
Method Detail

get

java.lang.Object get(long millis)
               throws java.lang.InterruptedException
Get an object from the vector. If empty, block for the given time.
Parameters:
millis - time to wait in milliseconds, if 0 waits until an object becomes available.
Returns:
the first object from the vector or null, if empty.

add

void add(java.lang.Object o,
         int priority)
Adds an object to the vector and makes sure that waiting threads are notified.
Parameters:
o - object to add to the vector.
priority - an integer value indicating the priority of the posted event, one of:

  • "2": high ('alarm level') priority.
  • "1": normal (default) priority, and
  • "0": low ('batch level') priority,