This method process lookup requests for java:

@param binding EJBBindings data
@param name JNDI lookup name
@param cmd Component meta data.
@return the EJB object instance.
@throws NamingException
174970
protected Object processJavaColon(EJBBinding binding, JavaColonNamespace jndiType, String lookupName) throws NamingException {

        Object instance = null;

        if (binding == null) {
            return null;
        }

        // Home and remote interfaces are not supported in Liberty
        if (binding.isHome() && !homeRuntime) {
            throwCannotInstanciateUnsupported(binding, jndiType, lookupName,
                                              "JNDI_CANNOT_INSTANTIATE_HOME_CNTR4008E");
        }

        if (!binding.isLocal && !remoteRuntime) {
            throwCannotInstanciateUnsupported(binding, jndiType, lookupName,
                                              "JNDI_CANNOT_INSTANTIATE_REMOTE_CNTR4009E");
        }

        try {
            EJSHome home = binding.homeRecord.getHomeAndInitialize();

            if (binding.isHome()) {
                EJSWrapperCommon wc = home.getWrapper();
                if (binding.isLocal) {
                    instance = wc.getLocalObject();
                } else {
                    instance = home.getContainer().getEJBRuntime().getRemoteReference(wc.getRemoteWrapper());
                }
            } else {
                // Use interface name to create the business object
                if (binding.isLocal) {
                    instance = home.createLocalBusinessObject(binding.interfaceIndex, null);
                } else {
                    instance = home.createRemoteBusinessObject(binding.interfaceIndex, null);
                }
            }
        } catch (Throwable t) {
            throwCannotInstanciateObjectException(binding,
                                                  jndiType,
                                                  lookupName,
                                                  t);
        }

        return instance;
    }
210295
public Reference getReference() throws NamingException
   {
      Reference ref =
         new Reference(BindableRepositoryImpl.class.getName(), BindableRepositoryFactory.class.getName(), null);
      ref.add(new StringRefAddr(BindableRepositoryFactory.REPOSITORYNAME_ADDRTYPE, delegatee.getConfiguration()
         .getName()));
      return ref;
   }
607109
public static cmppolicylabel_policybinding_binding[] get(nitro_service service, String labelname) throws Exception{
		cmppolicylabel_policybinding_binding obj = new cmppolicylabel_policybinding_binding();
		obj.set_labelname(labelname);
		cmppolicylabel_policybinding_binding response[] = (cmppolicylabel_policybinding_binding[]) obj.get_resources(service);
		return response;
	}
113241
public static synchronized ILoadBalancer getNamedLoadBalancer(String name) {
        ILoadBalancer lb = namedLBMap.get(name);
        if (lb != null) {
            return lb;
        } else {
            try {
                lb = registerNamedLoadBalancerFromclientConfig(name, getNamedConfig(name));
            } catch (ClientException e) {
                throw new RuntimeException("Unable to create load balancer", e);
            }
            namedLBMap.put(name, lb);
            return lb;
        }
    }
1255695
public void setNamedBindings(Map<String, Object> namedBindings) {
    if (namedBindings == null) {
      throw new IllegalArgumentException("namedBindings cannot be null");
    }
    this.namedBindings = namedBindings;
  }
796747
public ParameterBinding getBindingFor(String name) {

        Assert.hasText(name, PARAMETER_NAME_MISSING);

        for (ParameterBinding binding : bindings) {
            if (binding.hasName(name)) {
                return binding;
            }
        }

        throw new IllegalArgumentException(String.format("No parameter binding found for name %s!", name));
    }
940554
public synchronized void addAppBinding(ModuleMetaData mmd, String name, EJBBinding bindingObject) {

        Lock writeLock = javaColonLock.writeLock();
        writeLock.lock();

        try {
            JavaColonNamespaceBindings<EJBBinding> bindings = getAppBindingMap(mmd.getApplicationMetaData());
            bindings.bind(name, bindingObject);
        } finally {
            writeLock.unlock();
        }
    }
1247135
@Override
    public Object lookup(String name)
    {
        // Note: this context method is allowed from all bean methods,
        //       except the constructor... which has not way to access
        //       the context.  Therefore, no 'state' checking needs
        //       to be performed... just validate the parameter.
        if (name == null)
            throw new IllegalArgumentException("null 'name' parameter.");

        Object result = null;

        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(tc, "lookup: " + name);

        // Previously, this method used Naming for comp/env, which tolerated the
        // 'name' starting with 'java:comp/env/', but that is NOT part of the
        // name in our map.                                                d473811
        String lookupName = name;
        if (name.startsWith("java:comp/env/")) // F743-609 remove useless null check
        {
            lookupName = name.substring(14);
        }

        // -----------------------------------------------------------------------
        // Rather than perform a lookup using Naming, the InjectionBinding
        // that was created during populateJavaNameSpace will be located
        // and used to obtain/create the result object, just like it
        // would be done for injection.                                    d473811
        // -----------------------------------------------------------------------

        InjectionBinding<?> binding = home.beanMetaData.ivJavaColonCompEnvMap.get(lookupName);

        if (binding != null)
        {
            try
            {
                result = binding.getInjectionObject();
            } catch (InjectionException ex)
            {
                FFDCFilter.processException(ex, CLASS_NAME + ".lookup",
                                            "1342", this);
                IllegalArgumentException iae = new IllegalArgumentException
                                ("Failure occurred obtaining object for " + name +
                                 " reference defined for " + home.beanMetaData.j2eeName, ex);

                if (isTraceOn && tc.isEntryEnabled())
                    Tr.exit(tc, "lookup: " + iae);

                throw iae;
            }
        }
        else
        {
            result = container.getEJBRuntime().javaColonLookup(name, home);
        }

        if (isTraceOn && tc.isEntryEnabled())
            Tr.exit(tc, "lookup: " + result.getClass().getName());

        return result;
    }
509655
public static policystringmap_binding get(nitro_service service, String name) throws Exception{
		policystringmap_binding obj = new policystringmap_binding();
		obj.set_name(name);
		policystringmap_binding response = (policystringmap_binding) obj.get_resource(service);
		return response;
	}
1284202
private Object processJavaColonGlobal(String name) throws NamingException {
        // Called to ensure that the java:global lookup code path
        // is coming from a Java EE thread. If not this will reject the
        // lookup with the correct Java EE error message.
        getComponentMetaData(JavaColonNamespace.GLOBAL, name);
        Lock readLock = javaColonLock.readLock();
        readLock.lock();

        EJBBinding binding;
        try {
            binding = javaColonGlobalBindings.lookup(name);
        } finally {
            readLock.unlock();
        }

        return processJavaColon(binding, JavaColonNamespace.GLOBAL, name);
    }
183732
private void unbind(String jndiName) throws NamingException {
        InitialContext initialContext = new InitialContext();
        initialContext.unbind(jndiName);
    }
1369251
public static service_binding get(nitro_service service, String name) throws Exception{
		service_binding obj = new service_binding();
		obj.set_name(name);
		service_binding response = (service_binding) obj.get_resource(service);
		return response;
	}
279826
public TBinding getBindingFromInterfaceName(TDefinitions descriptionType, String interfaceName)
    {
        for (TDocumented nextElement : descriptionType.getAnyTopLevelOptionalElement())
        {
            // Create the service type
            if (nextElement instanceof TBinding)
            {
                QName qname = ((TBinding)nextElement).getType();
                if (interfaceName.equalsIgnoreCase(qname.getLocalPart()))
                    return (TBinding)nextElement;
            }
        }
        return null;
    }
575665
@SuppressWarnings("unchecked")
	public static <T> T lookup(String name) {
		try {
			return (T) new InitialContext().lookup(name);
		} catch (NamingException e) {
			throw new IllegalStateException(e);
		}
	}
618015
public static ComponentMetaData getComponentMetaData(JavaColonNamespace namespace, String name) throws NamingException {
        ComponentMetaData cmd = ComponentMetaDataAccessorImpl.getComponentMetaDataAccessor().getComponentMetaData();
        if (cmd == null) {
            String fullName = name.isEmpty() ? namespace.toString() : namespace + "/" + name;
            String msg = Tr.formatMessage(tc, "JNDI_NON_JEE_THREAD_CWWKN0100E", fullName);
            NamingException nex = new NamingException(msg);
            throw nex;
        }
        return cmd;
    }
572118
protected Method findEjbMethod(Method controlBeanMethod, Class ejbInterface) {
        final String cbMethodName = controlBeanMethod.getName();
        final Class cbMethodReturnType = controlBeanMethod.getReturnType();
        final Class[] cbMethodParams = controlBeanMethod.getParameterTypes();

        Method[] ejbMethods = ejbInterface.getMethods();
        for (Method m : ejbMethods) {
            if (!cbMethodName.equals(m.getName())
                    || !cbMethodReturnType.equals(m.getReturnType())) {
                continue;
            }

            Class[] params = m.getParameterTypes();
            if (cbMethodParams.length == params.length) {
                int i;
                for (i = 0; i < cbMethodParams.length; i++) {
                    if (cbMethodParams[i] != params[i]) break;
                }
                if (i == cbMethodParams.length)
                    return m;
            }
        }
        return null;
    }
243311
protected static void lookupFieldResource(javax.naming.Context context,
            Object instance, Field field, String name)
            throws NamingException, IllegalAccessException
    {

        Object lookedupResource;

        if ((name != null) && (name.length() > 0))
        {
            // TODO local or global JNDI
            lookedupResource = context.lookup(JAVA_COMP_ENV + name);
        }
        else
        {
            // TODO local or global JNDI 
            lookedupResource = context.lookup(JAVA_COMP_ENV + instance.getClass().getName() + "/" + field.getName());
        }

        boolean accessibility = field.isAccessible();
        field.setAccessible(true);
        field.set(instance, lookedupResource);
        field.setAccessible(accessibility);
    }