|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.sgs.impl.service.data.ManagedReferenceImpl<T>
final class ManagedReferenceImpl<T>
Provides an implementation of ManagedReference. Instances of this class are associated with a single transaction. Within a transaction, instances are canonicalized: only a single instance appears for a given object ID or object.
| Field Summary | |
|---|---|
(package private) long |
oid
The object ID. |
| Method Summary | ||
|---|---|---|
(package private) static void |
checkAllState(Context context)
Checks the consistency of the managed references table, throwing an exception if a problem is found. |
|
(package private) void |
checkState()
Checks the fields of this object to make sure they have valid values, throwing an assertion error if a problem is found. |
|
boolean |
equals(Object object)
Compares the specified object with this reference. |
|
(package private) static
|
findReference(Context context,
T object)
Returns the reference associated with a context and object, or null if the reference is not found. |
|
(package private) byte[] |
flush()
Returns any modifications that need to be stored to the data store, or null if there are none, and changes the state to FLUSHED. |
|
(package private) static void |
flushAll(Context context)
Saves all object modifications to the data store. |
|
T |
get()
Obtains the object associated with this reference. |
|
(package private) T |
get(boolean checkContext)
Like get, but with optional checking of the context. |
|
T |
getForUpdate()
Obtains the managed object associated with this reference, and notifies the system that the object is going to be modified. |
|
(package private) T |
getForUpdate(boolean checkContext)
Like getForUpdate, but with optional checking of the context. |
|
BigInteger |
getId()
Returns a unique identifier for the object associated with this reference. |
|
(package private) ManagedObject |
getObject()
Returns the object currently associated with this reference or null. |
|
(package private) static ManagedReferenceImpl<?> |
getReference(Context context,
long oid)
Returns the reference associated with a context and object ID, creating an EMPTY reference if none is found. |
|
(package private) static
|
getReference(Context context,
T object)
Returns the reference associated with a context and object, creating a NEW reference if none is found. |
|
int |
hashCode()
Returns an appropriate hash code value for the object. |
|
(package private) boolean |
isNew()
Checks if the object has been created in the current transaction and not removed. |
|
(package private) boolean |
isRemoved()
Checks if the object has been marked removed. |
|
(package private) void |
markForUpdate()
|
|
(package private) static long |
nextObjectId(Context context,
long oid)
Returns the next object ID, or -1 if there are no more objects. |
|
(package private) void |
removeObject()
|
|
(package private) static
|
safeFindReference(Context context,
T object)
Returns the reference associated with a context and object, or null if the reference is not found or the object has been removed. |
|
String |
toString()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
final long oid
| Method Detail |
|---|
static <T> ManagedReferenceImpl<T> findReference(Context context,
T object)
static <T> ManagedReferenceImpl<T> safeFindReference(Context context,
T object)
static <T> ManagedReferenceImpl<T> getReference(Context context,
T object)
static ManagedReferenceImpl<?> getReference(Context context,
long oid)
void removeObject()
void markForUpdate()
public 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.
get in interface ManagedReference<T>getForUpdate,
DataManager.markForUpdateT get(boolean checkContext)
public T getForUpdate()
ManagedObject and Serializable.
getForUpdate in interface ManagedReference<T>DataManager.markForUpdateT getForUpdate(boolean checkContext)
public BigInteger getId()
getId in interface ManagedReference<T>public boolean equals(Object object)
true if the argument is a ManagedReference
that refers to the same object as this reference, otherwise
false.
equals in interface ManagedReference<T>equals in class Objectobject - the object to be compared with
object refers to the same objectpublic int hashCode()
hashCode in interface ManagedReference<T>hashCode in class Objectpublic String toString()
toString in class Objectstatic void checkAllState(Context context)
void checkState()
static void flushAll(Context context)
static long nextObjectId(Context context,
long oid)
byte[] flush()
boolean isRemoved()
boolean isNew()
ManagedObject getObject()
|
RedDwarf, Version 0.10.1 2010-03-14 10:56:12 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||