use of org.apache.cxf.jaxrs.model.AbstractResourceInfo in project cxf by apache.
the class ServerProviderFactory method injectApplicationIntoFeature.
protected void injectApplicationIntoFeature(Feature feature) {
if (application != null) {
AbstractResourceInfo info = new AbstractResourceInfo(feature.getClass(), ClassHelper.getRealClass(feature), true, true, getBus()) {
@Override
public boolean isSingleton() {
return false;
}
};
Method contextMethod = info.getContextMethods().get(Application.class);
if (contextMethod != null) {
InjectionUtils.injectThroughMethod(feature, contextMethod, application.getProvider());
return;
}
for (Field contextField : info.getContextFields()) {
if (Application.class == contextField.getType()) {
InjectionUtils.injectContextField(info, contextField, feature, application.getProvider());
break;
}
}
}
}
Aggregations