|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
T
- the type of the referenced objectpublic interface ManagedReference<T>
Represents a reference to a managed object. Classes that implement
ManagedReference
must also implement Serializable
.
Applications should create instances of this interface using the DataManager.createReference
method. These
ManagedReference
instances should be used to store references
to instances of ManagedObject
referred to by other managed
objects or by the non-managed objects they refer to.
Applications should not use instances of ManagedReference
as
the values of static fields or in other locations not managed by the
DataManager
. There is no guarantee that objects only reachable
through these external references will continue to be managed by the
DataManager
.
Some implementations may need to be notified when managed objects and the objects they refer to are modified, while other implementations may be configurable to detect these modifications automatically. Applications are always permitted to mark objects that have been modified, and doing so may produce performance improvements regardless of whether modifications are detected automatically.
DataManager.createReference
Method Summary | |
---|---|
boolean |
equals(Object object)
Compares the specified object with this reference. |
T |
get()
Obtains the object associated with this reference. |
T |
getForUpdate()
Obtains the managed object associated with this reference, and notifies the system that the object is going to be modified. |
BigInteger |
getId()
Returns a unique identifier for the object associated with this reference. |
int |
hashCode()
Returns an appropriate hash code value for the object. |
Method Detail |
---|
T get()
ManagedObject
and Serializable
. For
implementations that need to be notified of object modifications,
applications should call getForUpdate
or DataManager.markForUpdate
before modifying
the returned object or any of the non-managed objects it refers to.
ObjectNotFoundException
- if the object associated with this
reference is not found
TransactionException
- if the operation failed because of a
problem with the current transactiongetForUpdate
,
DataManager.markForUpdate
T getForUpdate()
ManagedObject
and Serializable
.
ObjectNotFoundException
- if the object associated with this
reference is not found
TransactionException
- if the operation failed because of a
problem with the current transactionDataManager.markForUpdate
BigInteger getId()
boolean equals(Object object)
true
if the argument is a ManagedReference
that refers to the same object as this reference, otherwise
false
.
equals
in class Object
object
- the object to be compared with
object
refers to the same objectint hashCode()
hashCode
in class Object
|
Project Darkstar, Version 0.9.9.6 2009-05-08 15:39:40 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |