ReferenceFactory<?> factory = manager.getReferenceFactory(name);
if (factory == null || ! factory.isResolved())
return null;
XmlConfigContext env = XmlConfigContext.getCurrent();
ContextHolder holder = _envLocal.get();
CreationalContextImpl<?> cxt = null;
if (holder != null && holder.isActive()) {
cxt = holder.getEnv();
if (cxt == null) {
cxt = new OwnerCreationalContext<Object>(null);
holder.setEnv(cxt);
}
}
if (cxt == null && env != null) {
cxt = (CreationalContextImpl<?>) env.getCreationalContext();
}
context.setPropertyResolved(true);
return factory.create(null, cxt, null);