Return <code>EJBHome</code> instance associated with
this <code>BeanO</code>. <p>
6759
@Override
    public EJBHome getEJBHome()
    {
        try
        {
            EJSWrapper wrapper = home.getWrapper().getRemoteWrapper();
            Object wrapperRef = container.getEJBRuntime().getRemoteReference(wrapper);

            // The EJB spec does not require us to narrow to the actual home
            // interface, but since we have to narrow to EJBHome anyway, we
            // might as well narrow to the specific interface.  It seems like it
            // might be an oversight anyway given that the spec does require
            // SessionContext.getEJBObject to narrow.
            return (EJBHome) PortableRemoteObject.narrow(wrapperRef, home.beanMetaData.homeInterfaceClass);
        } catch (IllegalStateException ise) { // d116480
            // FFDC not logged for this spec required scenario
            throw ise;
        } catch (Exception ex) {
            // p97440 - start of change

            // This should never happen. Something is wrong.
            // Need to throw a runtime exception since this is a
            // Java EE architected interface that does not allow a checked
            // exceptions to be thrown. So, throw ContainerEJBException.
            FFDCFilter.processException(ex, CLASS_NAME + ".getEJBHome", "522", this);
            ContainerEJBException ex2 = new ContainerEJBException("Failed to get the wrapper for home.", ex);

            Tr.error(tc
                     , "CAUGHT_EXCEPTION_THROWING_NEW_EXCEPTION_CNTR0035E"
                     , new Object[] { ex, ex2.toString() }); // d194031

            throw ex2;

            // p97440 - end of change
        }

    }
817513
public static <T> T instance(Class<T> superClass) {
		// check overriden map first
		if (map.get(superClass) != null) {
			return (T) JK.newInstance(map.get(superClass));
		}
		try {
			return (T) context.getBean(superClass);
		} catch (NoSuchBeanDefinitionException ex) {
			// no bean difinition is there, so lets try to see of the class is already
			// concrete and
			// can be qualified to be returned
			if (!Modifier.isAbstract(superClass.getModifiers())) {
				return JK.newInstance(superClass.getName());
			} else {
				throw ex;
			}
		} catch (RuntimeException e) {
			dumpBeansNames();
			throw e;
		}
	}
1213562
public EjbRefType<WebAppDescriptor> getOrCreateEjbRef()
   {
      List<Node> nodeList = model.get("ejb-ref");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new EjbRefTypeImpl<WebAppDescriptor>(this, "ejb-ref", model, nodeList.get(0));
      }
      return createEjbRef();
   }
225954
public BeanId getBeanId() {
        final byte[] rowkey = getRowKey();
        final byte[] sid = new byte[] { rowkey[0], rowkey[1] };
        final byte[] iid = new byte[] { rowkey[2], rowkey[3], rowkey[4], rowkey[5] };
        final String schemaName = uids.getUsid().getName(sid);
        final String instanceId = uids.getUiid().getName(iid);

        if (Strings.isNullOrEmpty(schemaName)) {
            throw new IllegalStateException("Could not lookup schema name from sid "
                    + Arrays.toString(sid));
        }
        if (Strings.isNullOrEmpty(instanceId)) {
            throw new IllegalStateException("Could not lookup instance id from iid "
                    + Arrays.toString(iid));
        }
        return BeanId.create(instanceId, schemaName);
    }
1088602
@Override
    public EJBLocalHome getEJBLocalHome() //d116376
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            Tr.debug(tc, "getEJBLocalHome");
        Tr.error(tc, "METHOD_NOT_ALLOWED_CNTR0047E",
                 "MessageDrivenBeanO.getEJBLocalHome()");
        throw new IllegalStateException("Method Not Allowed Exception: See Message-drive Bean Component Contract section of the applicable EJB Specification.");
    }
1154719
private BeanO[] getBeanOs()
    {
        BeanO result[];
        result = new BeanO[ivBeanOs.size()];
        Iterator<BeanO> iter = ivBeanOs.values().iterator();
        int i = 0;
        while (iter.hasNext()) {
            result[i++] = iter.next();
        }
        return result;
    }
479708
public BeanId getBeanId() {
        if (ivBeanId == null) {
            ivBeanId = new BeanId(ivBMD.j2eeName, null, false);
        }
        return ivBeanId;
    }
1119899
protected <T> ManagedObjectFactory<T> getInterceptorManagedObjectFactory(BeanMetaData bmd, Class<T> klass) throws EJBConfigurationException {
        ManagedObjectFactory<T> factory = null;
        ManagedObjectService managedObjectService = getManagedObjectService();
        if (managedObjectService != null) {
            try {
                factory = managedObjectService.createInterceptorManagedObjectFactory(bmd._moduleMetaData, klass);
                //TODO the isManaged method could be moved to the ManagedObjectService and then wouldn't need to create the factory
                if (!factory.isManaged()) {
                    factory = null;
                }
            } catch (ManagedObjectException e) {
                throw new EJBConfigurationException(e);
            }
        }

        return factory;
    }
841722
@Override
    public BeanMetaData getBeanMetaData(Object homeKey)
    {
        HomeRecord hr = homesByName.get(homeKey); // d366845.3
        return hr.bmd;
    }
1229994
@Override
    protected T createInstance() throws Exception {
        for (final String beanName : this.delegateBeanNames) {
            try {
                final T bean;
                if (this.type == null) {
                    bean = (T) this.getBeanFactory().getBean(beanName);
                } else {
                    bean = this.getBeanFactory().getBean(beanName, this.type);
                }

                if (this.logger.isInfoEnabled()) {
                    this.logger.info("Loaded bean for name " + beanName);
                }

                return bean;
            } catch (final Exception e) {
                final String msg =
                        "Failed to load bean '"
                                + beanName
                                + "' from ApplicationContext"
                                + (this.type != null ? " expecting type: " + this.type : "")
                                + ". Will try to load the next bean in the list instead. Error message from the attempt to load this bean ('"
                                + beanName
                                + "'): ";

                if (this.logger.isDebugEnabled()) {
                    this.logger.debug(msg, e);
                } else if (this.logger.isInfoEnabled()) {
                    this.logger.info(
                            msg + " " + e.getMessage() + " (enable debug for stack trace)");
                }
            }
        }

        throw new BeanCreationException(
                "None of the configured bean names could be loaded. BeanNames: "
                        + this.delegateBeanNames);
    }
801608
public FacesConfigManagedBeanType<WebFacesConfigDescriptor> getOrCreateManagedBean()
   {
      List<Node> nodeList = model.get("managed-bean");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new FacesConfigManagedBeanTypeImpl<WebFacesConfigDescriptor>(this, "managed-bean", model, nodeList.get(0));
      }
      return createManagedBean();
   }
611264
public <T> InternalEjbDescriptor<T> get(String beanName) {
        return cast(ejbByName.get(beanName));
    }
97883
@Override
    @SuppressWarnings("unchecked")
    public P get(Bean bean) {
        return (P) getter.get(bean);
    }
764318
public FacesConfigReferencedBeanType<FacesConfigType<T>> getOrCreateReferencedBean()
   {
      List<Node> nodeList = childNode.get("referenced-bean");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new FacesConfigReferencedBeanTypeImpl<FacesConfigType<T>>(this, "referenced-bean", childNode, nodeList.get(0));
      }
      return createReferencedBean();
   }
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;
    }
1182061
protected Bean<?> getUniqueBeanByBeanName(BeanManager bm, String batchId) {
        Bean<?> match = null;

        // Get all beans with the given EL name (id).  EL names are applied via @Named.
        // If the bean is not annotated with @Named, then it does not have an EL name
        // and therefore can't be looked up that way.  
        Set<Bean<?>> beans = bm.getBeans(batchId);

        try {
            match = bm.resolve(beans);
        } catch (AmbiguousResolutionException e) {
            return null;
        }
        return match;
    }
1692
public EjbRefType<WebFragmentType<T>> getOrCreateEjbRef()
   {
      List<Node> nodeList = childNode.get("ejb-ref");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new EjbRefTypeImpl<WebFragmentType<T>>(this, "ejb-ref", childNode, nodeList.get(0));
      }
      return createEjbRef();
   }