Package org.oddjob.values
Class ValueQueueService
java.lang.Object
org.oddjob.values.ValueQueueService
- All Implemented Interfaces:
ValueConsumer<Object>
Provide a service that supports a blocking Iterable that can be
used as the values for a
ForEachJob.
Values are placed on the queue by setting the value property.
When this service is stopped any iterators in use return false from their hasNext method. This will cause the foreach job to complete.
- Author:
- rob
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
ValueQueueService
public ValueQueueService()
-
-
Method Details
-
start
public void start()Start. -
stop
public void stop()Stop. -
getValues
Get the values.- Returns:
- A blocking Iterable. Never null.
-
setValue
Set a value. This causes the value to be placed on the queue.- Specified by:
setValuein interfaceValueConsumer<Object>- Parameters:
object-
-
getSize
public int getSize()Get the current size of the queue.- Returns:
- The size.
-
getName
-
setName
-
toString
-