*/
public <T> T getContextFromResolver(Class<T> contextClass, RuntimeContext runtimeContext) {
if (runtimeContext == null) {
return null;
}
Providers providers = runtimeContext.getProviders();
if (providers != null) {
HttpHeaders httpHeaders = runtimeContext.getHttpHeaders();
MediaType mediaType = null;
if (httpHeaders != null) {
// this is hotfix for WINK-166
mediaType = httpHeaders.getMediaType();
}
if (mediaType == null) {
mediaType = MediaType.WILDCARD_TYPE;
}
ContextResolver<T> contextResolver =
providers.getContextResolver(contextClass, mediaType);
if (contextResolver != null) {
T context = contextResolver.getContext(contextClass);
if (context != null) {
return context;
}