public EJSWrapperCommon createBusinessObjectWrappers(ManagedObjectContext context)
                    throws CreateException,
                    RemoteException
    {
        homeEnabled();
        EJSWrapperCommon result = null;

        //------------------------------------------------------------------------
        // This is the method used by stateless session beans home create methods
        // to check and see if their singleton wrapper is already registered.
        //------------------------------------------------------------------------

        if ((ivSingletonSessionHome) || // F743-508
            (statelessSessionHome))
        {
            // If the wrapper has been created, and is still in the wrapper cache,
            // then just return the remote wrapper from the singleton WrapperCommon.
            // Note that 'inCache' will 'touch' the wrapper in the Wrapper Cache,
            // updating the LRU data and preventing it from unregistering with
            // the ORB.
            if (ivStatelessWrappers != null &&
                ivStatelessWrappers.inCache())
            {
                // Calling getRemoteWrapper will cause the wrapper to register with
                // the ORB, if that hasn't already been done.
                result = ivStatelessWrappers;
            }
            else
            {
                // The stateless wrapper (which is a singleton) has either not been
                // created yet, or is not currently in
                // the wrapper cache.  So, getting it from the Wrapper
                // Manager will cause it to be created (if needed) and faulted into
                // the Wrapper Cache, and then getting the Remote wrapper will cause
                // it to be registered with the ORB.

                // Use a cached instance beanId... for stateless and message beans all
                // instances have the same id.

                // Since this is is one of the home types with a singleton wrapper,
                // then set the local cached value now that it has been created
                // and inserted into the Wrapper Cache.  It cannot be cached
                // locally until inserted into the Wrapper Cache, as the insert
                // updates the wrapper with a reference to the bucket.
                ivStatelessWrappers = wrapperManager.getWrapper(ivStatelessId);

                result = ivStatelessWrappers;
            }
        }

        //------------------------------------------------------------------------
        // This is the home create method for stateful session beans, and
        // constructs a new instance of the Stateful Session bean.
        //
        // Basically the same as a combined generated home wrapper and home bean
        // create method method, except there is no ejbCreate method to call;
        // ejbCreate is only used for the EJB 2.x component interfaces.  d369262.5
        //
        //------------------------------------------------------------------------

        else if (statefulSessionHome)
        {
            EJSDeployedSupport s = new EJSDeployedSupport();

            // BEGIN home wrapper
            try
            {
                container.preInvoke(ivStatefulBusinessHomeWrapper, 0, s);

                // BEGIN home create
                BeanO beanO = null;
                boolean exceptionOccurred = false;
                boolean preEjbCreateCalled = false;
                try
                {
                    // NOTE: Deployed code calls no-arg createBeanO().
                    beanO = createBeanO(s.ivThreadData, s.currentTx, false, context); // d630940
                    preEjbCreateCalled = preEjbCreate(beanO);
                    // Note: There is no ejbCreate for business interfaces.
                    result = postCreateCommon(beanO, beanO.getId(), false); // d618887
                    // This must be be the last action of this try block because if
                    // anything throws, createFailure is called and we should not pop
                    // twice.
                    EJSContainer.getThreadData().popCallbackBeanO();
                } catch (CreateException createexception)
                {
                    exceptionOccurred = true;
                    throw createexception;
                } catch (Throwable throwable)
                {
                    exceptionOccurred = true;
                    throw ExceptionUtil.EJBException("Create failed", throwable);
                } finally
                {
                    if (exceptionOccurred)
                        createFailure(beanO);
                    else if (preEjbCreateCalled)
                        afterPostCreateCompletion(beanO);
                }
                // END home create
            } catch (CreateException createexception)
            {
                s.setCheckedException(createexception);
                throw createexception;
            } catch (Throwable throwable)
            {
                s.setUncheckedLocalException(throwable);
            } finally
            {
                try
                {
                    container.postInvoke(ivStatefulBusinessHomeWrapper, 0, s);
                } catch (Throwable throwable)
                {
                    s.setUncheckedLocalException(throwable);
                }
            }
            // END home wrapper
        }

        return result;
    }
public EJSWrapperCommon createBusinessObjectWrappers ( ManagedObjectContext context ) throws CreateException , RemoteException { homeEnabled ( ) ; EJSWrapperCommon result = null ; if ( ( ivSingletonSessionHome ) || ( statelessSessionHome ) ) { if ( ivStatelessWrappers != null && ivStatelessWrappers . inCache ( ) ) { result = ivStatelessWrappers ; } else { ivStatelessWrappers = wrapperManager . getWrapper ( ivStatelessId ) ; result = ivStatelessWrappers ; } } else if ( statefulSessionHome ) { EJSDeployedSupport s = new EJSDeployedSupport ( ) ; try { container . preInvoke ( ivStatefulBusinessHomeWrapper , 0 , s ) ; BeanO beanO = null ; boolean exceptionOccurred = false ; boolean preEjbCreateCalled = false ; try { beanO = createBeanO ( s . ivThreadData , s . currentTx , false , context ) ; preEjbCreateCalled = preEjbCreate ( beanO ) ; result = postCreateCommon ( beanO , beanO . getId ( ) , false ) ; EJSContainer . getThreadData ( ) . popCallbackBeanO ( ) ; } catch ( CreateException createexception ) { exceptionOccurred = true ; throw createexception ; } catch ( Throwable throwable ) { exceptionOccurred = true ; throw ExceptionUtil . EJBException ( "Create failed" , throwable ) ; } finally { if ( exceptionOccurred ) createFailure ( beanO ) ; else if ( preEjbCreateCalled ) afterPostCreateCompletion ( beanO ) ; } } catch ( CreateException createexception ) { s . setCheckedException ( createexception ) ; throw createexception ; } catch ( Throwable throwable ) { s . setUncheckedLocalException ( throwable ) ; } finally { try { container . postInvoke ( ivStatefulBusinessHomeWrapper , 0 , s ) ; } catch ( Throwable throwable ) { s . setUncheckedLocalException ( throwable ) ; } } } return result ; }
F743-34304