Class XThreadStringBuffer
- java.lang.Object
-
- org.apache.manifoldcf.connectorcommon.common.XThreadStringBuffer
-
public class XThreadStringBuffer extends java.lang.Object
Thread-safe class that functions as a limited-size buffer of strings
-
-
Constructor Summary
Constructors Constructor Description XThreadStringBuffer()
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
abandon()
Signal that the buffer should be abandoned.void
add(java.lang.String string)
Add a string to the buffer, and block if the buffer is fulljava.lang.String
fetch()
Pull an id off the buffer, and wait if there's more to come.void
signalDone()
Signal that the operation is complete, and that no more strings will be added.
-
-
-
Method Detail
-
add
public void add(java.lang.String string) throws java.lang.InterruptedException
Add a string to the buffer, and block if the buffer is full- Throws:
java.lang.InterruptedException
-
abandon
public void abandon()
Signal that the buffer should be abandoned. Called by the receiving thread!
-
signalDone
public void signalDone()
Signal that the operation is complete, and that no more strings will be added. Called by the sending thread!
-
fetch
public java.lang.String fetch() throws java.lang.InterruptedException
Pull an id off the buffer, and wait if there's more to come. Called by the receiving thread! Returns null if the operation is complete.- Throws:
java.lang.InterruptedException
-
-