Top Description Fields Constructors Methods
org.keycloak.common.util

public final Class Resteasy

extends Object
Class Inheritance
Imports
java.util.ServiceLoader

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.

Author
Pedro Igor

Field Summary

Modifier and TypeField and Description
private static ResteasyProvider

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static void
clearContextData()

Clear the Resteasy context associated with the current thread.

public static <R> R

Returns:

the instance associated with the given type or null if non-existent.
getContextData
(Class<R>
the type/key to lookup
type
)

Lookup the instance associated with the given type/key type from the Resteasy context associated with the current thread.

public static ResteasyProvider
public static void
pushContext(Class<T>
the type/key to associate the instance with
type
,
Object
the instance
instance
)

Push the given instance with type/key type to the Resteasy context associated with the current thread.

public static void
pushDefaultContextObject(Class<T>
the type/key to associate the instance with
type
,
Object
the instance
instance
)

Push the given instance with type/key type to the Resteasy global context.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

providerback to summary
private static ResteasyProvider provider

Constructor Detail

Resteasyback to summary
public Resteasy()

Method Detail

clearContextDataback to summary
public static void clearContextData()

Clear the Resteasy context associated with the current thread.

getContextDataback to summary
public 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.

Parameters
type:Class<R>

the type/key to lookup

Returns:R

the instance associated with the given type or null if non-existent.

getProviderback to summary
public static ResteasyProvider getProvider()
pushContextback to summary
public static void pushContext(Class<T> type, Object instance)

Push the given instance with type/key type to the Resteasy context associated with the current thread.

Parameters
type:Class<T>

the type/key to associate the instance with

instance:Object

the instance

pushDefaultContextObjectback to summary
public static void pushDefaultContextObject(Class<T> type, Object instance)

Push the given instance with type/key type to the Resteasy global context.

Parameters
type:Class<T>

the type/key to associate the instance with

instance:Object

the instance