@ SuppressWarnings ( "unchecked" ) private void createInstanceUsingMOF ( ManagedObjectFactory < ? > ejbManagedObjectFactory ) throws InvocationTargetException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "createInstanceUsingMOF" ) ; try { if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "calling ManagedObjectFactory.createManagedObject(InvocationContext)" ) ; @ SuppressWarnings ( "rawtypes" ) InvocationContextImpl invCtx = getInvocationContext ( ) ; ivManagedObject = ejbManagedObjectFactory . createManagedObject ( invCtx ) ; ivEjbManagedObjectContext = ivManagedObject . getContext ( ) ; setEnterpriseBean ( ivManagedObject . getObject ( ) ) ; } catch ( ManagedObjectException e ) { //the callstack is epecting a InvocationTargetException so unwrap the ManagedObjectException and rewrap as InvocationTargetException Throwable cause = e . getCause ( ) ; if ( cause != null && cause instanceof Exception ) { if ( cause instanceof InvocationTargetException ) { throw ( InvocationTargetException ) cause ; } else { throw new InvocationTargetException ( cause ) ; } } else { throw new EJBException ( home . beanMetaData . enterpriseBeanClassName , e ) ; } } catch ( Exception e ) { // Reflection exceptions are unexpected. FFDCFilter . processException ( e , CLASS_NAME + ".createInstanceUsingMOF" , "321" , this ) ; throw new EJBException ( home . beanMetaData . enterpriseBeanClassName , e ) ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "createInstanceUsingMOF" ) ; }
Creates the bean instance using either the ManagedObjectFactory .