Represents a reference to a managed object. Classes that implement
ManagedReference
must also implement {@link Serializable}. Applications should create instances of this interface using the {@link DataManager#createReference 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.
@param < T> the type of the referenced object
@see DataManager#createReference DataManager.createReference