org.apache.avalon.excalibur.lang
Interface ThreadContextPolicy
- All Known Implementing Classes:
- DefaultThreadContextPolicy
- public interface ThreadContextPolicy
The ThreadContextPolicy
determines the policy with
which items can be added to context. It determines what to do with
values when ThreadContext
is activated and deactivated.
It also determines if a variable can be set.
This interface is expected to be used as a Flyweight object.
- Author:
- Peter Donald
Field Summary |
static java.lang.String |
CLASSLOADER
Key used to store ContextClassLoader in ThreadContextAccessor. |
Method Summary |
void |
activate(ThreadContextAccessor accessor)
The activate method is called when the ThreadContext
is associated with a thread. |
void |
deactivate(ThreadContextAccessor accessor)
The deactivate method is called when the ThreadContext is
dis-associated with a thread. |
void |
verifyKeyValue(java.lang.String key,
java.lang.Object value)
Verify that the key/value pair is valid. |
CLASSLOADER
public static final java.lang.String CLASSLOADER
- Key used to store
ContextClassLoader
in ThreadContextAccessor.
activate
public void activate(ThreadContextAccessor accessor)
- The activate method is called when the ThreadContext
is associated with a thread.
- Parameters:
accessor
- the accessor to retrieve values from ThreadContext
deactivate
public void deactivate(ThreadContextAccessor accessor)
- The deactivate method is called when the ThreadContext is
dis-associated with a thread.
- Parameters:
accessor
- the accessor to retrieve values from ThreadContext
verifyKeyValue
public void verifyKeyValue(java.lang.String key,
java.lang.Object value)
throws java.lang.IllegalArgumentException
- Verify that the key/value pair is valid.
- Parameters:
key
- The keyvalue
- the value- Throws:
java.lang.IllegalArgumentException
- if pair is not valid
Copyright © 2001 Apache Jakarta Project. All Rights Reserved.