|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.modules.ref.References
public final class References
A set of utility methods for reference types.
Method Summary | ||
---|---|---|
static
|
create(Reference.Type type,
T value,
A attachment)
Create a reference of a given type with the provided value and attachment. |
|
static
|
create(Reference.Type type,
T value,
A attachment,
Reaper<T,A> reaper)
Create a reference of a given type with the provided value and attachment. |
|
static
|
create(Reference.Type type,
T value,
A attachment,
ReferenceQueue<? super T> referenceQueue)
Create a reference of a given type with the provided value and attachment. |
|
static
|
getNullReference()
Get a null reference. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static <T,A> Reference<T,A> create(Reference.Type type, T value, A attachment, Reaper<T,A> reaper)
Reference.Type.STRONG
or Reference.Type.NULL
then the reaper argument is ignored. If
the reference type is Reference.Type.NULL
then the value and attachment arguments are ignored.
T
- the reference value typeA
- the reference attachment typetype
- the reference typevalue
- the reference valueattachment
- the attachment valuereaper
- the reaper to use, if any
public static <T,A> Reference<T,A> create(Reference.Type type, T value, A attachment, ReferenceQueue<? super T> referenceQueue)
Reference.Type.STRONG
or Reference.Type.NULL
then the reference queue argument is ignored. If
the reference type is Reference.Type.NULL
then the value and attachment arguments are ignored.
T
- the reference value typeA
- the reference attachment typetype
- the reference typevalue
- the reference valueattachment
- the attachment valuereferenceQueue
- the reference queue to use, if any
public static <T,A> Reference<T,A> create(Reference.Type type, T value, A attachment) throws IllegalArgumentException
Reference.Type.PHANTOM
then this method will throw an IllegalArgumentException
because
such references are not constructable without a queue or reaper. If the reference type is
Reference.Type.NULL
then the value and attachment arguments are ignored.
T
- the reference value typeA
- the reference attachment typetype
- the reference typevalue
- the reference valueattachment
- the attachment value
IllegalArgumentException
- if the reference type is Reference.Type.PHANTOM
public static <T,A> Reference<T,A> getNullReference()
T
- the reference value typeA
- the attachment value type
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |