public abstract class DoubleCheckedCreator<T> extends Object
ReadWriteLock| Modifier and Type | Field and Description |
|---|---|
protected org.apache.commons.logging.Log |
logger |
protected Lock |
readLock |
protected Lock |
writeLock |
| Constructor and Description |
|---|
DoubleCheckedCreator()
Constructor for DoubleCheckedCreator.
|
DoubleCheckedCreator(ReadWriteLock readWriteLock)
Constructor for DoubleCheckedCreator.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract T |
create(Object... args)
create.
|
T |
get(Object... args)
Double checking retrieval/creation of an object
|
protected boolean |
invalid(T value,
Object... args)
The default impl returns true if value is null.
|
protected abstract T |
retrieve(Object... args)
retrieve.
|
protected final org.apache.commons.logging.Log logger
protected final Lock readLock
protected final Lock writeLock
public DoubleCheckedCreator()
Constructor for DoubleCheckedCreator.
public DoubleCheckedCreator(ReadWriteLock readWriteLock)
Constructor for DoubleCheckedCreator.
readWriteLock - a ReadWriteLock object.protected abstract T create(Object... args)
create.
args - Arguments to use when creating the objectprotected abstract T retrieve(Object... args)
retrieve.
args - Arguments to use when retrieving the objectprotected boolean invalid(T value, Object... args)
value - The object to validateargs - Arguments to use when validating the objectpublic final T get(Object... args)
args - Optional arguments to pass to retrieve(Object...), create(Object...), and invalid(Object, Object...).Copyright © 2023 Jasig, Inc.. All rights reserved.