Top Description Fields Constructors Methods
sun.java2d

public abstract Class ReentrantContextProviderCLQ<K extends ReentrantContext>

extends ReentrantContextProvider<K extends ReentrantContext>
Class Inheritance
Type Parameters
<K>
ReentrantContext subclass
Imports
java.lang.ref.Reference, java.util.concurrent.ConcurrentLinkedQueue

This ReentrantContextProvider implementation uses one ConcurrentLinkedQueue to store all ReentrantContext instances (thread and its child contexts) Note: this implementation keeps less contexts in memory depending on the concurrent active threads in contrary to a ThreadLocal provider. However, it is slower in highly concurrent workloads.

Field Summary

Modifier and TypeField and Description
private final ConcurrentLinkedQueue<Reference<K>>
Inherited from sun.java2d.ReentrantContextProvider:
REF_HARDREF_SOFTREF_WEAKUSAGE_CLQUSAGE_TL_IN_USEUSAGE_TL_INACTIVE

Constructor Summary

AccessConstructor and Description
public
ReentrantContextProviderCLQ(final int
reference type
refType
)

Create a new ReentrantContext provider using the given reference type among hard, soft or weak based using a ConcurrentLinkedQueue storage

Method Summary

Modifier and TypeMethod and Description
public final K

Returns:

ReentrantContext instance
acquire
()

Implements abstract sun.java2d.ReentrantContextProvider.acquire.

Give a ReentrantContext instance for the current thread
public final void
release(final K
ReentrantContext instance
ctx
)

Implements abstract sun.java2d.ReentrantContextProvider.release.

Restore the given ReentrantContext instance for reuse
Inherited from sun.java2d.ReentrantContextProvider:
getOrCreateReferencenewContext

Field Detail

ctxQueueback to summary
private final ConcurrentLinkedQueue<Reference<K>> ctxQueue

Constructor Detail

ReentrantContextProviderCLQback to summary
public ReentrantContextProviderCLQ(final int refType)

Create a new ReentrantContext provider using the given reference type among hard, soft or weak based using a ConcurrentLinkedQueue storage

Parameters
refType:int

reference type

Method Detail

acquireback to summary
public final K acquire()

Implements abstract sun.java2d.ReentrantContextProvider.acquire.

Give a ReentrantContext instance for the current thread

Returns:K

ReentrantContext instance

Annotations
@Override
releaseback to summary
public final void release(final K ctx)

Implements abstract sun.java2d.ReentrantContextProvider.release.

Restore the given ReentrantContext instance for reuse

Parameters
ctx:K

ReentrantContext instance

Annotations
@Override