private Reference buildReferenceLocation(ReferenceLocationInfo location) { if (location.jndiProviderId != null){ String subContextName = "openejb/remote_jndi_contexts/" + location.jndiProviderId; return new JndiReference(subContextName, location.jndiName); } else { return new JndiUrlReference(location.jndiName); } }
private void handleJndiUrlReference(Object value, ReferenceType ReferenceType, Map<JndiKey, Map<String, Object>> moduleJndiContext, Map<String, Set<InjectionTarget>> injectionsMap, Map<EARContext.Key, Object> sharedContext) { if (!(value instanceof JndiUrlReference)) { return; } String name = ((JndiUrlReference) value).getJndiName(); if (name.startsWith("java:")) { name = name.charAt(5) == '/' ? name.substring("java:/".length()) : name.substring("java:".length()); } Object valueToConvert = null; if (moduleJndiContext.get(JndiScope.app).containsKey(name)) { valueToConvert = moduleJndiContext.get(JndiScope.app).get(name); } else { return; } valueToConvert = createClientRef(valueToConvert); name = "java:" + name; Set<InjectionTarget> injections = injectionsMap.get(name); if (injections == null) { injections = Collections.emptySet(); } put(name, valueToConvert, ReferenceType, moduleJndiContext, injections, sharedContext); }
.lookup(((JndiUrlReference) value).getJndiName()); } catch (final NamingException e1) { value = null;
private Reference buildReferenceLocation(final ReferenceLocationInfo location) { if (location.jndiProviderId != null) { final String subContextName = "openejb/remote_jndi_contexts/" + location.jndiProviderId; return new JndiReference(subContextName, location.jndiName); } else { return new JndiUrlReference(location.jndiName); } }
try { value = SystemInstance.get().getComponent(ContainerSystem.class).getJNDIContext() .lookup(((JndiUrlReference) value).getJndiName()); } catch (final NamingException e1) { value = null;
private Reference buildReferenceLocation(final ReferenceLocationInfo location) { if (location.jndiProviderId != null) { final String subContextName = "openejb/remote_jndi_contexts/" + location.jndiProviderId; return new JndiReference(subContextName, location.jndiName); } else { return new JndiUrlReference(location.jndiName); } }
} catch (final Exception e) { // surely too early, let's try some known locations if (JndiUrlReference.class.isInstance(lookup)) { checkBuiltInResourceTypes(reference, JndiUrlReference.class.cast(lookup).getJndiName());