com.oakgrovesystems.reactor
Class ReactorObjectId

java.lang.Object
  |
  +--com.oakgrovesystems.reactor.ReactorObjectId
All Implemented Interfaces:
ObjectReference, java.io.Serializable

public class ReactorObjectId
extends java.lang.Object
implements ObjectReference, java.io.Serializable

See Also:
Serialized Form

Field Summary
protected  java.lang.String id
           
 
Constructor Summary
ReactorObjectId(java.lang.String id)
          Creates a ReactorObjectId with the underlying String id.
 
Method Summary
 java.lang.Object dereference(java.lang.Class type)
          Gets the referenced object from the persistence service.
 java.lang.Object dereference(java.lang.Class type, java.util.Map map)
          Gets the referenced object from the Map.
 java.lang.Object dereference(java.lang.Class type, java.util.Map map, boolean addToMap)
          Gets the referenced object from the Map.
 java.lang.Object dereference(java.util.Map map)
          Gets the referenced object from the Map.
 boolean equals(java.lang.Object otherRef)
          Tests this ReactorObjectId for content equality with another.
 java.lang.String getId()
          Returns this ReactorObjectId's underlying id String
 int hashCode()
          Returns a hashCode for this ReactorObjectId
 org.jdom.Element toElement()
          Returns this ReactorObjectId's XML representation: id
 java.lang.String toString()
          Returns this ReactorObjectId's underlying id String
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

id

protected java.lang.String id
Constructor Detail

ReactorObjectId

public ReactorObjectId(java.lang.String id)
                throws java.lang.IllegalArgumentException
Creates a ReactorObjectId with the underlying String id.

Method Detail

dereference

public java.lang.Object dereference(java.lang.Class type)
                             throws ObjectDereferencingException
Gets the referenced object from the persistence service. Throws an ObjectDereferencingException if the ProcessObjectService fails to return the object. Throws IllegalArgumentException type is null.

Specified by:
dereference in interface ObjectReference
ObjectDereferencingException

dereference

public java.lang.Object dereference(java.lang.Class type,
                                    java.util.Map map,
                                    boolean addToMap)
                             throws ObjectDereferencingException
Gets the referenced object from the Map. First tries to use the underlying id String as the key. If that doesn't work tries to use this as the key. If neither is a key in the Map, tries to get the object from the ProcessObjectService. Throws an ObjectDereferencingException if the ProcessObjectService fails to return the object. If the addToMap parameter is true and the ProcessObjectService successfully returns the object, it is added to the map with the underlying String as the key. Throws IllegalArgumentException if the Map is null or type is null.

ObjectDereferencingException

dereference

public java.lang.Object dereference(java.util.Map map)
                             throws ObjectDereferencingException
Gets the referenced object from the Map. First tries to use the underlying id String as the key. If that doesn't work tries to use this as the key. If neither is a key in the Map, throws an ObjectDereferencingException. Throws a IllegalArgumentException if the Map is null.

ObjectDereferencingException

dereference

public java.lang.Object dereference(java.lang.Class type,
                                    java.util.Map map)
                             throws ObjectDereferencingException
Gets the referenced object from the Map. First tries to use the underlying id String as the key. If that doesn't work tries to use this as the key. If neither is a key in the Map, throws an ObjectDereferencingException. If the object is not of specified type, thows ObjectDereferencingException. Throws a IllegalArgumentException if the Map is null or Class is null.

ObjectDereferencingException

equals

public boolean equals(java.lang.Object otherRef)
Tests this ReactorObjectId for content equality with another. returns true if and only if the underlying Strings are equal().

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Returns a hashCode for this ReactorObjectId

Overrides:
hashCode in class java.lang.Object

getId

public java.lang.String getId()
Returns this ReactorObjectId's underlying id String


toElement

public org.jdom.Element toElement()
Returns this ReactorObjectId's XML representation: id


toString

public java.lang.String toString()
Returns this ReactorObjectId's underlying id String

Overrides:
toString in class java.lang.Object


Copyright (c) 1999-2004 Oak Grove Systems. All Rights Reserved.