class ContextsJaxrsService {

    protected Class<?> getContextClass(MediaType mediaType) {
        Class<?> contextClass = contextsManager.getContextDescriptionClass(getType(mediaType));
        if (contextClass == null) {
            throw new WebApplicationException(Response.Status.UNSUPPORTED_MEDIA_TYPE);
        }
        return contextClass;
    }

}