nenok.net
Class Locator

java.lang.Object
  extended by nenok.net.Locator
All Implemented Interfaces:
Serializable, Labeled
Direct Known Subclasses:
IdentityLocator, Locator.Predictable

public class Locator
extends Object
implements Labeled, Serializable

The location of a (remote) Valuation object can unambiguously be determined by the identifier of the processor hosting the valuation and the identifier of the valuation's envelope. Locators are objects that carries these informations in order to localize valuation objects at a later time. Furthermore, they manage the following additional informations:

Version:
$LastChangedRevision: 556 $
$LastChangedDate: 2008-03-26 14:21:45 +0100 (Mi, 26 Mrz 2008) $
See Also:
Serialized Form

Nested Class Summary
 class Locator.Predictable
          Extension for weight predictable valuation objects.
 
Field Summary
protected  Uuid pid
           
 
Constructor Summary
protected Locator()
          Constructor:
 
Method Summary
static Locator create(Uuid pid, Envelope env)
          Creator:
 void delete()
          Deletes the valuation that is referenced by this locator.
 boolean equals(Object o)
          Two locators are equal, if they point to the same object.
 Uuid getEnvelopeID()
           
 Uuid getPID()
           
 String getType()
           
 int getWeight()
           
 int hashCode()
           
 Domain label()
           
 Valuation retrieve()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

pid

protected Uuid pid
Constructor Detail

Locator

protected Locator()
Constructor:

Method Detail

create

public static Locator create(Uuid pid,
                             Envelope env)
Creator:

Parameters:
pid - The identifier of the processor hosting the valuation.
env - The wrapper envelope of the valuation.
Returns:
A new Locator instance corresponding to the valuation stored in the envelope.

retrieve

public Valuation retrieve()
                   throws RemoteException
Returns:
Retrieves the referenced valuation from the processor.
Throws:
RemoteException - Exception caused when trying to access processors.

delete

public void delete()
            throws RemoteException
Deletes the valuation that is referenced by this locator.

Throws:
RemoteException - Exception caused when trying to access processors.

label

public Domain label()
Specified by:
label in interface Labeled
Returns:
The domain of the referenced valuation.

getWeight

public int getWeight()
Returns:
The weight of the referenced valuation.

getType

public String getType()
Returns:
The type (class name) of the referenced valuation.

getPID

public Uuid getPID()
Returns:
The indentifier of the processor that hosts the valuation.

getEnvelopeID

public Uuid getEnvelopeID()
Returns:
The identifier of the envelope that wraps the referenced valuation.

hashCode

public int hashCode()
Overrides:
hashCode in class Object
See Also:
Object.hashCode()

toString

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

equals

public boolean equals(Object o)
Two locators are equal, if they point to the same object.

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