Class XThreadStringBuffer
- java.lang.Object
-
- org.apache.manifoldcf.connectorcommon.common.XThreadStringBuffer
-
public class XThreadStringBuffer extends java.lang.ObjectThread-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 voidabandon()Signal that the buffer should be abandoned.voidadd(java.lang.String string)Add a string to the buffer, and block if the buffer is fulljava.lang.Stringfetch()Pull an id off the buffer, and wait if there's more to come.voidsignalDone()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.InterruptedExceptionAdd 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.InterruptedExceptionPull 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
-
-