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() |
DoubleCheckedCreator(ReadWriteLock readWriteLock) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract T |
create(Object... args) |
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) |
protected final org.apache.commons.logging.Log logger
protected final Lock readLock
protected final Lock writeLock
public DoubleCheckedCreator()
public DoubleCheckedCreator(ReadWriteLock readWriteLock)
protected abstract T create(Object... args)
args - Arguments to use when creating the objectprotected abstract T retrieve(Object... args)
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 © 2014 Jasig. All Rights Reserved.