|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jcreme.processing.AbstractProducer
org.jcreme.processing.BaseProducer
This is a base implementation of the Producer interface. It provides all the needed interactions with a Consumer source. Most actual producers should basically simply extend this class.
Producer| Constructor Summary | |
BaseProducer(int initialProductionQueueSize,
int initialValidationQueueSize,
Consumer source)
Creates new BaseProducer |
|
| Method Summary | |
protected abstract java.lang.Object |
actualProduce(java.lang.Object sourceItem)
This method does that actual production work. |
protected java.util.Hashtable |
getProducedToConsumed()
Provides access to the producedToConsumed association. |
protected Consumer |
getSource()
Provides access to the source consumer. |
boolean |
produceItem()
Produces an item, i.e. marks it as consumable. |
boolean |
validateItem(java.lang.Object theItem)
Validates an item, i.e. marks it as having been consumed. |
| Methods inherited from class org.jcreme.processing.AbstractProducer |
getItemsBeingConsumed, getProducedItems, isProductionOver, nextItem, nextItem, publishItem, setProductionOver |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public BaseProducer(int initialProductionQueueSize,
int initialValidationQueueSize,
Consumer source)
initialProductionQueueSize - the size of the production queue when it is initialized.initialValidationQueueSize - the size of the validation queue when it is initialized.source - the consumer from which the producer will get its source
objects.| Method Detail |
protected Consumer getSource()
public boolean produceItem()
produceItem in interface ProducerproduceItem in class AbstractProducerProducer.produceItem()protected abstract java.lang.Object actualProduce(java.lang.Object sourceItem)
sourceItem - the item that will enable to produce a result.
public boolean validateItem(java.lang.Object theItem)
validateItem in interface ProducervalidateItem in class AbstractProducertheItem - The item to be validated.
Producer.validateItem(java.lang.Object)protected java.util.Hashtable getProducedToConsumed()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||