public final class Resteasy extends Object
Provides a layer of indirection to abstract invocations to Resteasy internal APIs. Making also possible to use different versions of Resteasy (e.g.: v3 and v4) depending on the stack that the server is running.
The methods herein provided are basically related with accessing context data from Resteasy, which changed in latest versions of Resteasy.
It is important to use this class when access to context data is necessary in order to avoid incompatibilities with future versions of Resteasy.
Constructor and Description |
---|
Resteasy() |
Modifier and Type | Method and Description |
---|---|
static void |
clearContextData()
Clear the Resteasy context associated with the current thread.
|
static <R> R |
getContextData(Class<R> type)
Lookup the instance associated with the given type/key
type from the Resteasy context associated with the current thread. |
static ResteasyProvider |
getProvider() |
static void |
pushContext(Class type,
Object instance)
Push the given
instance with type/key type to the Resteasy context associated with the current thread. |
static void |
pushDefaultContextObject(Class type,
Object instance)
Push the given
instance with type/key type to the Resteasy global context. |
public static ResteasyProvider getProvider()
public static void pushContext(Class type, Object instance)
instance
with type/key type
to the Resteasy context associated with the current thread.type
- the type/key to associate the instance
withinstance
- the instancepublic static <R> R getContextData(Class<R> type)
type
from the Resteasy context associated with the current thread.type
- the type/key to lookuptype
or null if non-existent.public static void clearContextData()
Copyright © 2021 JBoss by Red Hat. All rights reserved.