PersistenceManager pmConfig = (PersistenceManager) advisor.resolveAnnotation(PersistenceManager.class);
EJBContainer ejbContainer = (EJBContainer)container;
String pmConfigValue = pmConfig.value();
PersistenceManagerFactoryRegistry pmFactoryRegistry = ejbContainer.getDeployment()
.getPersistenceManagerFactoryRegistry();
PersistenceManagerFactory pmFactory = pmFactoryRegistry.getPersistenceManagerFactory(pmConfigValue);
this.pm = pmFactory.createPersistenceManager();
pm.initialize(container);
CacheConfig config = (CacheConfig) advisor.resolveAnnotation(CacheConfig.class);
maxSize = config.maxSize();
sessionTimeout = config.idleTimeoutSeconds();
removalTimeout = config.removalTimeoutSeconds() * 1000;