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:
$LastChangedRevision: 556 $
$LastChangedDate: 2008-03-26 14:21:45 +0100 (Mi, 26 Mrz 2008) $
Author:
Marc Pouly

Constructor Summary
ProcessorImpl(Uuid pid)
          Constructor:
 
Method Summary
 Locator combine(Locator loc, Locator... locs)
          Combines the valuations specified by locators and stores the result.
 void delete(Locator loc)
          Deletes a stored valuation from this processor.
 boolean equals(Object o)
           
 boolean exists(Uuid envID)
          Is the valuation with the given envelope ID stored on this processor.
 Valuation get(Uuid envID)
          Retrieves a stored valuation from this processor.
 String getCodebase()
           
 Uuid getPID()
           
 Locator inverse(Locator loc)
          Inverses the valuations specified by the locator.
 Locator marginalize(Locator loc, Domain dom)
          Marginalizes the valuations specified by the locator to be given domain.
 void reset()
          Deletes all stored valuations.
 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(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[])

get

public Valuation get(Uuid envID)
              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:
get in interface Processor
Parameters:
envID - The identifier of the valuation's envelope.
Returns:
The valuation referenced by the locator or null.
Throws:
RemoteException - Locator methods all throw remote exceptions.
See Also:
Processor.get(net.jini.id.Uuid)

exists

public boolean exists(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(Locator 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.Locator)

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()

getPID

public 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()

combine

public Locator combine(Locator loc,
                       Locator... locs)
                throws RemoteException
Description copied from interface: Processor
Combines the valuations specified by locators and stores the result.

Specified by:
combine in interface Processor
Parameters:
loc - A locator object.
locs - Further locators that have to be combined.
Returns:
The locator that points to the combined valuation.
Throws:
RemoteException - Locator methods all throw remote exceptions.
See Also:
Processor.combine(nenok.net.Locator, nenok.net.Locator[])

marginalize

public Locator marginalize(Locator loc,
                           Domain dom)
                    throws RemoteException
Description copied from interface: Processor
Marginalizes the valuations specified by the locator to be given domain.

Specified by:
marginalize in interface Processor
Parameters:
loc - The locator pointing to the valuation to be marginalized.
dom - The domain onto which the marginalization is performed.
Returns:
The locator that points to the marginalized valuation.
Throws:
RemoteException - Locator methods all throw remote exceptions.
See Also:
Processor.marginalize(nenok.net.Locator, nenok.va.Domain)

inverse

public Locator inverse(Locator loc)
                throws RemoteException
Description copied from interface: Processor
Inverses the valuations specified by the locator.

Specified by:
inverse in interface Processor
Parameters:
loc - The locator pointing to the valuation to be inverted.
Returns:
The locator that points to the inverse valuation.
Throws:
RemoteException - Locator methods all throw remote exceptions.
See Also:
Processor.inverse(nenok.net.Locator)

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()