Package org.keycloak.common.util
Class Resteasy
- java.lang.Object
- 
- org.keycloak.common.util.Resteasy
 
- 
 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. - Author:
- Pedro Igor
 
- 
- 
Constructor SummaryConstructors Constructor Description Resteasy()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static voidclearContextData()Clear the Resteasy context associated with the current thread.static <R> RgetContextData(Class<R> type)Lookup the instance associated with the given type/keytypefrom the Resteasy context associated with the current thread.static ResteasyProvidergetProvider()static voidpushContext(Class type, Object instance)Push the giveninstancewith type/keytypeto the Resteasy context associated with the current thread.static voidpushDefaultContextObject(Class type, Object instance)Push the giveninstancewith type/keytypeto the Resteasy global context.
 
- 
- 
- 
Method Detail- 
getProviderpublic static ResteasyProvider getProvider() 
 - 
pushContextpublic static void pushContext(Class type, Object instance) Push the giveninstancewith type/keytypeto the Resteasy context associated with the current thread.- Parameters:
- type- the type/key to associate the- instancewith
- instance- the instance
 
 - 
getContextDatapublic static <R> R getContextData(Class<R> type) Lookup the instance associated with the given type/keytypefrom the Resteasy context associated with the current thread.- Parameters:
- type- the type/key to lookup
- Returns:
- the instance associated with the given typeor null if non-existent.
 
 - 
clearContextDatapublic static void clearContextData() Clear the Resteasy context associated with the current thread.
 
- 
 
-