nenok.net.processor
Class ProcessorImpl

java.lang.Object
  extended by nenok.net.processor.ProcessorImpl
All Implemented Interfaces:
Remote, Processor

public class ProcessorImpl
extends Object
implements Processor

An implementation of the Processor interface.

Version:
1.2
Author:
Marc Pouly

Constructor Summary
ProcessorImpl(net.jini.id.Uuid pid)
          Constructor:
 
Method Summary
 void delete(DefaultLocator loc)
          Deletes a stored valuation from this processor.
 boolean equals(Object o)
           
 Locator execute(Task task)
          Executes a given task on this processor.
 boolean exists(net.jini.id.Uuid envID)
          Is the valuation with the given envelope ID stored on this processor.
 String getCodebase()
           
 net.jini.id.Uuid getPID()
           
 void reset()
          Deletes all stored valuations.
 Valuation retrieve(DefaultLocator loc)
          Retrieves a stored valuation from this processor.
 Locator store(Envelope env)
          Stores a valuation wrapped in an envelope on this processor.
 Locator store(Valuation val)
          Stores a valuation on this processor.
 Locator[] store(Valuation[] vals)
          Stores a set of valuations on this processor.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProcessorImpl

public ProcessorImpl(net.jini.id.Uuid pid)
Constructor:

Parameters:
pid - The identifier of the processor.
Method Detail

store

public Locator store(Valuation val)
              throws RemoteException
Description copied from interface: Processor
Stores a valuation on this processor.

Specified by:
store in interface Processor
Parameters:
val - The valuation to store.
Returns:
The locator of the stored valuation.
Throws:
RemoteException - Locator methods all throw remote exceptions.
See Also:
Processor.store(nenok.va.Valuation)

store

public Locator store(Envelope env)
              throws RemoteException
Description copied from interface: Processor
Stores a valuation wrapped in an envelope on this processor.

Specified by:
store in interface Processor
Parameters:
env - The envelope with the valuation to store.
Returns:
The locator of the stored valuation (envelope).
Throws:
RemoteException - Locator methods all throw remote exceptions.
See Also:
Processor.store(nenok.net.Envelope)

store

public Locator[] store(Valuation[] vals)
                throws RemoteException
Description copied from interface: Processor
Stores a set of valuations on this processor.

Specified by:
store in interface Processor
Parameters:
vals - The valuations to store.
Returns:
The locators of the stored valuations. Locator i references valuation i.
Throws:
RemoteException - Locator methods all throw remote exceptions.
See Also:
Processor.store(nenok.va.Valuation[])

retrieve

public Valuation retrieve(DefaultLocator loc)
                   throws RemoteException
Description copied from interface: Processor
Retrieves a stored valuation from this processor. This method call does not remove the corresponding locator from the internal store.

Specified by:
retrieve in interface Processor
Parameters:
loc - The locator identifying the valuation.
Returns:
The valuation referenced by the locator or null.
Throws:
RemoteException - Locator methods all throw remote exceptions.
See Also:
Processor.retrieve(nenok.net.DefaultLocator)

exists

public boolean exists(net.jini.id.Uuid envID)
               throws RemoteException
Description copied from interface: Processor
Is the valuation with the given envelope ID stored on this processor.

Specified by:
exists in interface Processor
Parameters:
envID - The valuation's envelope ID.
Returns:
true, if the valuation exists.
Throws:
RemoteException - Locator methods all throw remote exceptions.
See Also:
Processor.exists(net.jini.id.Uuid)

delete

public void delete(DefaultLocator loc)
            throws RemoteException
Description copied from interface: Processor
Deletes a stored valuation from this processor.

Specified by:
delete in interface Processor
Parameters:
loc - The locator referencing the valuation to delete.
Throws:
RemoteException - Locator methods all throw remote exceptions.
See Also:
Processor.delete(nenok.net.DefaultLocator)

reset

public void reset()
           throws RemoteException
Description copied from interface: Processor
Deletes all stored valuations.

Specified by:
reset in interface Processor
Throws:
RemoteException - Locator methods all throw remote exceptions.
See Also:
Processor.reset()

execute

public Locator execute(Task task)
                throws RemoteException,
                       VAException
Description copied from interface: Processor
Executes a given task on this processor. Tasks are encapsulated valuation algebra operations (COMMAND DESIGN PATTERN).

Specified by:
execute in interface Processor
Parameters:
task - The task to execute.
Returns:
The locator of the task's result.
Throws:
RemoteException - Locator methods all throw remote exceptions.
VAException - Exception caused by undefined valuation algera operations.
See Also:
Processor.execute(nenok.net.task.Task)

getPID

public net.jini.id.Uuid getPID()
                        throws RemoteException
Specified by:
getPID in interface Processor
Returns:
The identifier of this processor.
Throws:
RemoteException - Locator methods all throw remote exceptions.
See Also:
Processor.getPID()

getCodebase

public String getCodebase()
                   throws RemoteException
Specified by:
getCodebase in interface Processor
Returns:
The codebase of this processor at start time.
Throws:
RemoteException - Locator methods all throw remote exceptions.
See Also:
Processor.getCodebase()

equals

public boolean equals(Object o)
Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()