public class ThreadLocalRecordCompressorFactory<A extends RecordCompressor> extends Object implements IRecordCompressorFactory<A>
IRecordCompressorFactory with thread-local semantics based on an
internal weak value cache and providing instances based on a delegate
IRecordCompressorFactory. This is designed to work well when the
application is single-threaded as well as when there are concurrent threads
demanding instances from the delegate factory.| Constructor and Description |
|---|
ThreadLocalRecordCompressorFactory(IRecordCompressorFactory<A> delegate) |
| Modifier and Type | Method and Description |
|---|---|
A |
getInstance()
Return an instance for use by the current thread.
|
protected A |
newInstance()
Return a new
IRecordCompressor instance from the delegate
IRecordCompressorFactory. |
public ThreadLocalRecordCompressorFactory(IRecordCompressorFactory<A> delegate)
delegate - The factory used to create instances of the
IRecordCompressor when there is none in the cache.public A getInstance()
getInstance in interface IRecordCompressorFactory<A extends RecordCompressor>protected A newInstance()
IRecordCompressor instance from the delegate
IRecordCompressorFactory.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.