public static ReplicationConfig parse(XMLStreamReader reader, PropertyReplacer propertyReplacer) throws XMLStreamException { ReplicationConfig config = new ReplicationConfig(); // Handle elements while (reader.hasNext() && reader.nextTag() != END_ELEMENT) { String localName = reader.getLocalName(); final Element element = Element.forName(localName); switch (element) { case CACHE_NAME: { config.setCacheName(getElementText(reader, propertyReplacer)); break; } case REPLICATION_GRANULARITY: { config.setReplicationGranularity(ReplicationGranularity.valueOf(getElementText(reader, propertyReplacer))); break; } default: { if (DEPRECATED_ELEMENTS.contains(localName)) { log.warnf("<%s/> is no longer supported and will be ignored", localName); // Skip any content reader.getElementText(); } else { throw unexpectedElement(reader); } } } } return config; } }
private void synthesizeReplicationConfig() { ReplicationConfig cfg = new ReplicationConfig(); cfg.setReplicationGranularity(replicationGranularity_); cfg.setReplicationTrigger(replicationTrigger_); cfg.setUseJK(useJK_); cfg.setCacheName(cacheConfigName_); cfg.setSnapshotMode(snapshotMode_); cfg.setSnapshotInterval(Integer.valueOf(snapshotInterval_)); cfg.setMaxUnreplicatedInterval(Integer.valueOf(maxUnreplicatedInterval_)); cfg.setSessionNotificationPolicy(notificationPolicyClass_); this.replicationConfig_ = cfg; }
repCfg.setSnapshotInterval(new Integer(this.snapshotInterval)); if (repCfg.getReplicationGranularity() == null) repCfg.setReplicationGranularity(this.replicationGranularity); if (repCfg.getReplicationTrigger() == null) repCfg.setReplicationTrigger(this.replicationTrigger);