Top Description Fields Constructors Methods
org.glassfish.grizzly.connectionpool

public final Class Link<E>

extends Object
Class Inheritance

The object represents an element, from which a minimalistic Chain is built. It is possible to attach or detach a Link from a Chain. When the Link is attached it contains a pointers to the previous and the next Links in the Chain, otherwise, if the Link is detached - the pointers values are null. If a Link is attached - it can only be attached to one Chain.
Author
Alexey Stashok

Field Summary

Modifier and TypeField and Description
private boolean
isAttached

attachment flag

private long
linkTimeStamp

The attachment timestamp, which shows the time when the link was attached.

pack-priv Link<E>
next

The pointer to the next link in the chain

pack-priv Link<E>
prev

The pointer to the previous link in the chain

private final E
value

The Link payload/value

Constructor Summary

AccessConstructor and Description

Method Summary

Modifier and TypeMethod and Description
pack-priv void
attach()

Attaches the Link to a Chain.

pack-priv void
detach()

Detaches the Link from a Chain.

public long
getAttachmentTimeStamp()

Returns: the timestamp, that represents the time (in milliseconds) when the Link was attached to a Chain, or -1 if the Link is not currently attached to a Chain.

public E
getValue()

Returns: the value held by this Link.

public boolean
isAttached()

Returns: true if the Link is currently attached to a Chain or false otherwise.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

isAttachedback to summary
private boolean isAttached

attachment flag

linkTimeStampback to summary
private long linkTimeStamp

The attachment timestamp, which shows the time when the link was attached.

nextback to summary
pack-priv Link<E> next

The pointer to the next link in the chain

prevback to summary
pack-priv Link<E> prev

The pointer to the previous link in the chain

valueback to summary
private final E value

The Link payload/value

Constructor Detail

Method Detail

attachback to summary
pack-priv void attach()

Attaches the Link to a Chain.

detachback to summary
pack-priv void detach()

Detaches the Link from a Chain.

getAttachmentTimeStampback to summary
public long getAttachmentTimeStamp()
Returns:long

the timestamp, that represents the time (in milliseconds) when the Link was attached to a Chain, or -1 if the Link is not currently attached to a Chain.

getValueback to summary
public E getValue()
Returns:E

the value held by this Link.

isAttachedback to summary
public boolean isAttached()
Returns:boolean

true if the Link is currently attached to a Chain or false otherwise.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override