From 0d0d7d9479f2de745a7b310d64e907c352b1fe3f Mon Sep 17 00:00:00 2001 From: costin Date: Wed, 25 Aug 2010 20:34:49 +0300 Subject: [PATCH] + add namespace handler + add region basic parsers SGF-10 SGF-12 SGF-13 --- .../config/GemfireNamespaceHandler.java | 4 ++- .../config/PartitionedRegionParser.java | 33 +++++++++++++++++++ .../config/ReplicatedRegionParser.java | 33 +++++++++++++++++++ 3 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 src/main/java/org/springframework/data/gemfire/config/PartitionedRegionParser.java create mode 100644 src/main/java/org/springframework/data/gemfire/config/ReplicatedRegionParser.java diff --git a/src/main/java/org/springframework/data/gemfire/config/GemfireNamespaceHandler.java b/src/main/java/org/springframework/data/gemfire/config/GemfireNamespaceHandler.java index 42703c4c..fef2ec8e 100644 --- a/src/main/java/org/springframework/data/gemfire/config/GemfireNamespaceHandler.java +++ b/src/main/java/org/springframework/data/gemfire/config/GemfireNamespaceHandler.java @@ -26,6 +26,8 @@ import org.springframework.beans.factory.xml.NamespaceHandlerSupport; class GemfireNamespaceHandler extends NamespaceHandlerSupport { public void init() { + registerBeanDefinitionParser("cache", new CacheParser()); + registerBeanDefinitionParser("replicated-region", new ReplicatedRegionParser()); + registerBeanDefinitionParser("partitioned-region", new PartitionedRegionParser()); } - } \ No newline at end of file diff --git a/src/main/java/org/springframework/data/gemfire/config/PartitionedRegionParser.java b/src/main/java/org/springframework/data/gemfire/config/PartitionedRegionParser.java new file mode 100644 index 00000000..4cb76dc6 --- /dev/null +++ b/src/main/java/org/springframework/data/gemfire/config/PartitionedRegionParser.java @@ -0,0 +1,33 @@ +/* + * Copyright 2010 the original author or authors. + * + * 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 + * + * http://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; + +import org.springframework.beans.factory.config.BeanDefinition; +import org.springframework.beans.factory.xml.BeanDefinitionParser; +import org.springframework.beans.factory.xml.ParserContext; +import org.w3c.dom.Element; + +/** + * @author Costin Leau + */ +class PartitionedRegionParser implements BeanDefinitionParser { + + public BeanDefinition parse(Element element, ParserContext parserContext) { + return null; + } + +} diff --git a/src/main/java/org/springframework/data/gemfire/config/ReplicatedRegionParser.java b/src/main/java/org/springframework/data/gemfire/config/ReplicatedRegionParser.java new file mode 100644 index 00000000..3c5618b3 --- /dev/null +++ b/src/main/java/org/springframework/data/gemfire/config/ReplicatedRegionParser.java @@ -0,0 +1,33 @@ +/* + * Copyright 2010 the original author or authors. + * + * 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 + * + * http://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; + +import org.springframework.beans.factory.config.BeanDefinition; +import org.springframework.beans.factory.xml.BeanDefinitionParser; +import org.springframework.beans.factory.xml.ParserContext; +import org.w3c.dom.Element; + +/** + * @author Costin Leau + */ +class ReplicatedRegionParser implements BeanDefinitionParser { + + public BeanDefinition parse(Element element, ParserContext parserContext) { + return null; + } + +}