use of org.glassfish.hk2.utilities.InjecteeImpl in project jersey by jersey.
the class InjectionResolverWrapper method resolve.
@Override
public Object resolve(Injectee injectee, ServiceHandle root) {
InjecteeImpl injecteeWrapper = new InjecteeImpl();
injecteeWrapper.setRequiredType(injectee.getRequiredType());
injecteeWrapper.setParent(injectee.getParent());
injecteeWrapper.setRequiredQualifiers(injectee.getRequiredQualifiers());
injecteeWrapper.setOptional(injectee.isOptional());
injecteeWrapper.setPosition(injectee.getPosition());
injecteeWrapper.setFactory(ReflectionHelper.isSubClassOf(injectee.getRequiredType(), Factory.class));
injecteeWrapper.setInjecteeDescriptor(new ForeignDescriptorImpl(injectee.getInjecteeDescriptor()));
Object instance = jerseyResolver.resolve(injecteeWrapper);
if (injecteeWrapper.isFactory()) {
return asFactory(instance);
} else {
return instance;
}
}
use of org.glassfish.hk2.utilities.InjecteeImpl in project jersey by jersey.
the class ContextInjectionResolverImpl method resolve.
/**
* Jersey Injection Resolver method that just populate HK2 injectee object and delegates the processing to HK2 Injection
* Resolver.
*
* @param injectee The injection point this value is being injected into
* @return result of the injection processing.
*/
@Override
public Object resolve(org.glassfish.jersey.internal.inject.Injectee injectee) {
InjecteeImpl hk2injectee = new InjecteeImpl() {
@Override
public Class<?> getInjecteeClass() {
return injectee.getInjecteeClass();
}
};
hk2injectee.setRequiredType(injectee.getRequiredType());
hk2injectee.setRequiredQualifiers(injectee.getRequiredQualifiers());
if (injectee.getInjecteeDescriptor() != null) {
hk2injectee.setInjecteeDescriptor((ActiveDescriptor<?>) injectee.getInjecteeDescriptor().get());
}
// Delegate the call to HK2 Resolver, Service Handle is not need in the delegated processing.
return resolve(hk2injectee, null);
}
Aggregations