final NamingContext storeBaseContext = new NamingContext(value, null);
final ManagedReferenceFactory factory = new ManagedReferenceFactory() {
@Override
public ManagedReference getReference() {
try {
return new ImmediateManagedReference(storeBaseContext.lookup(getBindName()));
} catch (NamingException e) {
if(!optional) {
throw NamingLogger.ROOT_LOGGER.resourceLookupForInjectionFailed(getAbsoluteJndiName(), e);
} else {
NamingLogger.ROOT_LOGGER.tracef(e,"failed to lookup %s", getAbsoluteJndiName());