private void generateRegion(Region root) throws SAXException { if (this.version.compareTo(CacheXmlVersion.VERSION_5_0) >= 0) { generate(root, REGION); } else { generate(root, VM_ROOT_REGION); } }
/** * Generates XML for the client-subscription tag * @param bridge instance of <code>CacheServer</code> * * @since 5.7 */ private void generateClientHaQueue(CacheServer bridge) throws SAXException { AttributesImpl atts = new AttributesImpl(); ClientSubscriptionConfigImpl csc = (ClientSubscriptionConfigImpl)bridge.getClientSubscriptionConfig(); try { atts.addAttribute("", "", CLIENT_SUBSCRIPTION_EVICTION_POLICY, "", csc.getEvictionPolicy()); atts.addAttribute("", "", CLIENT_SUBSCRIPTION_CAPACITY, "", String.valueOf(csc.getCapacity())); if (this.version.compareTo(CacheXmlVersion.VERSION_6_5) >= 0) { String dsVal = csc.getDiskStoreName(); if (dsVal != null) { atts.addAttribute("", "", DISK_STORE_NAME, "", dsVal); } } if (csc.getDiskStoreName() == null && csc.hasOverflowDirectory()) { atts.addAttribute("", "", OVERFLOW_DIRECTORY, "", csc.getOverflowDirectory()); } handler.startElement("", CLIENT_SUBSCRIPTION, CLIENT_SUBSCRIPTION, atts); handler.endElement("", CLIENT_SUBSCRIPTION, CLIENT_SUBSCRIPTION); } catch (Exception ex) { ex.printStackTrace(); } }
if (this.version.compareTo(CacheXmlVersion.VERSION_4_1) < 0) { return;
handler.startElement("", LRU_HEAP_PERCENTAGE, LRU_HEAP_PERCENTAGE, atts); if (this.version.compareTo(CacheXmlVersion.VERSION_6_0) >= 0) { ObjectSizer os = ea.getObjectSizer(); if (!(os instanceof SizeClassOnceObjectSizer)) {
if (this.version.compareTo(CacheXmlVersion.VERSION_4_0) < 0) { return; if (this.version.compareTo(CacheXmlVersion.VERSION_4_1) < 0) { return; if (this.version.compareTo(CacheXmlVersion.VERSION_5_0) < 0) { return; if (this.version.compareTo(CacheXmlVersion.VERSION_5_1) < 0) { return; if (this.version.compareTo(CacheXmlVersion.VERSION_5_7) < 0) { return; if (this.version.compareTo(CacheXmlVersion.VERSION_8_0) < 0) { return; if (this.version.compareTo(CacheXmlVersion.VERSION_5_7) >= 0) { handler.startElement("", CACHE_SERVER, CACHE_SERVER, atts); } else { if (this.version.compareTo(CacheXmlVersion.VERSION_5_7) >= 0) { String[] groups = bridge.getGroups(); if (groups.length > 0) { if (this.version.compareTo(CacheXmlVersion.VERSION_5_7) >= 0) { handler.endElement("", "", CACHE_SERVER); } else {
if (this.version.compareTo(CacheXmlVersion.VERSION_5_5) >= 0) { if (this.version.compareTo(CacheXmlVersion.VERSION_5_7) >= 0) { if (this.version.compareTo(CacheXmlVersion.VERSION_5_8) >= 0) { if (this.version.compareTo(CacheXmlVersion.VERSION_6_0) >= 0) { if (this.version.compareTo(CacheXmlVersion.VERSION_6_5) >= 0) { if (this.version.compareTo(CacheXmlVersion.VERSION_7_0) >= 0) { if (this.version.compareTo(CacheXmlVersion.VERSION_7_0) >= 0) { if (this.version.compareTo(CacheXmlVersion.VERSION_5_1) >= 0) { if (creation.hasMessageSyncInterval()) { atts.addAttribute("", "", MESSAGE_SYNC_INTERVAL, "", String if (this.version.compareTo(CacheXmlVersion.VERSION_4_0) >= 0) { if (creation.hasServer()) { atts.addAttribute("", "", IS_SERVER, "", if (!isClientCache) { generate(this.cache.getCacheTransactionManager()); } else if(this.version.compareTo(CacheXmlVersion.VERSION_6_6) >= 0) { generate(this.cache.getCacheTransactionManager()); if (this.version.compareTo(CacheXmlVersion.VERSION_7_0) >= 0) { Set<GatewaySender> senderSet = cache.getGatewaySenders();
/** * Generates XML for a CacheTransactionManager * * @since 4.0 */ private void generate(CacheTransactionManager txMgr) throws SAXException { if (this.version.compareTo(CacheXmlVersion.VERSION_4_0) < 0) { return; } if (txMgr == null) { return; } if (!generateDefaults() && txMgr.getWriter() == null && txMgr.getListeners().length == 0) { return; } handler.startElement("", TRANSACTION_MANAGER, TRANSACTION_MANAGER, EMPTY); { TransactionListener[] listeners = txMgr.getListeners(); for (int i=0; i < listeners.length; i++) { generate(TRANSACTION_LISTENER, listeners[i]); } if(txMgr.getWriter()!=null) { generate(TRANSACTION_WRITER, txMgr.getWriter()); } } handler.endElement("", TRANSACTION_MANAGER, TRANSACTION_MANAGER); }
/** * When a <code>partition-attributes</code> element is finished, the * {@link PartitionAttributes} are on top of the stack followed by the * {@link RegionAttributesCreation} to which the partition attributes are * assigned. */ private void endPartitionAttributes() { PartitionAttributesImpl paf = (PartitionAttributesImpl) stack.pop(); paf.validateAttributes(); RegionAttributesCreation rattrs = peekRegionAttributesContext(PARTITION_ATTRIBUTES); // change the 5.0 default data policy (EMPTY) to the current default if (rattrs.hasDataPolicy() && rattrs.getDataPolicy().isEmpty() && (this.version.compareTo(CacheXmlVersion.VERSION_5_0) == 0)) { rattrs.setDataPolicy(PartitionedRegionHelper.DEFAULT_DATA_POLICY); } rattrs.setPartitionAttributes(paf); }
if (this.version.compareTo(CacheXmlVersion.VERSION_5_1) >= 0) { if (generateDefaults() || pa.getLocalMaxMemory() != ((PartitionAttributesImpl) pa).getLocalMaxMemoryDefault()) atts.addAttribute("", "", LOCAL_MAX_MEMORY, "", if (this.version.compareTo(CacheXmlVersion.VERSION_5_8) >= 0) { if(pa.getColocatedWith() != null) atts.addAttribute("", "", PARTITION_COLOCATED_WITH, "", if (this.version.compareTo(CacheXmlVersion.VERSION_6_0) >= 0) { if (generateDefaults() || pa.getRecoveryDelay() != PartitionAttributesFactory.RECOVERY_DELAY_DEFAULT) atts.addAttribute("", "", RECOVERY_DELAY, "", if (this.version.compareTo(CacheXmlVersion.VERSION_5_8) >= 0) { PartitionResolver rr = pa.getPartitionResolver(); if (rr != null) { if (this.version.compareTo(CacheXmlVersion.VERSION_6_1) >= 0) { PartitionListener[] listeners = pa.getPartitionListeners(); for (int i = 0; i < listeners.length; i++) { if (this.version.compareTo(CacheXmlVersion.VERSION_6_6) >= 0) { List<FixedPartitionAttributes> staticAttrs = pa .getFixedPartitionAttributes(); if (this.version.compareTo(CacheXmlVersion.VERSION_5_1) < 0) { Properties p = pa.getLocalProperties(); generate(p, LOCAL_PROPERTIES);
if (this.version.compareTo(CacheXmlVersion.VERSION_5_7) < 0) { return; String.valueOf(cp.getThreadLocalConnections())); if (this.version.compareTo(CacheXmlVersion.VERSION_6_1) > 0) { if (generateDefaults() || cp.getPRSingleHopEnabled() != PoolFactory.DEFAULT_PR_SINGLE_HOP_ENABLED) atts.addAttribute("", "", PR_SINGLE_HOP_ENABLED, "", if (this.version.compareTo(CacheXmlVersion.VERSION_6_1) > 0) { if (generateDefaults() || cp.getMultiuserAuthentication() != PoolFactory.DEFAULT_MULTIUSER_AUTHENTICATION) atts.addAttribute("", "", MULTIUSER_SECURE_MODE_ENABLED, "", String.valueOf(cp
String.valueOf(receiver.getSocketBufferSize())); if (this.version.compareTo(CacheXmlVersion.VERSION_8_0) < 0) { return;
if (this.version.compareTo(CacheXmlVersion.VERSION_5_0) >= 0) { if (this.version.compareTo(CacheXmlVersion.VERSION_5_7) >= 0) { dpString = PERSISTENT_PARTITION_DP; } else if (dp.isPartition()) { if (this.version.compareTo(CacheXmlVersion.VERSION_5_1) >= 0) { dpString = PARTITION_DP; if (this.version.compareTo(CacheXmlVersion.VERSION_7_0) >= 0) { if ((!(attrs instanceof RegionAttributesCreation) || ((RegionAttributesCreation) attrs).hasConcurrencyChecksEnabled())) { if (this.version.compareTo(CacheXmlVersion.VERSION_4_0) >= 0) { if ((!(attrs instanceof RegionAttributesCreation) || ((RegionAttributesCreation) attrs).hasIsLockGrantor())) { if (this.version.compareTo(CacheXmlVersion.VERSION_5_7) >= 0) { if ((!(attrs instanceof RegionAttributesCreation) || ((RegionAttributesCreation) attrs).hasPoolName())) { if (this.version.compareTo(CacheXmlVersion.VERSION_6_5) >= 0) { if ((!(attrs instanceof RegionAttributesCreation) || ((RegionAttributesCreation) attrs).hasDiskStoreName())) { if(this.version.compareTo(CacheXmlVersion.VERSION_6_1) >= 0) if ((!(attrs instanceof RegionAttributesCreation)|| ((RegionAttributesCreation) attrs).hasCloningEnabled())) {