protected < T > ManagedObjectFactory < T > getEJBManagedObjectFactory ( BeanMetaData bmd , Class < T > klass ) throws EJBConfigurationException { ManagedObjectFactory < T > factory = null ; ManagedObjectService managedObjectService = getManagedObjectService ( ) ; if ( managedObjectService != null ) { try { factory = managedObjectService . createEJBManagedObjectFactory ( bmd . _moduleMetaData , klass , bmd . j2eeName . getComponent ( ) ) ; //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 ; }
Gets a managed object factory for the specified EJB class or null if instances of the class do not need to be managed .