code: public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry reg)
  			throws BeansException {
  		logger.debug("postProcessBeanDefinitionRegistry : enter");
  		try {
  
  			// Reflect over StatefulJ
  			//
  			Reflections reflections = new Reflections((Object[])this.packages);
  
  			// Load up all Endpoint Binders
  			//
  			Map<String, EndpointBinder> binders = new HashMap<String, EndpointBinder>();
  			loadEndpointBinders(reflections, binders);
  
  			// Load up all PersistenceSupportBeanFactories
  			//
  			Map<Class<?>, PersistenceSupportBeanFactory> persistenceFactories = new HashMap<Class<?>, PersistenceSupportBeanFactory>();
  			loadPersistenceSupportBeanFactories(reflections, persistenceFactories);
  
  			// Map Controllers and Entities
  			//
  			Map<String, Class<?>> controllerToEntityMapping = new HashMap<String, Class<?>>();
  			Map<Class<?>, String> entityToRepositoryMappings = new HashMap<Class<?>, String>();
  
  			mapControllerAndEntityClasses(
  					reg,
  					controllerToEntityMapping,
  					entityToRepositoryMappings,
  					this.entityToControllerMappings);
  
  			// Iterate thru all StatefulControllers and build the framework
  			//
  			for (Entry<String, Class<?>> entry : controllerToEntityMapping.entrySet()) {
  				buildFramework(
  						entry.getKey(),
  						entry.getValue(),
  						reg,
  						entityToRepositoryMappings,
  						binders,
  						persistenceFactories);
  			}
  
  		} catch(Exception e) {
  			throw new BeanCreationException("Unable to create bean", e);
  		}
  		logger.debug("postProcessBeanDefinitionRegistry : exit");
  	}
docs: /*
  Override postProcessBeanDefinitionRegistry to dynamically generate all the StatefulJ beans for each StatefulController
  
  (non-Javadoc)
  @see org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor#postProcessBeanDefinitionRegistry(org.springframework.beans.factory.support.BeanDefinitionRegistry)