Top Description Fields Constructors Methods
org.jboss.modules.ref

public Class StrongReference<T, A>

extends Object
implements Reference<T, A>
Class Inheritance
All Implemented Interfaces
org.jboss.modules.ref.Reference
Type Parameters
<T>
the reference value type
<A>
the attachment type

A strong reference with an attachment. Since strong references are always reachable, a reaper may not be used.
Author
David M. Lloyd

Field Summary

Modifier and TypeField and Description
private final A
private volatile T

Constructor Summary

AccessConstructor and Description
public
StrongReference(final T value, final A attachment)

public
StrongReference(final T value)

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Implements org.jboss.modules.ref.Reference.clear.

Clear the reference.
public T
get()

Implements org.jboss.modules.ref.Reference.get.

Get the value, or null if the reference has been cleared.
public A
getAttachment()

Implements org.jboss.modules.ref.Reference.getAttachment.

Get the attachment, if any.
public Reference.Type
getType()

Implements org.jboss.modules.ref.Reference.getType.

Get the type of the reference.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

attachmentback to summary
private final A attachment
valueback to summary
private volatile T value

Constructor Detail

StrongReferenceback to summary
public StrongReference(final T value, final A attachment)
StrongReferenceback to summary
public StrongReference(final T value)

Method Detail

clearback to summary
public void clear()

Implements org.jboss.modules.ref.Reference.clear.

Doc from org.jboss.modules.ref.Reference.clear.

Clear the reference.

getback to summary
public T get()

Implements org.jboss.modules.ref.Reference.get.

Doc from org.jboss.modules.ref.Reference.get.

Get the value, or null if the reference has been cleared.

Returns:T

the value

getAttachmentback to summary
public A getAttachment()

Implements org.jboss.modules.ref.Reference.getAttachment.

Doc from org.jboss.modules.ref.Reference.getAttachment.

Get the attachment, if any.

Returns:A

the attachment

getTypeback to summary
public Reference.Type getType()

Implements org.jboss.modules.ref.Reference.getType.

Doc from org.jboss.modules.ref.Reference.getType.

Get the type of the reference.

Returns:Reference.Type

the type

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.