Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
<<<<<<< Updated upstream
* Copyright 2010-2020 the original author or authors.
=======
* Copyright 2018-2020 the original author or authors.
>>>>>>> Stashed changes
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.data.gemfire.config.xml;
import java.util.List;
import org.w3c.dom.Element;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.support.ManagedList;
import org.springframework.beans.factory.xml.ParserContext;
import org.springframework.data.gemfire.RegionAttributesFactoryBean;
import org.springframework.data.gemfire.client.ClientRegionFactoryBean;
import org.springframework.data.gemfire.client.Interest;
import org.springframework.data.gemfire.client.KeyInterest;
import org.springframework.data.gemfire.client.RegexInterest;
import org.springframework.data.repository.query.QueryLookupStrategy;
import org.springframework.util.StringUtils;
import org.springframework.util.xml.DomUtils;
/**
* Bean definition parser for the <gfe:client-region> SDG XML namespace (XSD) element.
*
* To avoid eager evaluations, Region interests are declared as nested bean definitions.
*
* @author Costin Leau
* @author David Turanski
* @author John Blum
* @see org.springframework.data.gemfire.client.ClientRegionFactoryBean
* @see AbstractRegionParser
*/
class ClientRegionParser extends AbstractRegionParser {
/**
* {@inheritDoc}
*/
@Override
protected Class getRegionFactoryClass() {
return ClientRegionFactoryBean.class;
}
/**
* {@inheritDoc}
*/
@Override
protected void doParseRegion(Element element, ParserContext parserContext, BeanDefinitionBuilder regionBuilder,
boolean subRegion) {
validateDataPolicyShortcutAttributesMutualExclusion(element, parserContext);
String resolvedCacheRef = ParsingUtils.resolveCacheReference(element.getAttribute("cache-ref"));
if (!subRegion) {
regionBuilder.addPropertyReference("cache", resolvedCacheRef);
ParsingUtils.setPropertyValue(element, regionBuilder, "close");
ParsingUtils.setPropertyValue(element, regionBuilder, "destroy");
}
ParsingUtils.setPropertyValue(element, regionBuilder, "name");
ParsingUtils.setPropertyValue(element, regionBuilder, "data-policy");
ParsingUtils.setPropertyValue(element, regionBuilder, "ignore-if-exists", "lookupEnabled");
ParsingUtils.setPropertyValue(element, regionBuilder, "persistent");
ParsingUtils.setPropertyValue(element, regionBuilder, "pool-name");
ParsingUtils.setPropertyValue(element, regionBuilder, "shortcut");
parseDiskStoreAttribute(element, regionBuilder);
// Client RegionAttributes for Compression, Eviction, Expiration and Statistics
BeanDefinitionBuilder regionAttributesBuilder =
BeanDefinitionBuilder.genericBeanDefinition(RegionAttributesFactoryBean.class);
mergeRegionTemplateAttributes(element, parserContext, regionBuilder, regionAttributesBuilder);
ParsingUtils.parseOptionalRegionAttributes(element, parserContext, regionAttributesBuilder);
ParsingUtils.parseStatistics(element, regionAttributesBuilder);
ParsingUtils.parseExpiration(element, parserContext, regionAttributesBuilder);
ParsingUtils.parseEviction(element, parserContext, regionAttributesBuilder);
ParsingUtils.parseCompressor(element, parserContext, regionAttributesBuilder);
regionBuilder.addPropertyValue("attributes", regionAttributesBuilder.getBeanDefinition());
List subElements = DomUtils.getChildElements(element);
ManagedList