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));