public final class Contexts
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static void |
bind(Exchange exchange) |
static void |
bind(Exchange exchange,
java.util.Collection<java.lang.Class<?>> types)
Using a set ensures we don't set the thread local twice or more,
there may be super classes with injection points of identical types
Also allows us to get context references from other sources such as interceptors
|
static <T> T |
find(java.lang.Class<T> clazz) |
static java.util.Collection<java.lang.Class<?>> |
findContextFields(java.lang.Class<?> cls,
java.util.Collection<java.lang.Class<?>> types) |
static java.lang.Object |
restore(java.lang.Object oldState) |
static java.lang.Object |
state() |
public static java.util.Collection<java.lang.Class<?>> findContextFields(java.lang.Class<?> cls, java.util.Collection<java.lang.Class<?>> types)
public static void bind(Exchange exchange)
public static void bind(Exchange exchange, java.util.Collection<java.lang.Class<?>> types)
exchange
- Exchangetypes
- Collectionpublic static <T> T find(java.lang.Class<T> clazz)
public static java.lang.Object state()
public static java.lang.Object restore(java.lang.Object oldState)