|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.ThreadLocal<T>
com.atlassian.threadlocal.RegisteredThreadLocal<T>
public class RegisteredThreadLocal<T>
A ThreadLocal class that registers itself with RegisteredThreadLocals and hence
can be automatically cleaned up at the end of a request.
| Constructor Summary | |
|---|---|
RegisteredThreadLocal()
|
|
| Method Summary | |
|---|---|
protected T |
initialValue()
We use lazy registration so that any time this method or set(Object) is called
we register with this threads RegisteredThreadLocals. |
void |
set(T value)
|
protected T |
supplyInitialValue()
Alternate template method for supplying the initial value |
| Methods inherited from class java.lang.ThreadLocal |
|---|
get, remove |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RegisteredThreadLocal()
| Method Detail |
|---|
protected final T initialValue()
set(Object) is called
we register with this threads RegisteredThreadLocals.
But because this is a template method that we cant intercept we need to force you to supply the initial value via another template method.
Sorry about this. It smells but its the way it has to be.
initialValue in class java.lang.ThreadLocal<T>protected T supplyInitialValue()
public void set(T value)
set in class java.lang.ThreadLocal<T>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||