use of org.apache.cxf.jaxrs.ext.ResourceContextProvider in project tomee by apache.
the class ResourceContextImpl method getResource.
@Override
public <T> T getResource(Class<T> cls) {
final ResourceProvider rp;
Object propValue = m.getContextualProperty(CONTEXT_PROVIDER_PROP);
if (propValue instanceof ResourceContextProvider) {
rp = ((ResourceContextProvider) propValue).getResourceProvider(cls);
} else {
rp = new PerRequestResourceProvider(cls);
}
T resource = cls.cast(rp.getInstance(m));
return doInitResource(cls, resource);
}
use of org.apache.cxf.jaxrs.ext.ResourceContextProvider in project cxf by apache.
the class ResourceContextImpl method getResource.
@Override
public <T> T getResource(Class<T> cls) {
ResourceProvider rp = null;
Object propValue = m.getContextualProperty(CONTEXT_PROVIDER_PROP);
if (propValue instanceof ResourceContextProvider) {
rp = ((ResourceContextProvider) propValue).getResourceProvider(cls);
} else {
rp = new PerRequestResourceProvider(cls);
}
T resource = cls.cast(rp.getInstance(m));
return doInitResource(cls, resource);
}
Aggregations