@Override public void bind(final String name, final Object obj) throws NamingException { if ("inject".equalsIgnoreCase(name)) { inject(obj); } else { super.bind(name, obj); } }
@Override public Object lookup(final String userName) throws NamingException { String jndi = mapping.get(userName); if (jndi == null) { jndi = userName; } try { return super.lookup(jndi); } catch (final NameNotFoundException nnfe) { if (!jndi.startsWith("java:") && !jndi.startsWith("openejb:")) { // try jndi lookup try { final String ejb = "java:openejb/local/" + jndi; final Object lookup = super.lookup(ejb); mapping.put(userName, ejb); return lookup; } catch (final NameNotFoundException nnfeIgnored) { // resource try { final String resource = "java:openejb/Resource/" + jndi; final Object resourceInstance = super.lookup(resource); mapping.put(userName, resource); return resourceInstance; } catch (final NameNotFoundException nnfeIgnoredAgain) { throw nnfe; } } } throw nnfe; } } }
@Override public void bind(final String name, final Object obj) throws NamingException { if ("inject".equalsIgnoreCase(name)) { inject(obj); } else { super.bind(name, obj); } }
@Override public Object lookup(final Name name) throws NamingException { try { return super.lookup(name); } catch (final NameNotFoundException nnfe) { try { return SystemInstance.get().getComponent(ContainerSystem.class).getJNDIContext().lookup(name); } catch (final NameNotFoundException nnfe2) { // ignore, let it be thrown } throw nnfe; } }
@Override public void bind(String name, Object obj) throws NamingException { if ("inject".equalsIgnoreCase(name)) { inject(obj); } else { super.bind(name, obj); } }
@Override public Object lookup(final String name) throws NamingException { try { return super.lookup(name); } catch (final NameNotFoundException nnfe) { try { return SystemInstance.get().getComponent(ContainerSystem.class).getJNDIContext().lookup(name); } catch (final NameNotFoundException nnfe2) { // ignore, let it be thrown } throw nnfe; } } }
@Override public Object lookup(final Name name) throws NamingException { try { return super.lookup(name); } catch (final NameNotFoundException nnfe) { try { return SystemInstance.get().getComponent(ContainerSystem.class).getJNDIContext().lookup(name); } catch (final NameNotFoundException nnfe2) { // ignore, let it be thrown } throw nnfe; } }
@Override public Object lookup(final String name) throws NamingException { try { return super.lookup(name); } catch (final NameNotFoundException nnfe) { try { return SystemInstance.get().getComponent(ContainerSystem.class).getJNDIContext().lookup(name); } catch (final NameNotFoundException nnfe2) { // ignore, let it be thrown } throw nnfe; } } }