org.jcreme.processing
Class RMIProducer

java.lang.Object
  extended byorg.jcreme.processing.RMIProducer
All Implemented Interfaces:
Producer

public class RMIProducer
extends java.lang.Object
implements Producer

This class provides access to a RemoteProducer. Note all the exchanged Objects must be serializable.

Version:
$Revision: 1.2 $
Author:
$Author: dbregeon $

Constructor Summary
RMIProducer(RemoteProducer producer)
          Creates a new RMIProducer.
 
Method Summary
 boolean isProductionOver()
          Returns true if the production is over, false if not.
 java.lang.Object nextItem()
          Returns the next item free for consumption.
 boolean produceItem()
          Produces next item, i.e. marks it as consumable.
 void setProductionOver(boolean bool)
          Sets a flag that shows whether the production is over.
 boolean validateItem(java.lang.Object theItem)
          Validates an item, i.e. marks it as having been consumed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RMIProducer

public RMIProducer(RemoteProducer producer)
            throws java.lang.IllegalArgumentException
Creates a new RMIProducer.

Parameters:
producer - the RemoteProducer that is exposed through this RMIProducer.
Throws:
java.lang.IllegalArgumentException - if producer is null.
Method Detail

setProductionOver

public void setProductionOver(boolean bool)
Description copied from interface: Producer
Sets a flag that shows whether the production is over.

Specified by:
setProductionOver in interface Producer
Parameters:
bool - The boolean value that the flag has to be set on.
See Also:
Producer.setProductionOver(boolean)

isProductionOver

public boolean isProductionOver()
Description copied from interface: Producer
Returns true if the production is over, false if not.

Specified by:
isProductionOver in interface Producer
Returns:
True if the production is over, false if not.
See Also:
Producer.isProductionOver()

nextItem

public java.lang.Object nextItem()
Description copied from interface: Producer
Returns the next item free for consumption.

Specified by:
nextItem in interface Producer
Returns:
The next item free for consumption.
See Also:
Producer.nextItem()

validateItem

public boolean validateItem(java.lang.Object theItem)
Description copied from interface: Producer
Validates an item, i.e. marks it as having been consumed.

Specified by:
validateItem in interface Producer
Parameters:
theItem - The item to be validated.
Returns:
true if the object was validated.
See Also:
Producer.validateItem(java.lang.Object)

produceItem

public boolean produceItem()
Description copied from interface: Producer
Produces next item, i.e. marks it as consumable.

Specified by:
produceItem in interface Producer
Returns:
True if there are still objects to produce, false otherwise.
See Also:
Producer.produceItem()


Copyright 2006 null. All Rights Reserved.