|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The interface describing the behavior of objects acting as consumers. This Interface along with the Producer Interface is designed to enable to easily string "consumption - production" pieces together. It enables to separate the successive operations applied to data so that the developers can concentrate their efforts on the operations themselves and not on how they are to be stringed or how the application will be architectured (distributed producers and consumers, pools, load balancing...) The architecture issues merely appear at deployment time.
Method Summary | |
java.lang.Object |
consumeItem()
Consumes a new item from the parent producer. |
Producer |
getProvider()
Returns the producer whose objects the consumer will consume. |
void |
setProvider(Producer provider)
Sets the producer whose objects the consumer will consume. |
boolean |
validateItem(java.lang.Object item)
Tells the parent producer that this consumer has finished with this object. |
Method Detail |
public void setProvider(Producer provider) throws java.lang.IllegalArgumentException
provider
- The producer to be set.
java.lang.IllegalArgumentException
- In case the type of the given producer doesn't match the
expected type.public Producer getProvider()
public java.lang.Object consumeItem()
public boolean validateItem(java.lang.Object item)
item
- an item that was previously retrieved through the consumeItem
method.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |