public abstract class DoubleCheckedCreator<T>
extends java.lang.Object
ReadWriteLock| Modifier and Type | Field and Description |
|---|---|
protected org.slf4j.Logger |
logger |
protected java.util.concurrent.locks.Lock |
readLock |
protected java.util.concurrent.locks.Lock |
writeLock |
| Constructor and Description |
|---|
DoubleCheckedCreator() |
DoubleCheckedCreator(java.util.concurrent.locks.ReadWriteLock readWriteLock) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract T |
create(java.lang.Object... args) |
T |
get(java.lang.Object... args)
Double checking retrieval/creation of an object
|
protected boolean |
invalid(T value,
java.lang.Object... args)
The default impl returns true if value is null.
|
protected abstract T |
retrieve(java.lang.Object... args) |
protected final org.slf4j.Logger logger
protected final java.util.concurrent.locks.Lock readLock
protected final java.util.concurrent.locks.Lock writeLock
public DoubleCheckedCreator()
public DoubleCheckedCreator(java.util.concurrent.locks.ReadWriteLock readWriteLock)
protected abstract T create(java.lang.Object... args)
args - Arguments to use when creating the objectprotected abstract T retrieve(java.lang.Object... args)
args - Arguments to use when retrieving the objectprotected boolean invalid(T value, java.lang.Object... args)
value - The object to validateargs - Arguments to use when validating the objectpublic final T get(java.lang.Object... args)
args - Optional arguments to pass to retrieve(Object...), create(Object...), and invalid(Object, Object...).Copyright © 2009-2023 Apereo. All Rights Reserved.