|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.multiverse.transactional.TransactionalAbaReference<E>
public final class TransactionalAbaReference<E>
A TransactionalReference that doesn't suffer from the ABA problem. See
the DefaultTransactionalReference for more information.
| Constructor Summary | |
|---|---|
TransactionalAbaReference()
Creates a new TransactionalAbaReference with a null reference. |
|
TransactionalAbaReference(E reference)
Creates a new TransactionalAbaReference with the provided reference. |
|
| Method Summary | |
|---|---|
E |
clear()
Clears the ref and returns the old value of the ref (could be null). |
E |
get()
Gets the current stored ref, or null if no ref is stored. |
E |
getOrAwait()
Gets the current stored ref, or waits until a non null reference becomes available. |
E |
getOrAwaitInterruptibly()
Gets the current stored reference, or waits until a non null references becomes available or until it is is Interrupted. |
boolean |
isNull()
Checks if the ref is null. |
E |
set(E newRef)
Sets the current ref. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public TransactionalAbaReference()
public TransactionalAbaReference(E reference)
reference - the reference to store.| Method Detail |
|---|
public E getOrAwait()
TransactionalReference
getOrAwait in interface TransactionalReference<E>
public E getOrAwaitInterruptibly()
throws java.lang.InterruptedException
TransactionalReference
getOrAwaitInterruptibly in interface TransactionalReference<E>java.lang.InterruptedException - if the thread is interrupted while waiting on a reference to come available.public E get()
TransactionalReference
get in interface TransactionalReference<E>public boolean isNull()
TransactionalReference
isNull in interface TransactionalReference<E>public E set(E newRef)
TransactionalReference
set in interface TransactionalReference<E>newRef - the ref to set.
public E clear()
TransactionalReference
clear in interface TransactionalReference<E>public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||