SGF-17
+ add parsing of the grid object sizer
This commit is contained in:
costin
2010-09-15 17:37:28 +03:00
parent 5a6fd73114
commit 9f4b5f440d
4 changed files with 19 additions and 4 deletions

View File

@@ -1,10 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>spring-gemfire</name>
<name>head</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
@@ -25,5 +30,6 @@
<nature>org.springframework.ide.eclipse.core.springnature</nature>
<nature>org.maven.ide.eclipse.maven2Nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
</natures>
</projectDescription>

View File

@@ -152,7 +152,7 @@ abstract class ParsingUtils {
* @param element
* @param attrBuilder
*/
static void parseEviction(Element element, BeanDefinitionBuilder attrBuilder) {
static void parseEviction(ParserContext parserContext, Element element, BeanDefinitionBuilder attrBuilder) {
Element evictionElement = DomUtils.getChildElementByTagName(element, "eviction");
if (evictionElement == null)
@@ -169,6 +169,15 @@ abstract class ParsingUtils {
setPropertyValue(evictionElement, evictionDefBuilder, "threshold", "threshold");
setPropertyValue(evictionElement, evictionDefBuilder, "action", "action");
// get object sizer (if declared)
Element objectSizerElement = DomUtils.getChildElementByTagName(evictionElement, "object-sizer");
if (objectSizerElement != null) {
Object sizer = parseRefOrNestedBeanDeclaration(parserContext, objectSizerElement, evictionDefBuilder);
evictionDefBuilder.addPropertyValue("ObjectSizer", sizer);
}
attrBuilder.addPropertyValue("evictionAttributes", evictionDefBuilder.getBeanDefinition());
}
}

View File

@@ -77,7 +77,7 @@ class PartitionedRegionParser extends AbstractSingleBeanDefinitionParser {
// region attributes
BeanDefinitionBuilder attrBuilder = BeanDefinitionBuilder.genericBeanDefinition(RegionAttributesFactory.class);
ParsingUtils.parseEviction(element, attrBuilder);
ParsingUtils.parseEviction(parserContext, element, attrBuilder);
ParsingUtils.parseDiskStorage(element, attrBuilder);
// partition attributes

View File

@@ -70,7 +70,7 @@ class ReplicatedRegionParser extends AbstractSingleBeanDefinitionParser {
attrBuilder.addPropertyValue("publisher", Boolean.valueOf(attr));
}
ParsingUtils.parseEviction(element, attrBuilder);
ParsingUtils.parseEviction(parserContext, element, attrBuilder);
ParsingUtils.parseDiskStorage(element, attrBuilder);
builder.addPropertyValue("attributes", attrBuilder.getBeanDefinition());