public void process(JBossSessionBeanMetaData metaData, Class<?> type) { CacheConfig annotation = finder.getAnnotation(type, CacheConfig.class); if(annotation == null) return; CacheConfigMetaData cacheConfig = new CacheConfigMetaData(); cacheConfig.setMaxSize(annotation.maxSize()); cacheConfig.setName(annotation.name()); cacheConfig.setIdleTimeoutSeconds(Integer.valueOf((int) annotation.idleTimeoutSeconds())); cacheConfig.setRemoveTimeoutSeconds(Integer.valueOf((int) annotation.removalTimeoutSeconds())); cacheConfig.setReplicationIsPassivation(Boolean.toString(annotation.replicationIsPassivation())); metaData.setCacheConfig(cacheConfig); }
pm.initialize(container); CacheConfig config = (CacheConfig) advisor.resolveAnnotation(CacheConfig.class); maxSize = config.maxSize(); sessionTimeout = config.idleTimeoutSeconds(); removalTimeout = config.removalTimeoutSeconds() * 1000; SessionBeanEffigy effigy = this.container.getEffigy(); if(effigy != null)
/** * @see org.jboss.ejb3.cache.StatefulObjectFactory#create(Class[], Object[]) */ public StatefulBeanContext create(Class<?>[] initTypes, Object[] initValues) { StatefulBeanContext sfctx = (StatefulBeanContext) createBeanContext(); // Tell context how to handle replication CacheConfig config = getAnnotation(CacheConfig.class); if (config != null) { sfctx.setReplicationIsPassivation(config.replicationIsPassivation()); } // this is for propagated extended PC's sfctx = sfctx.pushContainedIn(); pushContext(sfctx); try { injectBeanContext(sfctx); StatefulBeanContext.currentBean.push(sfctx); invokePostConstruct(sfctx); } finally { StatefulBeanContext.currentBean.pop(); popContext(); // this is for propagated extended PC's sfctx.popContainedIn(); } return sfctx; }