public static JBossWebMetaData createWebMetaData( ReplicationGranularity granularity, ReplicationTrigger trigger, int maxSessions, boolean passivation, int maxIdle, int minIdle, boolean batchMode, int maxUnreplicated) { JBossWebMetaData webMetaData = new JBossWebMetaData(); webMetaData.setDistributable(new EmptyMetaData()); webMetaData.setMaxActiveSessions(new Integer(maxSessions)); PassivationConfig pcfg = new PassivationConfig(); pcfg.setUseSessionPassivation(Boolean.valueOf(passivation)); pcfg.setPassivationMaxIdleTime(new Integer(maxIdle)); pcfg.setPassivationMinIdleTime(new Integer(minIdle)); webMetaData.setPassivationConfig(pcfg); ReplicationConfig repCfg = new ReplicationConfig(); repCfg.setReplicationGranularity(granularity); repCfg.setReplicationTrigger(trigger); repCfg.setReplicationFieldBatchMode(Boolean.valueOf(batchMode)); repCfg.setMaxUnreplicatedInterval(Integer.valueOf(maxUnreplicated)); repCfg.setSnapshotMode(SnapshotMode.INSTANT); webMetaData.setReplicationConfig(repCfg); return webMetaData; }
private void verifyDependencies( String cacheName, ServiceName sessionCacheServiceName, ServiceName jvmRouteCacheServiceName) { ReplicationConfig config = new ReplicationConfig(); config.setCacheName(cacheName); JBossWebMetaData metaData = new JBossWebMetaData(); metaData.setReplicationConfig(config); Collection<ServiceName> dependencies = this.factory.getDependencies(metaData); assertEquals(2, dependencies.size()); assertTrue(dependencies.contains(sessionCacheServiceName)); assertTrue(dependencies.contains(jvmRouteCacheServiceName)); }