org.jcreme.processing
Class RemoteProducerImpl

java.lang.Object
  extended byjava.rmi.server.RemoteObject
      extended byjava.rmi.server.RemoteServer
          extended byjava.rmi.server.UnicastRemoteObject
              extended byorg.jcreme.processing.RemoteProducerImpl
All Implemented Interfaces:
java.rmi.Remote, RemoteProducer, java.io.Serializable

public class RemoteProducerImpl
extends java.rmi.server.UnicastRemoteObject
implements RemoteProducer

This implementation of the RemoteProducer enables to export any Producer through RMI. Note that the exchanged Objects must be Serializable.

Version:
$Revision: 1.4 $
Author:
$Author: dbregeon $
See Also:
Serialized Form

Field Summary
(package private) static long serialVersionUID
           
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
RemoteProducerImpl(Producer producer)
          Creates a new RemoteProducerImpl.
 
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.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

RemoteProducerImpl

public RemoteProducerImpl(Producer producer)
                   throws java.lang.IllegalArgumentException,
                          java.rmi.RemoteException
Creates a new RemoteProducerImpl.

Parameters:
producer - the producer to be exposed through RMI.
Throws:
java.lang.IllegalArgumentException - when the producer parameter is null.
java.rmi.RemoteException - if an error occurs during communication.
Method Detail

setProductionOver

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

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

isProductionOver

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

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

nextItem

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

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

validateItem

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

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

produceItem

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

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


Copyright 2006 null. All Rights Reserved.