APIdia Launch Partner
Top Description Fields Constructors Methods
sun.java2d

public abstract Class ReentrantContextProviderTL<K extends ReentrantContext>

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

This ReentrantContextProvider implementation uses a ThreadLocal to hold the first ReentrantContext per thread and a ReentrantContextProviderCLQ to store child ReentrantContext instances needed during recursion.

Note

this implementation may keep up to one context in memory per thread. Child contexts for recursive uses are stored in the queue using a WEAK reference by default unless specified in the 2 argument constructor.

Field Summary

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

Constructor Summary

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

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

public
ReentrantContextProviderTL(final int
reference type used by ThreadLocal
refTypeTL
,
final int
reference type used by ReentrantContextProviderCLQ
refTypeCLQ
)

Create a new ReentrantContext provider using the given reference types among hard, soft or weak

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

ctxProviderCLQback to summary
private final ReentrantContextProviderCLQ<K> ctxProviderCLQ
ctxTLback to summary
private final ThreadLocal<Reference<K>> ctxTL

Constructor Detail

ReentrantContextProviderTLback to summary
public ReentrantContextProviderTL(final int refType)

Create a new ReentrantContext provider using the given reference type among hard, soft or weak. It uses weak reference for the child contexts.

Parameters
refType:int

reference type

ReentrantContextProviderTLback to summary
public ReentrantContextProviderTL(final int refTypeTL, final int refTypeCLQ)

Create a new ReentrantContext provider using the given reference types among hard, soft or weak

Parameters
refTypeTL:int

reference type used by ThreadLocal

refTypeCLQ:int

reference type used by ReentrantContextProviderCLQ

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