private class ContextLocal.Wrapper extends java.lang.Object implements Cleanable
cleanup()
method, which the current security context will
invoke at the end of its life. Only one instance of this class is
created per context, per variable, the first time a value needs to be
stored. Thereafter, each time the variable's value is updated, the
contents of this wrapper are merely reset.Modifier and Type | Field and Description |
---|---|
private boolean |
cleaning
Flag indicating we are in cleanup mode
|
private T |
contents
Data value stored by this context local variable
|
Constructor and Description |
---|
Wrapper(T contents)
Convenience constructor which assigns contents.
|
Modifier and Type | Method and Description |
---|---|
private void |
checkCleaning()
Throw an exception indicating a get or set attempt was made during context cleanup.
|
void |
cleanup()
Invoked at security context end of life.
|
(package private) T |
get()
Get the contents of the context local variable.
|
(package private) void |
set(T contents)
Set the contents of the context local variable.
|
private T contents
private boolean cleaning
Wrapper(T contents)
contents
- Data value stored by this context local variablepublic void cleanup()
cleanup
method, to give subclasses a chance to perform housekeeping.T get()
ContextLocalCleanupException
- if this method is invoked during context cleanup.void set(T contents)
contents
- Contents to be stored in the variable.ContextLocalCleanupException
- if this method is invoked during context cleanup.private void checkCleaning()
ContextLocalCleanupException
- always.