diff --git a/build.gradle b/build.gradle index cf091d31..000c99b9 100644 --- a/build.gradle +++ b/build.gradle @@ -1,67 +1,30 @@ -// used for artifact names, building doc upload urls, etc. -description = 'Spring Data GemFire' -abbreviation = 'SGF' - -apply plugin: 'base' - buildscript { repositories { -// add(new org.apache.ivy.plugins.resolver.FileSystemResolver()) { -// name = "local" -// addIvyPattern "e:/work/i21/gradle-plugins/build/repo/[organisation].[module]-ivy-[revision].xml" -// addArtifactPattern "e:/work/i21/gradle-plugins/build/repo/[organisation].[module]-[revision](-[classifier]).[ext]" -// } - - add(new org.apache.ivy.plugins.resolver.URLResolver()) { - name = "GitHub" - addIvyPattern 'http://cloud.github.com/downloads/costin/gradle-stuff/[organization].[module]-[artifact]-[revision].[ext]' - addArtifactPattern 'http://cloud.github.com/downloads/costin/gradle-stuff/[organization].[module]-[revision].[ext]' - } - mavenCentral() - mavenLocal() - mavenRepo name: "springsource-org-release", urls: "http://repository.springsource.com/maven/bundles/release" - mavenRepo name: "springsource-org-external", urls: "http://repository.springsource.com/maven/bundles/external" + maven { url 'http://repo.springsource.org/plugins-release' } } - dependencies { - classpath 'org.springframework:gradle-stuff:0.1-20110421' - classpath 'net.sf.docbook:docbook-xsl:1.75.2:ns-resources@zip' + classpath 'org.springframework.build.gradle:bundlor-plugin:0.1.2' + classpath 'org.springframework.build.gradle:docbook-reference-plugin:0.1.5' } } -allprojects { - group = 'org.springframework.data.gemfire' - version = "$springGemfireVersion" - - releaseBuild = version.endsWith('RELEASE') - snapshotBuild = version.endsWith('SNAPSHOT') - - - repositories { - mavenLocal() - mavenCentral() - // Public Spring artefacts - mavenRepo name: "springsource-org-release", urls: "http://repository.springsource.com/maven/bundles/release" - mavenRepo name: "spring-release", urls: "http://maven.springframework.org/release" - mavenRepo name: "spring-milestone", urls: "http://maven.springframework.org/milestone" - mavenRepo name: "spring-snapshot", urls: "http://maven.springframework.org/snapshot" - mavenRepo name: "sonatype-snapshot", urls: "http://oss.sonatype.org/content/repositories/snapshots" - mavenRepo name: "ext-snapshots", urls: "http://springframework.svn.sourceforge.net/svnroot/springframework/repos/repo-ext/" - mavenRepo name: "gemstone-com-release", urls: "http://dist.gemstone.com/maven/release" - //mavenRepo name: "gemstone-com-release", urls: "http://repo.springsource.org/gemstone-release" - } +description = 'Spring Data GemFire' +group = 'org.springframework.data' +repositories { + maven { url "http://repo.springsource.org/libs-snapshot" } + maven { url "http://repo.springsource.org/plugins-release" } + maven { url "http://repo1.maven.org/maven2" } } apply plugin: "java" -apply plugin: "maven" -apply plugin: 'eclipse' // `gradle eclipse` to generate .classpath/.project -apply plugin: 'idea' // `gradle idea` to generate .ipr/.iml -apply plugin: 'docbook' -apply plugin: 'bundlor' // all core projects should be OSGi-compliant +apply plugin: 'eclipse' +apply plugin: 'idea' +apply from: "$rootDir/maven.gradle" +apply plugin: 'docbook-reference' +apply plugin: 'bundlor' -bundlor.useProjectProps = true [compileJava, compileTestJava]*.options*.compilerArgs = ["-Xlint:-serial"] test { @@ -93,21 +56,21 @@ dependencies { testCompile "org.hamcrest:hamcrest-core:$hamcrestVersion" testCompile "org.hamcrest:hamcrest-library:$hamcrestVersion" testCompile "org.springframework:spring-test:$springVersion" - testCompile("javax.annotation:jsr250-api:1.0") { optional = true } + testCompile("javax.annotation:jsr250-api:1.0", optional) // Spring Data compile "org.springframework.data:spring-data-commons-core:${springDataCommonsVersion}" + // + testCompile "org.apache.derby:derbyLocale_zh_TW:10.9.1.0" } -javaprojects = rootProject - sourceCompatibility = 1.5 targetCompatibility = 1.5 javadoc { - srcDir = file("${projectDir}/docs/src/api") + ext.srcDir = file("${projectDir}/docs/src/api") destinationDir = file("${buildDir}/api") - tmpDir = file("${buildDir}/api-work") + ext.tmpDir = file("${buildDir}/api-work") configure(options) { stylesheetFile = file("${srcDir}/spring-javadoc.css") @@ -133,63 +96,100 @@ javadoc { } title = "${rootProject.description} ${version} API" - - // collect all the sources that will be included in the javadoc output - source javaprojects.collect {project -> - project.sourceSets.main.allJava - } - - // collect all main classpaths to be able to resolve @see refs, etc. - // this collection also determines the set of projects that this - // task dependsOn, thus the runtimeClasspath is used to ensure all - // projects are included, not just *dependencies* of all classes. - // this is awkward and took me a while to figure out. - classpath = files(javaprojects.collect {project -> - project.sourceSets.main.runtimeClasspath - }) - - // copy the images from the doc-files dir over to the target - doLast { task -> - copy { - from file("${task.srcDir}/doc-files") - into file("${task.destinationDir}/doc-files") - } - } } -ideaProject { - withXml { provider -> - provider.node.component.find { it.@name == 'VcsDirectoryMappings' }.mapping.@vcs = 'Git' - } +bundlor { + manifestTemplate = file("${projectDir}/template.mf").text } -task wrapper(type: Wrapper) { - gradleVersion = '1.0-milestone-3' - description = "Generate the Gradle wrapper" - group = "Distribution" +jar { + manifest.attributes['Implementation-Title'] = 'spring-data-gemfire' + manifest.attributes['Implementation-Version'] = project.version + + from("$rootDir/docs/src/info") { + include "license.txt" + include "notice.txt" + into "META-INF" + expand(copyright: new Date().format('yyyy'), version: project.version) + } } -apply from: "$rootDir/maven.gradle" -assemble.dependsOn = ['jar', 'sourceJar', 'javadocJar'] +task sourcesJar(type: Jar, dependsOn:classes) { + classifier = 'sources' + from sourceSets.main.allJava +} -// Distribution tasks -task dist(type: Zip) { - description = "Generate the ZIP Distribution" - group = "Distribution" - dependsOn assemble, subprojects*.tasks*.matching { task -> task.name == 'assemble' } +task javadocJar(type: Jar) { + classifier = 'javadoc' + from javadoc +} - evaluationDependsOn(':docs') +reference { + sourceDir = file('docs/src/reference/docbook') +} - def zipRootDir = "${project.name}-$version" - into(zipRootDir) { - from('/docs/src/info') { - include '*.txt' +task docsZip(type: Zip) { + group = 'Distribution' + classifier = 'docs' + description = "Builds -${classifier} archive containing api and reference for deployment" + + from('docs/src/info') { + include 'changelog.txt' + } + + from (javadoc) { + into 'api' + } + + from (reference) { + into 'reference' + } +} + +task schemaZip(type: Zip) { + group = 'Distribution' + classifier = 'schema' + description = "Builds -${classifier} archive containing all XSDs for deployment" + + def Properties schemas = new Properties(); + + sourceSets.main.resources.find { + it.path.endsWith('META-INF' + File.separator + 'spring.schemas') + }?.withInputStream { schemas.load(it) } + + for (def key : schemas.keySet()) { + def shortName = key.replaceAll(/http.*schema.(.*).spring-.*/, '$1') + def alias = key.replaceAll(/http.*schema.(.*).(spring-.*)/, '$2') + assert shortName != key + File xsdFile = sourceSets.main.resources.find { + it.path.replace('\\', '/').endsWith(schemas.get(key)) } - from('/docs/build/') { - into 'docs' - include 'reference/**/*' + assert xsdFile != null + + into (shortName) { + from xsdFile.path + rename { String fileName -> alias } } + } +} + +task distZip(type: Zip, dependsOn: [jar, docsZip, schemaZip, sourcesJar, javadocJar]) { + group = 'Distribution' + classifier = 'dist' + description = "Builds -${classifier} archive, containing all jars and docs, " + + "suitable for community download page." + + ext.zipRootDir = "${project.name}-${project.version}" + + into (zipRootDir) { + from('docs/src/info') { + include 'readme.txt' + include 'license.txt' + include 'notice.txt' + expand(copyright: new Date().format('yyyy'), version: project.version) + } + from('samples/') { into 'samples' exclude '**/build/**' @@ -198,25 +198,34 @@ task dist(type: Zip) { exclude '**/vf*.*' exclude '**/vf*.txt' } - from('build/') { - into 'docs' - include 'api/**/*' + + from(zipTree(docsZip.archivePath)) { + into "docs" } - into('dist') { - from javaprojects.collect {project -> project.libsDir } + + from(zipTree(schemaZip.archivePath)) { + into "schema" + } + into ("dist") { + from rootProject.collect { project -> project.libsDir } } - } - doLast { - ant.checksum(file: archivePath, algorithm: 'SHA1', fileext: '.sha1') } } -task uploadDist(type: org.springframework.gradle.tasks.S3DistroUpload, dependsOn: dist) { - description = "Upload the ZIP Distribution" - group = "Distribution" - archiveFile = dist.archivePath - projectKey = 'SGF' - projectName = 'Spring GemFire' +artifacts { + archives sourcesJar + archives javadocJar + + archives docsZip + archives schemaZip + archives distZip } -defaultTasks 'clean', 'build' \ No newline at end of file +task wrapper(type: Wrapper) { + description = 'Generates gradlew[.bat] scripts' + gradleVersion = '1.0' +} + +assemble.dependsOn = ['jar', 'sourcesJar'] +defaultTasks 'build' + diff --git a/docs/build.gradle b/docs/build.gradle deleted file mode 100644 index 1c63b32e..00000000 --- a/docs/build.gradle +++ /dev/null @@ -1,101 +0,0 @@ -import org.apache.tools.ant.filters.ReplaceTokens - -// ----------------------------------------------------------------------------- -// Configuration for the docs subproject -// ----------------------------------------------------------------------------- - -apply plugin: 'base' -apply plugin: 'docbook' - -assemble.dependsOn = [rootProject.javadoc, 'reference'] - -[docbookHtml, docbookFoPdf, docbookHtmlSingle]*.group = 'Documentation' -[docbookHtml, docbookFoPdf, docbookHtmlSingle]*.sourceFileName = 'index.xml' -[docbookHtml, docbookFoPdf, docbookHtmlSingle]*.sourceDirectory = new File(projectDir, 'src/reference/docbook') - -docbookHtml.stylesheet = new File(projectDir, 'src/reference/resources/xsl/html-custom.xsl') -docbookHtmlSingle.stylesheet = new File(projectDir, 'src/reference/resources/xsl/html-single-custom.xsl') -docbookFoPdf.stylesheet = new File(projectDir, 'src/reference/resources/xsl/pdf-custom.xsl') - -def imagesDir = new File(projectDir, 'src/reference/resources/images'); -[docbookHtml, docbookFoPdf, docbookHtmlSingle]*.admonGraphicsPath = "./images/admon/" -[docbookHtml, docbookFoPdf, docbookHtmlSingle]*.imgSrcPath = "${imagesDir}" - -// defined separately to prevent the replacement from taking place (seems to affect the images) -imgSpec = copySpec { - into ('reference') { - from("$projectDir/src/reference/resources") { - include 'css/**/*' - } - from("$buildDir/docs") { - include '*.pdf' - } - } - - into ('reference/images') { - from (imagesDir) - } -} - - -refSpec = copySpec { - into ('reference') { - from("$buildDir/docs") { - exclude '*.fo' - exclude '*.pdf' - } - } - - p = new Properties() - - for (e in project.properties) { - if (e.key != null && e.value != null) - p.setProperty(e.key, e.value.toString()) - } - - filter(ReplaceTokens, tokens: p) - - with(imgSpec) -} - -task reference (type: Copy) { - dependsOn 'docbook' - description = "Builds aggregated DocBook" - group = "Documentation" - destinationDir = buildDir - with(refSpec) -} - - -apiSpec = copySpec { - into('api') { - from(rootProject.javadoc.destinationDir) - } -} - -task docSiteLogin(type: org.springframework.gradle.tasks.Login) { - if (project.hasProperty('sshHost')) { - host = project.property('sshHost') - username = project.property('sshUsername') - key = project.property('sshPrivateKey') - } -} - -infoSpec = copySpec { - from("$projectDir/src/info") { - include 'changelog.txt' - } -} - -// upload task -task uploadDocs(type: org.springframework.gradle.tasks.ScpUpload) { - dependsOn rootProject.javadoc, reference - description = "Upload API Distribution" - group = "Distribution" - remoteDir = "/opt/www/domains/springframework.org/www/htdocs/spring-gemfire/docs/${project.version}" - login = docSiteLogin - - with(apiSpec) - with(refSpec) - with(infoSpec) -} \ No newline at end of file diff --git a/docs/src/info/changelog.txt b/docs/src/info/changelog.txt index fcd8e745..4c582513 100644 --- a/docs/src/info/changelog.txt +++ b/docs/src/info/changelog.txt @@ -2,12 +2,14 @@ SPRING DATA GEMFIRE CHANGELOG ============================= http://www.springsource.org/spring-gemfire -Changes in version 1.2.0.M1 (2012-03-20) ----------------------------------------- +Changes in version 1.1.2.RELEASE (2012-07-04) +--------------------------------------------- General -* Introduced support for annotation-based entity mapping (@Id, @PersistenceConstructor, @Id) -* Introduced support for Spring Data Repositories (query exception & derivation) +* Upgraded to GemFire 6.6.3 + +Package org.springframework.data.gemfire.config +* Fixed incorrect parsing of pdx-disk-store attribute Changes in version 1.1.1.RELEASE (2012-03-20) diff --git a/docs/src/reference/docbook/appendix/appendix-schema.xml b/docs/src/reference/docbook/appendix/appendix-schema.xml index 6014d702..f0735c13 100644 --- a/docs/src/reference/docbook/appendix/appendix-schema.xml +++ b/docs/src/reference/docbook/appendix/appendix-schema.xml @@ -3,7 +3,7 @@ Spring GemFire Integration Schema Spring GemFire Schema - + FIXME: SGF SCHEMA LOCATION/NAME CHANGED diff --git a/docs/src/reference/docbook/index.xml b/docs/src/reference/docbook/index.xml index ec0600d1..f0182cb1 100644 --- a/docs/src/reference/docbook/index.xml +++ b/docs/src/reference/docbook/index.xml @@ -5,7 +5,10 @@ xmlns:xlink="http://www.w3.org/1999/xlink"> Spring Gemfire Integration Reference Guide - @version@ + ${version} + Spring GemFire ${version} + Spring GemFire + @@ -18,6 +21,11 @@ Gierke SpringSource, a division of VMware + + David + Turanski + SpringSource, a division of VMware + @@ -47,9 +55,11 @@ + @@ -59,7 +69,7 @@ In addition to this reference documentation, there are a number of - other resources that may help you learn how to use GemFire and Spring framework. + other resources that may help you learn how to use GemFire and Spring framework. These additional, third-party resources are enumerated in this section. diff --git a/docs/src/reference/docbook/reference/bootstrap.xml b/docs/src/reference/docbook/reference/bootstrap.xml index bff74519..80a3fca1 100644 --- a/docs/src/reference/docbook/reference/bootstrap.xml +++ b/docs/src/reference/docbook/reference/bootstrap.xml @@ -20,23 +20,16 @@ To use the SGF namespace, one just needs to import it inside the configuration: - - - - - - - + ]]> - + ]]> ]]> @@ -54,30 +47,22 @@ Declaration example for the GemFire namespace. Notice the prefix usage. - Once declared, the namespace elements can be declared simply by appending the aforementioned prefix. Note that is possible to change the default namespace, for example from <beans> to <gfe>. This is useful for configuration composed mainly of GemFire components as it avoids declaring the prefix. To achieve this, simply swap the namespace prefix declaration above: - - - - - - - - - + ]]> - + ]]> ]]> @@ -94,7 +79,6 @@ Bean declaration using the <gfe> namespace. Notice the lack of prefix (as the default namespace is used). - For the remainder of this doc, to improve readability, the XML examples will simply refer to the <gfe> namespace without the namespace declaration, where possible. diff --git a/docs/src/reference/docbook/reference/mapping.xml b/docs/src/reference/docbook/reference/mapping.xml index 03409452..266d7b48 100644 --- a/docs/src/reference/docbook/reference/mapping.xml +++ b/docs/src/reference/docbook/reference/mapping.xml @@ -32,6 +32,7 @@ public class Person { … } + The first thing you see here is the @@ -71,8 +72,8 @@ public class Person { // … } - … } + The entity annotated as such will get the field foo diff --git a/docs/src/reference/docbook/reference/repositories.xml b/docs/src/reference/docbook/reference/repositories.xml index 1e4c0cbe..557adae3 100644 --- a/docs/src/reference/docbook/reference/repositories.xml +++ b/docs/src/reference/docbook/reference/repositories.xml @@ -14,7 +14,7 @@ Spring Data Gemfire provides support to use the Spring Data repository abstraction to easily persist entities into Gemfire and execute - queries. A general introduction into the repository programmin model has + queries. A general introduction into the repository programming model has been provided in . diff --git a/docs/src/reference/resources/css/highlight.css b/docs/src/reference/resources/css/highlight.css deleted file mode 100644 index ffefef72..00000000 --- a/docs/src/reference/resources/css/highlight.css +++ /dev/null @@ -1,35 +0,0 @@ -/* - code highlight CSS resemblign the Eclipse IDE default color schema - @author Costin Leau -*/ - -.hl-keyword { - color: #7F0055; - font-weight: bold; -} - -.hl-comment { - color: #3F5F5F; - font-style: italic; -} - -.hl-multiline-comment { - color: #3F5FBF; - font-style: italic; -} - -.hl-tag { - color: #3F7F7F; -} - -.hl-attribute { - color: #7F007F; -} - -.hl-value { - color: #2A00FF; -} - -.hl-string { - color: #2A00FF; -} \ No newline at end of file diff --git a/docs/src/reference/resources/css/manual.css b/docs/src/reference/resources/css/manual.css deleted file mode 100644 index 77569070..00000000 --- a/docs/src/reference/resources/css/manual.css +++ /dev/null @@ -1,99 +0,0 @@ -@IMPORT url("highlight.css"); - -html { - padding: 0pt; - margin: 0pt; -} - -body { - margin-left: 10%; - margin-right: 10%; - font-family: Arial, Sans-serif; -} - -div { - margin: 0pt; -} - -p { - text-align: justify; -} - -hr { - border: 1px solid gray; - background: gray; -} - -h1,h2,h3,h4 { - color: #234623; - font-family: Arial, Sans-serif; -} - -pre { - line-height: 1.0; - color: black; -} - -pre.programlisting { - font-size: 10pt; - padding: 7pt 3pt; - border: 1pt solid black; - background: #eeeeee; - clear: both; -} - -div.table { - margin: 1em; - padding: 0.5em; - text-align: center; -} - -div.table table { - display: table; - width: 100%; -} - -div.table td { - padding-left: 7px; - padding-right: 7px; -} - -.sidebar { - float: right; - margin: 10px 0 10px 30px; - padding: 10px 20px 20px 20px; - width: 33%; - border: 1px solid black; - background-color: #F4F4F4; - font-size: 14px; -} - -.mediaobject { - padding-top: 30px; - padding-bottom: 30px; -} - -.legalnotice { - font-family: Verdana, Arial, helvetica, sans-serif; - font-size: 12px; - font-style: italic; -} - -p.releaseinfo { - font-size: 100%; - font-weight: bold; - font-family: Verdana, Arial, helvetica, sans-serif; - padding-top: 10px; -} - -p.pubdate { - font-size: 120%; - font-weight: bold; - font-family: Verdana, Arial, helvetica, sans-serif; -} - -span.productname { - font-size: 200%; - font-weight: bold; - font-family: Verdana, Arial, helvetica, sans-serif; -} diff --git a/docs/src/reference/resources/images/admon/blank.png b/docs/src/reference/resources/images/admon/blank.png deleted file mode 100644 index 764bf4f0..00000000 Binary files a/docs/src/reference/resources/images/admon/blank.png and /dev/null differ diff --git a/docs/src/reference/resources/images/admon/caution.gif b/docs/src/reference/resources/images/admon/caution.gif deleted file mode 100644 index d9f5e5b1..00000000 Binary files a/docs/src/reference/resources/images/admon/caution.gif and /dev/null differ diff --git a/docs/src/reference/resources/images/admon/caution.png b/docs/src/reference/resources/images/admon/caution.png deleted file mode 100644 index 5b7809ca..00000000 Binary files a/docs/src/reference/resources/images/admon/caution.png and /dev/null differ diff --git a/docs/src/reference/resources/images/admon/caution.tif b/docs/src/reference/resources/images/admon/caution.tif deleted file mode 100644 index 4a282948..00000000 Binary files a/docs/src/reference/resources/images/admon/caution.tif and /dev/null differ diff --git a/docs/src/reference/resources/images/admon/draft.png b/docs/src/reference/resources/images/admon/draft.png deleted file mode 100644 index 0084708c..00000000 Binary files a/docs/src/reference/resources/images/admon/draft.png and /dev/null differ diff --git a/docs/src/reference/resources/images/admon/home.gif b/docs/src/reference/resources/images/admon/home.gif deleted file mode 100644 index 6784f5bb..00000000 Binary files a/docs/src/reference/resources/images/admon/home.gif and /dev/null differ diff --git a/docs/src/reference/resources/images/admon/home.png b/docs/src/reference/resources/images/admon/home.png deleted file mode 100644 index cbb711de..00000000 Binary files a/docs/src/reference/resources/images/admon/home.png and /dev/null differ diff --git a/docs/src/reference/resources/images/admon/important.gif b/docs/src/reference/resources/images/admon/important.gif deleted file mode 100644 index 6795d9a8..00000000 Binary files a/docs/src/reference/resources/images/admon/important.gif and /dev/null differ diff --git a/docs/src/reference/resources/images/admon/important.png b/docs/src/reference/resources/images/admon/important.png deleted file mode 100644 index ad57f6f7..00000000 Binary files a/docs/src/reference/resources/images/admon/important.png and /dev/null differ diff --git a/docs/src/reference/resources/images/admon/important.tif b/docs/src/reference/resources/images/admon/important.tif deleted file mode 100644 index 184de637..00000000 Binary files a/docs/src/reference/resources/images/admon/important.tif and /dev/null differ diff --git a/docs/src/reference/resources/images/admon/next.gif b/docs/src/reference/resources/images/admon/next.gif deleted file mode 100644 index aa1516e6..00000000 Binary files a/docs/src/reference/resources/images/admon/next.gif and /dev/null differ diff --git a/docs/src/reference/resources/images/admon/next.png b/docs/src/reference/resources/images/admon/next.png deleted file mode 100644 index 45835bf8..00000000 Binary files a/docs/src/reference/resources/images/admon/next.png and /dev/null differ diff --git a/docs/src/reference/resources/images/admon/note.gif b/docs/src/reference/resources/images/admon/note.gif deleted file mode 100644 index f329d359..00000000 Binary files a/docs/src/reference/resources/images/admon/note.gif and /dev/null differ diff --git a/docs/src/reference/resources/images/admon/note.png b/docs/src/reference/resources/images/admon/note.png deleted file mode 100644 index ad57f6f7..00000000 Binary files a/docs/src/reference/resources/images/admon/note.png and /dev/null differ diff --git a/docs/src/reference/resources/images/admon/note.tif b/docs/src/reference/resources/images/admon/note.tif deleted file mode 100644 index 08644d6b..00000000 Binary files a/docs/src/reference/resources/images/admon/note.tif and /dev/null differ diff --git a/docs/src/reference/resources/images/admon/prev.gif b/docs/src/reference/resources/images/admon/prev.gif deleted file mode 100644 index 64ca8f3c..00000000 Binary files a/docs/src/reference/resources/images/admon/prev.gif and /dev/null differ diff --git a/docs/src/reference/resources/images/admon/prev.png b/docs/src/reference/resources/images/admon/prev.png deleted file mode 100644 index cf24654f..00000000 Binary files a/docs/src/reference/resources/images/admon/prev.png and /dev/null differ diff --git a/docs/src/reference/resources/images/admon/tip.gif b/docs/src/reference/resources/images/admon/tip.gif deleted file mode 100644 index 823f2b41..00000000 Binary files a/docs/src/reference/resources/images/admon/tip.gif and /dev/null differ diff --git a/docs/src/reference/resources/images/admon/tip.png b/docs/src/reference/resources/images/admon/tip.png deleted file mode 100644 index ad57f6f7..00000000 Binary files a/docs/src/reference/resources/images/admon/tip.png and /dev/null differ diff --git a/docs/src/reference/resources/images/admon/tip.tif b/docs/src/reference/resources/images/admon/tip.tif deleted file mode 100644 index 4a3d8c75..00000000 Binary files a/docs/src/reference/resources/images/admon/tip.tif and /dev/null differ diff --git a/docs/src/reference/resources/images/admon/toc-blank.png b/docs/src/reference/resources/images/admon/toc-blank.png deleted file mode 100644 index 6ffad17a..00000000 Binary files a/docs/src/reference/resources/images/admon/toc-blank.png and /dev/null differ diff --git a/docs/src/reference/resources/images/admon/toc-minus.png b/docs/src/reference/resources/images/admon/toc-minus.png deleted file mode 100644 index abbb020c..00000000 Binary files a/docs/src/reference/resources/images/admon/toc-minus.png and /dev/null differ diff --git a/docs/src/reference/resources/images/admon/toc-plus.png b/docs/src/reference/resources/images/admon/toc-plus.png deleted file mode 100644 index 941312ce..00000000 Binary files a/docs/src/reference/resources/images/admon/toc-plus.png and /dev/null differ diff --git a/docs/src/reference/resources/images/admon/up.gif b/docs/src/reference/resources/images/admon/up.gif deleted file mode 100644 index aabc2d01..00000000 Binary files a/docs/src/reference/resources/images/admon/up.gif and /dev/null differ diff --git a/docs/src/reference/resources/images/admon/up.png b/docs/src/reference/resources/images/admon/up.png deleted file mode 100644 index 07634de2..00000000 Binary files a/docs/src/reference/resources/images/admon/up.png and /dev/null differ diff --git a/docs/src/reference/resources/images/admon/warning.gif b/docs/src/reference/resources/images/admon/warning.gif deleted file mode 100644 index c6acdec6..00000000 Binary files a/docs/src/reference/resources/images/admon/warning.gif and /dev/null differ diff --git a/docs/src/reference/resources/images/admon/warning.png b/docs/src/reference/resources/images/admon/warning.png deleted file mode 100644 index ef3e10f4..00000000 Binary files a/docs/src/reference/resources/images/admon/warning.png and /dev/null differ diff --git a/docs/src/reference/resources/images/admon/warning.tif b/docs/src/reference/resources/images/admon/warning.tif deleted file mode 100644 index 7b6611ec..00000000 Binary files a/docs/src/reference/resources/images/admon/warning.tif and /dev/null differ diff --git a/docs/src/reference/resources/images/callouts/1.png b/docs/src/reference/resources/images/callouts/1.png deleted file mode 100644 index 7d473430..00000000 Binary files a/docs/src/reference/resources/images/callouts/1.png and /dev/null differ diff --git a/docs/src/reference/resources/images/callouts/10.png b/docs/src/reference/resources/images/callouts/10.png deleted file mode 100644 index 997bbc82..00000000 Binary files a/docs/src/reference/resources/images/callouts/10.png and /dev/null differ diff --git a/docs/src/reference/resources/images/callouts/11.png b/docs/src/reference/resources/images/callouts/11.png deleted file mode 100644 index ce47dac3..00000000 Binary files a/docs/src/reference/resources/images/callouts/11.png and /dev/null differ diff --git a/docs/src/reference/resources/images/callouts/12.png b/docs/src/reference/resources/images/callouts/12.png deleted file mode 100644 index 31daf4e2..00000000 Binary files a/docs/src/reference/resources/images/callouts/12.png and /dev/null differ diff --git a/docs/src/reference/resources/images/callouts/13.png b/docs/src/reference/resources/images/callouts/13.png deleted file mode 100644 index 14021a89..00000000 Binary files a/docs/src/reference/resources/images/callouts/13.png and /dev/null differ diff --git a/docs/src/reference/resources/images/callouts/14.png b/docs/src/reference/resources/images/callouts/14.png deleted file mode 100644 index 64014b75..00000000 Binary files a/docs/src/reference/resources/images/callouts/14.png and /dev/null differ diff --git a/docs/src/reference/resources/images/callouts/15.png b/docs/src/reference/resources/images/callouts/15.png deleted file mode 100644 index 0d65765f..00000000 Binary files a/docs/src/reference/resources/images/callouts/15.png and /dev/null differ diff --git a/docs/src/reference/resources/images/callouts/2.png b/docs/src/reference/resources/images/callouts/2.png deleted file mode 100644 index 5d09341b..00000000 Binary files a/docs/src/reference/resources/images/callouts/2.png and /dev/null differ diff --git a/docs/src/reference/resources/images/callouts/3.png b/docs/src/reference/resources/images/callouts/3.png deleted file mode 100644 index ef7b7004..00000000 Binary files a/docs/src/reference/resources/images/callouts/3.png and /dev/null differ diff --git a/docs/src/reference/resources/images/callouts/4.png b/docs/src/reference/resources/images/callouts/4.png deleted file mode 100644 index adb8364e..00000000 Binary files a/docs/src/reference/resources/images/callouts/4.png and /dev/null differ diff --git a/docs/src/reference/resources/images/callouts/5.png b/docs/src/reference/resources/images/callouts/5.png deleted file mode 100644 index 4d7eb460..00000000 Binary files a/docs/src/reference/resources/images/callouts/5.png and /dev/null differ diff --git a/docs/src/reference/resources/images/callouts/6.png b/docs/src/reference/resources/images/callouts/6.png deleted file mode 100644 index 0ba694af..00000000 Binary files a/docs/src/reference/resources/images/callouts/6.png and /dev/null differ diff --git a/docs/src/reference/resources/images/callouts/7.png b/docs/src/reference/resources/images/callouts/7.png deleted file mode 100644 index 472e96f8..00000000 Binary files a/docs/src/reference/resources/images/callouts/7.png and /dev/null differ diff --git a/docs/src/reference/resources/images/callouts/8.png b/docs/src/reference/resources/images/callouts/8.png deleted file mode 100644 index 5e60973c..00000000 Binary files a/docs/src/reference/resources/images/callouts/8.png and /dev/null differ diff --git a/docs/src/reference/resources/images/callouts/9.png b/docs/src/reference/resources/images/callouts/9.png deleted file mode 100644 index a0676d26..00000000 Binary files a/docs/src/reference/resources/images/callouts/9.png and /dev/null differ diff --git a/docs/src/reference/resources/images/logo.png b/docs/src/reference/resources/images/logo.png deleted file mode 100644 index a9f6d959..00000000 Binary files a/docs/src/reference/resources/images/logo.png and /dev/null differ diff --git a/docs/src/reference/resources/images/xdev-spring_logo.jpg b/docs/src/reference/resources/images/xdev-spring_logo.jpg deleted file mode 100644 index 622962ee..00000000 Binary files a/docs/src/reference/resources/images/xdev-spring_logo.jpg and /dev/null differ diff --git a/docs/src/reference/resources/xsl/fopdf.xsl b/docs/src/reference/resources/xsl/fopdf.xsl deleted file mode 100644 index 8582406d..00000000 --- a/docs/src/reference/resources/xsl/fopdf.xsl +++ /dev/null @@ -1,449 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - , - - - - - ( - - ) - - - - Copyright © 2010-2011 - - - - - - - - - - - - - - - - - - - - - - - - - - - - -5em - -5em - - - - - - - - - - - Spring Data Redis () - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - - 1 - 1 - 0 - - - - - - book toc - - - - 2 - - - - - - - - - - 0 - 0 - 0 - - - 5mm - 10mm - 10mm - - 15mm - 10mm - 0mm - - 18mm - 18mm - - - 0pc - - - - - justify - false - - - 11 - 8 - - - 1.4 - - - - - - - 0.8em - - - - - - 17.4cm - - - - 4pt - 4pt - 4pt - 4pt - - - - 0.1pt - 0.1pt - - - - - 1 - - - - - - - - left - bold - - - pt - - - - - - - - - - - - - - - 0.8em - 0.8em - 0.8em - - - pt - - 0.1em - 0.1em - 0.1em - - - 0.6em - 0.6em - 0.6em - - - pt - - 0.1em - 0.1em - 0.1em - - - 0.4em - 0.4em - 0.4em - - - pt - - 0.1em - 0.1em - 0.1em - - - - - bold - - - pt - - false - 0.4em - 0.6em - 0.8em - - - - - - - - - pt - - - - - 1em - 1em - 1em - #444444 - solid - 0.1pt - 0.5em - 0.5em - 0.5em - 0.5em - 0.5em - 0.5em - - - - 1 - - #F0F0F0 - - - - - - 0 - 1 - - - 90 - - - - - '1' - src/docbkx/resources/images/admons/ - - - - - - figure after - example before - equation before - table before - procedure before - - - - 1 - - - - 0.8em - 0.8em - 0.8em - 0.1em - 0.1em - 0.1em - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/src/reference/resources/xsl/highlight-fo.xsl b/docs/src/reference/resources/xsl/highlight-fo.xsl deleted file mode 100644 index f0b5dd94..00000000 --- a/docs/src/reference/resources/xsl/highlight-fo.xsl +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/src/reference/resources/xsl/highlight.xsl b/docs/src/reference/resources/xsl/highlight.xsl deleted file mode 100644 index c63c4765..00000000 --- a/docs/src/reference/resources/xsl/highlight.xsl +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/src/reference/resources/xsl/html-custom.xsl b/docs/src/reference/resources/xsl/html-custom.xsl deleted file mode 100644 index a6330843..00000000 --- a/docs/src/reference/resources/xsl/html-custom.xsl +++ /dev/null @@ -1,145 +0,0 @@ - - - - - - - - - - '5' - '1' - - - 1 - - - 1 - - - 0 - 0 - 1 - - - - images/admon/ - .png - - 120 - images/callouts/ - .png - - - css/manual.css - text/css - book toc,title - - text-align: left - - - - - - - - - - - - - - 3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Begin Google Analytics code - - - End Google Analytics code - - - - - Begin LoopFuse code - - - End LoopFuse code - - - \ No newline at end of file diff --git a/docs/src/reference/resources/xsl/html-single-custom.xsl b/docs/src/reference/resources/xsl/html-single-custom.xsl deleted file mode 100644 index c37095bb..00000000 --- a/docs/src/reference/resources/xsl/html-single-custom.xsl +++ /dev/null @@ -1,142 +0,0 @@ - - - - - - - - - - - 1 - - - 1 - - - 0 - 0 - 1 - - - - images/admon/ - .png - - 120 - images/callouts/ - .png - - - css/manual.css - text/css - book toc,title - - text-align: left - - - - - - - - - - - - - - 2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Begin Google Analytics code - - -End Google Analytics code - - - - -Begin LoopFuse code - - -End LoopFuse code - - - \ No newline at end of file diff --git a/docs/src/reference/resources/xsl/html.xsl b/docs/src/reference/resources/xsl/html.xsl deleted file mode 100644 index 2b0f8d6e..00000000 --- a/docs/src/reference/resources/xsl/html.xsl +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - - - - - 0 - 0 - 1 - - - - - - book toc - - - - 3 - - - - - 1 - - - - - - - 1 - - - 90 - - - - - 1 - images/admons/ - - - - figure after - example before - equation before - table before - procedure before - - - - , - - - - () - - - - -
-

Authors

-

- -

-
- - - - - - -
- diff --git a/docs/src/reference/resources/xsl/html_chunk.xsl b/docs/src/reference/resources/xsl/html_chunk.xsl deleted file mode 100644 index 29b35d28..00000000 --- a/docs/src/reference/resources/xsl/html_chunk.xsl +++ /dev/null @@ -1,221 +0,0 @@ - - - - - - - - - - '5' - '1' - 0 - 0 - 1 - - - - book toc - qandaset toc - - - 3 - - - 1 - - - - - 1 - 90 - - - - - 1 - images/admons/ - - - - figure after - example before - equation before - table before - procedure before - - - - , - - - - () - - - - - -
-

Authors

-

- -

-
- - - - - - - - 1 - - - - - - - - - - - - - -
diff --git a/docs/src/reference/resources/xsl/pdf-custom.xsl b/docs/src/reference/resources/xsl/pdf-custom.xsl deleted file mode 100644 index 9b94a030..00000000 --- a/docs/src/reference/resources/xsl/pdf-custom.xsl +++ /dev/null @@ -1,522 +0,0 @@ - - - - - - - - - - - '1' - images/admon/ - .png - - - - - 24pt - - - - - - - - - - - - - - - - - - - - -5em - -5em - - - - - - book toc,title - - - - - - - - - - - - - - - - - Spring GemFire - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - 0 - 0 - 0 - 1 - - - - - 0 - 0 - 0 - - - - false - - - 11 - 8 - - - 1.4 - - - - left - bold - - - pt - - - - - - - - - - - - - - - 0.8em - 0.8em - 0.8em - - - pt - - 0.1em - 0.1em - 0.1em - - - 0.6em - 0.6em - 0.6em - - - pt - - 0.1em - 0.1em - 0.1em - - - 0.4em - 0.4em - 0.4em - - - pt - - 0.1em - 0.1em - 0.1em - - - 0.3em - 0.3em - 0.3em - - - pt - - 0.1em - 0.1em - 0.1em - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 4pt - 4pt - 4pt - 4pt - - - - 0.1pt - 0.1pt - - - - - - - - - - - - - - - - - - pt - - - - - 1em - 1em - 1em - 0.1em - 0.1em - 0.1em - - #444444 - solid - 0.1pt - 0.5em - 0.5em - 0.5em - 0.5em - 0.5em - 0.5em - - - - 1 - - #F0F0F0 - - - - 0.1em - 0.1em - 0.1em - 0.1em - 0.1em - 0.1em - - - - 0.5em - 0.5em - 0.5em - 0.1em - 0.1em - 0.1em - always - - - - - - normal - italic - - - pt - - false - 0.1em - 0.1em - 0.1em - - - - - - 0 - 1 - - - 90 - - - - - - figure after - example after - equation before - table before - procedure before - - - - 1 - - 0pt - - - 3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/gradle.properties b/gradle.properties index fc45ddf2..d3ceb21a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,7 +7,7 @@ slf4jVersion = 1.6.4 # Common libraries springVersion = 3.1.1.RELEASE springDataCommonsVersion = 1.3.0.BUILD-SNAPSHOT -gemfireVersion = 6.6.2 +gemfireVersion = 6.6.3 # Testing junitVersion = 4.8.1 @@ -23,4 +23,4 @@ gemfire.range = "[6.5, 7.0)" # -------------------- # Project wide version # -------------------- -springGemfireVersion=1.1.1.BUILD-SNAPSHOT +springGemfireVersion=1.2.0.BUILD-SNAPSHOT diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 45bfb5c8..e3b3376e 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f1c7bed2..fd3d2363 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Tue Jul 19 18:42:40 EEST 2011 +#Sun Jul 01 21:12:28 EEST 2012 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=http\://repo.gradle.org/gradle/distributions/gradle-1.0-milestone-3-bin.zip +distributionUrl=http\://services.gradle.org/distributions/gradle-1.0-bin.zip diff --git a/gradlew b/gradlew index d8809f15..cf126509 100755 --- a/gradlew +++ b/gradlew @@ -1,16 +1,16 @@ #!/bin/bash ############################################################################## -## ## -## Gradle wrapper script for UN*X ## -## ## +## +## Gradle start up script for UN*X +## ############################################################################## -# Uncomment those lines to set JVM options. GRADLE_OPTS and JAVA_OPTS can be used together. -# GRADLE_OPTS="$GRADLE_OPTS -Xmx512m" -# JAVA_OPTS="$JAVA_OPTS -Xmx512m" +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" -GRADLE_APP_NAME=Gradle +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" @@ -42,54 +42,51 @@ case "`uname`" in ;; esac -# Attempt to set JAVA_HOME if it's not already set. -if [ -z "$JAVA_HOME" ] ; then - if $darwin ; then - [ -z "$JAVA_HOME" -a -d "/Library/Java/Home" ] && export JAVA_HOME="/Library/Java/Home" - [ -z "$JAVA_HOME" -a -d "/System/Library/Frameworks/JavaVM.framework/Home" ] && export JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Home" - else - javaExecutable="`which javac`" - [ -z "$javaExecutable" -o "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ] && die "JAVA_HOME not set and cannot find javac to deduce location, please set JAVA_HOME." - # readlink(1) is not available as standard on Solaris 10. - readLink=`which readlink` - [ `expr "$readLink" : '\([^ ]*\)'` = "no" ] && die "JAVA_HOME not set and readlink not available, please set JAVA_HOME." - javaExecutable="`readlink -f \"$javaExecutable\"`" - javaHome="`dirname \"$javaExecutable\"`" - javaHome=`expr "$javaHome" : '\(.*\)/bin'` - export JAVA_HOME="$javaHome" - fi -fi - # For Cygwin, ensure paths are in UNIX format before anything is touched. if $cygwin ; then - [ -n "$JAVACMD" ] && JAVACMD=`cygpath --unix "$JAVACMD"` [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` fi -STARTER_MAIN_CLASS=org.gradle.wrapper.GradleWrapperMain -CLASSPATH=`dirname "$0"`/gradle/wrapper/gradle-wrapper.jar -WRAPPER_PROPERTIES=`dirname "$0"`/gradle/wrapper/gradle-wrapper.properties -# Determine the Java command to use to start the JVM. -if [ -z "$JAVACMD" ] ; then - if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" else - JAVACMD="java" + PRG=`dirname "$PRG"`"/$link" fi -fi -if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" +APP_HOME="`pwd -P`" +cd "$SAVED" + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." -fi -if [ -z "$JAVA_HOME" ] ; then - warn "JAVA_HOME environment variable is not set" fi # Increase the maximum file descriptors if we can. @@ -108,15 +105,14 @@ if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then fi fi -# For Darwin, add GRADLE_APP_NAME to the JAVA_OPTS as -Xdock:name +# For Darwin, add options to specify how the application appears in the dock if $darwin; then - JAVA_OPTS="$JAVA_OPTS -Xdock:name=$GRADLE_APP_NAME" -# we may also want to set -Xdock:image + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" fi # For Cygwin, switch paths to Windows format before running java if $cygwin ; then - JAVA_HOME=`cygpath --path --mixed "$JAVA_HOME"` + APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` # We build the pattern for arguments to be converted via cygpath @@ -143,7 +139,7 @@ if $cygwin ; then eval `echo args$i`="\"$arg\"" fi i=$((i+1)) - done + done case $i in (0) set -- ;; (1) set -- "$args0" ;; @@ -158,11 +154,11 @@ if $cygwin ; then esac fi -GRADLE_APP_BASE_NAME=`basename "$0"` +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" -exec "$JAVACMD" $JAVA_OPTS $GRADLE_OPTS \ - -classpath "$CLASSPATH" \ - -Dorg.gradle.appname="$GRADLE_APP_BASE_NAME" \ - -Dorg.gradle.wrapper.properties="$WRAPPER_PROPERTIES" \ - $STARTER_MAIN_CLASS \ - "$@" +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/gradlew.bat b/gradlew.bat index 479fdddb..8a0b282a 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,24 +1,37 @@ @if "%DEBUG%" == "" @echo off @rem ########################################################################## -@rem ## -@rem Gradle startup script for Windows ## -@rem ## +@rem +@rem Gradle startup script for Windows +@rem @rem ########################################################################## @rem Set local scope for the variables with windows NT shell if "%OS%"=="Windows_NT" setlocal -@rem Uncomment those lines to set JVM options. GRADLE_OPTS and JAVA_OPTS can be used together. -@rem set GRADLE_OPTS=%GRADLE_OPTS% -Xmx512m -@rem set JAVA_OPTS=%JAVA_OPTS% -Xmx512m +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=.\ +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% @rem Find java.exe -set JAVA_EXE=java.exe -if not defined JAVA_HOME goto init +if defined JAVA_HOME goto findJavaFromJavaHome +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe @@ -29,14 +42,14 @@ echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% echo. echo Please set the JAVA_HOME variable in your environment to match the echo location of your Java installation. -echo. -goto end + +goto fail :init @rem Get command-line arguments, handling Windowz variants if not "%OS%" == "Windows_NT" goto win9xME_args -if "%eval[2+2]" == "4" goto 4NT_args +if "%@eval[2+2]" == "4" goto 4NT_args :win9xME_args @rem Slurp the command line arguments. @@ -56,27 +69,22 @@ set CMD_LINE_ARGS=%$ :execute @rem Setup the command line -set STARTER_MAIN_CLASS=org.gradle.wrapper.GradleWrapperMain -set CLASSPATH=%DIRNAME%\gradle\wrapper\gradle-wrapper.jar -set WRAPPER_PROPERTIES=%DIRNAME%\gradle\wrapper\gradle-wrapper.properties - -set GRADLE_OPTS=%JAVA_OPTS% %GRADLE_OPTS% -Dorg.gradle.wrapper.properties="%WRAPPER_PROPERTIES%" +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar @rem Execute Gradle -"%JAVA_EXE%" %GRADLE_OPTS% -classpath "%CLASSPATH%" %STARTER_MAIN_CLASS% %CMD_LINE_ARGS% +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% :end @rem End local scope for the variables with windows NT shell if "%ERRORLEVEL%"=="0" goto mainEnd -if not "%OS%"=="Windows_NT" echo 1 > nul | choice /n /c:1 - +:fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit "%ERRORLEVEL%" -exit /b "%ERRORLEVEL%" +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 :mainEnd if "%OS%"=="Windows_NT" endlocal -:omega \ No newline at end of file +:omega diff --git a/maven.gradle b/maven.gradle index 4c5d933f..fbf2ac92 100644 --- a/maven.gradle +++ b/maven.gradle @@ -1,145 +1,64 @@ apply plugin: 'maven' -// Create a source jar for uploading -task sourceJar(type: Jar, dependsOn: jar) { - classifier = 'sources' - from sourceSets.main.allSource -} +ext.optionalDeps = [] +ext.providedDeps = [] -// Create a javadoc jar for uploading -task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = 'javadoc' - from javadoc.destinationDir -} - -artifacts { - archives sourceJar - archives javadocJar -} - -// Configuration for SpringSource s3 maven deployer -configurations { - deployerJars -} -dependencies { - deployerJars "org.springframework.build.aws:org.springframework.build.aws.maven:3.0.0.RELEASE" -} - -// Remove the archive configuration from the runtime configuration, so that anything added to archives -// (such as the source jar) is no longer included in the runtime classpath -configurations.default.extendsFrom = [configurations.runtime] as Set -// Add the main jar into the default configuration -artifacts { 'default' jar } - -gradle.taskGraph.whenReady {graph -> - if (graph.hasTask(uploadArchives)) { - // check properties defined and fail early - s3AccessKey - s3SecretAccessKey - } -} - -def deployer = null - -uploadArchives { - description = "Maven deploy of archives artifacts to SpringSource Maven repos" // url appended below - group = "Distribution" - // Maven deployment - def releaseRepositoryUrl = "file://${project.properties.mavenSyncRepoDir}" - def milestoneRepositoryUrl = 's3://maven.springframework.org/milestone' - def snapshotRepositoryUrl = 's3://maven.springframework.org/snapshot' - - // add a configuration with a classpath that includes our s3 maven deployer - configurations { deployerJars } - dependencies { - deployerJars "org.springframework.build.aws:org.springframework.build.aws.maven:3.0.0.RELEASE" - } - - deployer = repositories.mavenDeployer { - configuration = configurations.deployerJars - // releaseBuild - if (releaseBuild) { - logger.info("Deploying to local Maven repo " + releaseRepositoryUrl) - // "mavenSyncRepoDir" should be set in properties - repository(url: releaseRepositoryUrl) - } else { - s3credentials = [userName: project.properties.s3AccessKey, passphrase: project.properties.s3SecretAccessKey] - repository(url: milestoneRepositoryUrl) { - authentication(s3credentials) - } - snapshotRepository(url: snapshotRepositoryUrl) { - authentication(s3credentials) - } - } - } - - customizePom(deployer.pom) -} +ext.optional = { optionalDeps << it } +ext.provided = { providedDeps << it } install { - customizePom(repositories.mavenInstaller.pom) + repositories.mavenInstaller { + customizePom(pom, project) + } } -def customizePom(pom) { - def optionalDeps = ['log4j','jsr250-api'] - - //pom.scopeMappings.addMapping(10, configurations.provided, 'provided') - pom.whenConfigured { p -> - // Remove test scope dependencies from published poms - p.dependencies = p.dependencies.findAll {it.scope != 'test'} - - // Flag optional deps - def opDeps = configurations.testRuntime.allDependencies.findAll { gradleDep -> - gradleDep.asDynamicObject.hasProperty('optional') && gradleDep.optional +def customizePom(pom, gradleProject) { + pom.whenConfigured { generatedPom -> + // respect 'optional' and 'provided' dependencies + gradleProject.optionalDeps.each { dep -> + generatedPom.dependencies.find { it.artifactId == dep.name }?.optional = true + } + gradleProject.providedDeps.each { dep -> + generatedPom.dependencies.find { it.artifactId == dep.name }?.scope = 'provided' } - p.dependencies.findAll { dep -> - optionalDeps.contains(dep.artifactId) || - dep.groupId.startsWith('org.slf4j') || - opDeps.any { op -> - (dep.groupId == op.group && dep.artifactId == op.name) - } - }*.optional = true - - p.groupId = "org.springframework.data" - } - - pom.project { - name = project.description - description = project.description - url = 'http://github.com/SpringSource/spring-gemfire' - organization { - name = 'SpringSource' - url = 'http://www.springsource.org/spring-gemfire' + // eliminate test-scoped dependencies (no need in maven central poms) + generatedPom.dependencies.removeAll { dep -> + dep.scope == 'test' } - licenses { - license { - name 'The Apache Software License, Version 2.0' - url 'http://www.apache.org/licenses/LICENSE-2.0.txt' - distribution 'repo' - } - } - scm { + // add all items necessary for maven central publication + generatedPom.project { + name = gradleProject.description + description = gradleProject.description url = 'http://github.com/SpringSource/spring-gemfire' - connection = 'scm:git:git://github.com/SpringSource/spring-gemfire' - developerConnection = 'scm:git:git://github.com/SpringSource/spring-gemfire' - } - developers { - developer { - id = 'costin' - name = 'Costin Leau' - email = 'cleau@vmware.com' + organization { + name = 'SpringSource' + url = 'http://www.springsource.org/spring-gemfire' } - } - - // similar to Spring's configuration - dependencies { - dependency { - artifactId = groupId = 'commons-logging' - scope = 'compile' - optional = 'true' - version = '1.1.1' + licenses { + license { + name 'The Apache Software License, Version 2.0' + url 'http://www.apache.org/licenses/LICENSE-2.0.txt' + distribution 'repo' + } + } + scm { + url = 'http://github.com/SpringSource/spring-gemfire' + connection = 'scm:git:git://github.com/SpringSource/spring-gemfire' + developerConnection = 'scm:git:git://github.com/SpringSource/spring-gemfire' + } + developers { + developer { + id = 'costin' + name = 'Costin Leau' + email = 'cleau@vmware.com' + } + developer { + id = 'dturanski' + name = 'David Turanski' + email = 'dturanski@vmware.com' + } } } } diff --git a/samples/hello-world/build.gradle b/samples/hello-world/build.gradle index 7fab5087..789093dc 100644 --- a/samples/hello-world/build.gradle +++ b/samples/hello-world/build.gradle @@ -3,43 +3,35 @@ description = 'Spring Data GemFire Samples - Hello World' apply plugin: 'base' apply plugin: 'idea' apply plugin: 'java' -apply plugin: 'eclipse' // `gradle eclipse` to generate .classpath/.project +apply plugin: 'eclipse' +apply plugin: 'application' [compileJava, compileTestJava]*.options*.compilerArgs = ["-Xlint:-serial"] - repositories { - mavenLocal() - mavenCentral() // Public Spring artefacts - mavenRepo name: "springsource-org-release", urls: "http://repository.springsource.com/maven/bundles/release" - mavenRepo name: "spring-release", urls: "http://maven.springframework.org/release" - mavenRepo name: "spring-milestone", urls: "http://maven.springframework.org/milestone" - mavenRepo name: "spring-snapshot", urls: "http://maven.springframework.org/snapshot" - mavenRepo name: "sonatype-snapshot", urls: "http://oss.sonatype.org/content/repositories/snapshots" - mavenRepo name: "ext-snapshots", urls: "http://springframework.svn.sourceforge.net/svnroot/springframework/repos/repo-ext/" - mavenRepo name: "gemfire-release-repo", urls: "http://dist.gemstone.com/maven/release" + maven { url "http://repo.springsource.org/libs-snapshot" } + mavenLocal() } dependencies { compile "org.springframework.data:spring-data-gemfire:$version" compile "javax.inject:javax.inject:1" compile "javax.annotation:jsr250-api:1.0" + + runtime "log4j:log4j:$log4jVersion" + runtime "org.slf4j:slf4j-log4j12:$slf4jVersion" testCompile "junit:junit:$junitVersion" testCompile "org.springframework:spring-test:$springVersion" } -sourceCompatibility = 1.5 -targetCompatibility = 1.5 - -task run(type: JavaExec) { - description = 'Runs the application' - main = "org.springframework.data.gemfire.samples.helloworld.Main" - classpath = sourceSets.main.runtimeClasspath - standardInput = System.in - systemProperties['java.net.preferIPv4Stack'] = 'true' +run { + main = "org.springframework.data.gemfire.samples.helloworld.Main" + classpath = sourceSets.main.runtimeClasspath + standardInput = System.in + systemProperties['java.net.preferIPv4Stack'] = 'true' } defaultTasks 'run' \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index c493e64a..f79b008d 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,5 +1 @@ rootProject.name = 'spring-data-gemfire' - -include 'docs' - -docs = findProject(':docs') \ No newline at end of file diff --git a/src/main/java/org/springframework/data/gemfire/CacheFactoryBean.java b/src/main/java/org/springframework/data/gemfire/CacheFactoryBean.java index 478d5d1b..d0922b23 100644 --- a/src/main/java/org/springframework/data/gemfire/CacheFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/CacheFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2011 the original author or authors. + * Copyright 2010-2012 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. @@ -16,6 +16,9 @@ package org.springframework.data.gemfire; +import java.io.File; +import java.util.List; +import java.util.Map; import java.util.Properties; import org.apache.commons.logging.Log; @@ -33,33 +36,44 @@ import org.springframework.dao.DataAccessException; import org.springframework.dao.support.PersistenceExceptionTranslator; import org.springframework.util.Assert; import org.springframework.util.ClassUtils; +import org.springframework.util.CollectionUtils; import com.gemstone.gemfire.GemFireException; import com.gemstone.gemfire.cache.Cache; import com.gemstone.gemfire.cache.CacheClosedException; import com.gemstone.gemfire.cache.CacheFactory; +import com.gemstone.gemfire.cache.CacheTransactionManager; +import com.gemstone.gemfire.cache.DynamicRegionFactory; import com.gemstone.gemfire.cache.GemFireCache; +import com.gemstone.gemfire.cache.TransactionListener; +import com.gemstone.gemfire.cache.TransactionWriter; import com.gemstone.gemfire.distributed.DistributedMember; import com.gemstone.gemfire.distributed.DistributedSystem; +import com.gemstone.gemfire.internal.cache.GemFireCacheImpl; +import com.gemstone.gemfire.internal.datasource.ConfigProperty; +import com.gemstone.gemfire.internal.jndi.JNDIInvoker; import com.gemstone.gemfire.pdx.PdxSerializable; import com.gemstone.gemfire.pdx.PdxSerializer; /** - * Factory used for configuring a Gemfire Cache manager. Allows either retrieval of an existing, opened cache - * or the creation of a new one. - - *

This class implements the {@link org.springframework.dao.support.PersistenceExceptionTranslator} + * Factory used for configuring a Gemfire Cache manager. Allows either retrieval + * of an existing, opened cache or the creation of a new one. + * + *

+ * This class implements the + * {@link org.springframework.dao.support.PersistenceExceptionTranslator} * interface, as auto-detected by Spring's - * {@link org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor}, - * for AOP-based translation of native exceptions to Spring DataAccessExceptions. - * Hence, the presence of this class automatically enables - * a PersistenceExceptionTranslationPostProcessor to translate GemFire exceptions. + * {@link org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor} + * , for AOP-based translation of native exceptions to Spring + * DataAccessExceptions. Hence, the presence of this class automatically enables + * a PersistenceExceptionTranslationPostProcessor to translate GemFire + * exceptions. * * @author Costin Leau + * @author David Turanski */ public class CacheFactoryBean implements BeanNameAware, BeanFactoryAware, BeanClassLoaderAware, DisposableBean, InitializingBean, FactoryBean, PersistenceExceptionTranslator { - /** * Inner class to avoid a hard dependency on the GemFire 6.6 API. * @@ -67,12 +81,13 @@ public class CacheFactoryBean implements BeanNameAware, BeanFactoryAware, BeanCl */ private class PdxOptions implements Runnable { - private CacheFactory factory; + private final CacheFactory factory; PdxOptions(CacheFactory factory) { this.factory = factory; } + @Override public void run() { if (pdxSerializer != null) { Assert.isAssignable(PdxSerializer.class, pdxSerializer.getClass(), "Invalid pdx serializer used"); @@ -93,24 +108,157 @@ public class CacheFactoryBean implements BeanNameAware, BeanFactoryAware, BeanCl } } + private class InternalCacheOptions implements Runnable { + private final GemFireCacheImpl cacheImpl; + + InternalCacheOptions(GemFireCache cache) { + this.cacheImpl = (GemFireCacheImpl) cache; + } + + @Override + public void run() { + if (lockLease != null) { + cacheImpl.setLockLease(lockLease); + } + if (lockTimeout != null) { + cacheImpl.setLockTimeout(lockTimeout); + } + if (searchTimeout != null) { + cacheImpl.setSearchTimeout(searchTimeout); + } + if (messageSyncInterval != null) { + cacheImpl.setMessageSyncInterval(messageSyncInterval); + } + } + } + + public static class DynamicRegionSupport { + private String diskDir; + + private String poolName; + + private Boolean persistent = Boolean.TRUE; + + private Boolean registerInterest = Boolean.TRUE; + + public String getDiskDir() { + return diskDir; + } + + public void setDiskDir(String diskDir) { + this.diskDir = diskDir; + } + + public Boolean getPersistent() { + return persistent; + } + + public void setPersistent(Boolean persistent) { + this.persistent = persistent; + } + + public Boolean getRegisterInterest() { + return registerInterest; + } + + public void setRegisterInterest(Boolean registerInterest) { + this.registerInterest = registerInterest; + } + + public String getPoolName() { + return poolName; + } + + public void setPoolName(String poolName) { + this.poolName = poolName; + } + + public void initializeDynamicRegionFactory() { + DynamicRegionFactory.Config config = null; + if (diskDir == null) { + config = new DynamicRegionFactory.Config(null, poolName, persistent, registerInterest); + } + else { + config = new DynamicRegionFactory.Config(new File(diskDir), poolName, persistent, registerInterest); + } + DynamicRegionFactory.get().open(config); + } + } + + public static class JndiDataSource { + private Map attributes; + + private List props; + + public Map getAttributes() { + return attributes; + } + + public void setAttributes(Map attributes) { + this.attributes = attributes; + } + + public List getProps() { + return props; + } + + public void setProps(List props) { + this.props = props; + } + } + protected final Log log = LogFactory.getLog(getClass()); private GemFireCache cache; + private Resource cacheXml; + private Properties properties; + private ClassLoader beanClassLoader; + private GemfireBeanFactoryLocator factoryLocator; private BeanFactory beanFactory; + private String beanName; + private boolean useBeanFactoryLocator = true; + // PDX options protected Object pdxSerializer; + protected Boolean pdxPersistent; + protected Boolean pdxReadSerialized; + protected Boolean pdxIgnoreUnreadFields; + protected String pdxDiskStoreName; + protected Boolean copyOnRead; + + protected Integer lockTimeout; + + protected Integer lockLease; + + protected Integer messageSyncInterval; + + protected Integer searchTimeout; + + protected List transactionListeners; + + protected TransactionWriter transactionWriter; + + protected Float evictionHeapPercentage; + + protected Float criticalHeapPercentage; + + protected DynamicRegionSupport dynamicRegionSupport; + + protected List jndiDataSources; + + @Override public void afterPropertiesSet() throws Exception { // initialize locator if (useBeanFactoryLocator) { @@ -132,7 +280,11 @@ public class CacheFactoryBean implements BeanNameAware, BeanFactoryAware, BeanCl try { cache = fetchCache(); msg = "Retrieved existing"; - } catch (CacheClosedException ex) { + } + catch (CacheClosedException ex) { + + initializeDynamicRegionFactory(); + Object factory = createFactory(cfgProps); // GemFire 6.6 specific options @@ -147,6 +299,11 @@ public class CacheFactoryBean implements BeanNameAware, BeanFactoryAware, BeanCl cache = createCache(factory); msg = "Created"; } + if (this.copyOnRead != null) { + cache.setCopyOnRead(this.copyOnRead); + } + + applyInternalCacheOptions(); DistributedSystem system = cache.getDistributedSystem(); DistributedMember member = system.getDistributedMember(); @@ -159,19 +316,80 @@ public class CacheFactoryBean implements BeanNameAware, BeanFactoryAware, BeanCl if (cacheXml != null) { cache.loadCacheXml(cacheXml.getInputStream()); - if (log.isDebugEnabled()) + if (log.isDebugEnabled()) { log.debug("Initialized cache from " + cacheXml); + } } - - - } finally { + setHeapPercentages(); + registerTransactionListeners(); + registerTransactionWriter(); + registerJndiDataSources(); + } + finally { th.setContextClassLoader(oldTCCL); } } + private void registerJndiDataSources() { + if (jndiDataSources != null) { + for (JndiDataSource jndiDataSource : jndiDataSources) { + JNDIInvoker.mapDatasource(jndiDataSource.getAttributes(), jndiDataSource.getProps()); + } + } + } + /** - * Sets the PDX properties for the given object. Note this is implementation specific as it depends on the type - * of the factory passed in. + * If dynamic regions are enabled, create a DynamicRegionFactory before + * creating the cache + */ + private void initializeDynamicRegionFactory() { + if (dynamicRegionSupport != null) { + dynamicRegionSupport.initializeDynamicRegionFactory(); + } + } + + private void setHeapPercentages() { + if (criticalHeapPercentage != null) { + Assert.isTrue(criticalHeapPercentage > 0.0 && criticalHeapPercentage <= 100.0, + "invalid value specified for criticalHeapPercentage :" + criticalHeapPercentage + + ". Must be > 0.0 and <= 100.0"); + cache.getResourceManager().setCriticalHeapPercentage(criticalHeapPercentage); + + } + + if (evictionHeapPercentage != null) { + Assert.isTrue(evictionHeapPercentage > 0.0 && evictionHeapPercentage <= 100.0, + "invalid value specified for evictionHeapPercentage :" + evictionHeapPercentage + + ". Must be > 0.0 and <= 100.0"); + cache.getResourceManager().setEvictionHeapPercentage(evictionHeapPercentage); + } + + } + + /** + * Register a transaction writer if declared + */ + protected void registerTransactionWriter() { + if (transactionWriter != null) { + cache.getCacheTransactionManager().setWriter(transactionWriter); + } + } + + /** + * Register all declared transaction listeners + */ + protected void registerTransactionListeners() { + if (!CollectionUtils.isEmpty(transactionListeners)) { + CacheTransactionManager txManager = cache.getCacheTransactionManager(); + for (TransactionListener transactionListener : transactionListeners) { + txManager.addListener(transactionListener); + } + } + } + + /** + * Sets the PDX properties for the given object. Note this is implementation + * specific as it depends on the type of the factory passed in. * * @param factory */ @@ -181,6 +399,10 @@ public class CacheFactoryBean implements BeanNameAware, BeanFactoryAware, BeanCl } } + protected void applyInternalCacheOptions() { + new InternalCacheOptions(cache).run(); + } + protected Object createFactory(Properties props) { return new CacheFactory(props); } @@ -198,6 +420,7 @@ public class CacheFactoryBean implements BeanNameAware, BeanFactoryAware, BeanCl return cfgProps; } + @Override public void destroy() throws Exception { if (cache != null && !cache.isClosed()) { cache.close(); @@ -211,6 +434,7 @@ public class CacheFactoryBean implements BeanNameAware, BeanFactoryAware, BeanCl } } + @Override public DataAccessException translateExceptionIfPossible(RuntimeException ex) { if (ex instanceof GemFireException) { return GemfireCacheUtils.convertGemfireAccessException((GemFireException) ex); @@ -226,26 +450,32 @@ public class CacheFactoryBean implements BeanNameAware, BeanFactoryAware, BeanCl return null; } + @Override public GemFireCache getObject() throws Exception { return cache; } + @Override public Class getObjectType() { return (cache != null ? cache.getClass() : Cache.class); } + @Override public boolean isSingleton() { return true; } + @Override public void setBeanClassLoader(ClassLoader classLoader) { this.beanClassLoader = classLoader; } + @Override public void setBeanFactory(BeanFactory beanFactory) throws BeansException { this.beanFactory = beanFactory; } + @Override public void setBeanName(String name) { this.beanName = name; } @@ -269,9 +499,11 @@ public class CacheFactoryBean implements BeanNameAware, BeanFactoryAware, BeanCl } /** - * Indicates whether a bean factory locator is enabled (default) for this cache definition or not. The locator stores - * the enclosing bean factory reference to allow auto-wiring of Spring beans into GemFire managed classes. Usually disabled - * when the same cache is used in multiple application context/bean factories inside the same VM. + * Indicates whether a bean factory locator is enabled (default) for this + * cache definition or not. The locator stores the enclosing bean factory + * reference to allow auto-wiring of Spring beans into GemFire managed + * classes. Usually disabled when the same cache is used in multiple + * application context/bean factories inside the same VM. * * @param usage true if the bean factory locator is used underneath or not */ @@ -280,8 +512,9 @@ public class CacheFactoryBean implements BeanNameAware, BeanFactoryAware, BeanCl } /** - * Sets the {@link PdxSerializable} for this cache. Applicable on GemFire 6.6 or higher. - * The argument is of type object for compatibility with GemFire 6.5. + * Sets the {@link PdxSerializable} for this cache. Applicable on GemFire + * 6.6 or higher. The argument is of type object for compatibility with + * GemFire 6.5. * * @param serializer pdx serializer configured for this cache. */ @@ -290,8 +523,9 @@ public class CacheFactoryBean implements BeanNameAware, BeanFactoryAware, BeanCl } /** - * Sets the object preference to PdxInstance type. Applicable on GemFire 6.6 or higher. - * + * Sets the object preference to PdxInstance type. Applicable on GemFire 6.6 + * or higher. + * * @param pdxPersistent the pdxPersistent to set */ public void setPdxPersistent(Boolean pdxPersistent) { @@ -299,7 +533,8 @@ public class CacheFactoryBean implements BeanNameAware, BeanFactoryAware, BeanCl } /** - * Controls whether the type metadata for PDX objects is persisted to disk. Applicable on GemFire 6.6 or higher. + * Controls whether the type metadata for PDX objects is persisted to disk. + * Applicable on GemFire 6.6 or higher. * * @param pdxReadSerialized the pdxReadSerialized to set */ @@ -308,7 +543,8 @@ public class CacheFactoryBean implements BeanNameAware, BeanFactoryAware, BeanCl } /** - * Controls whether pdx ignores fields that were unread during deserialization. Applicable on GemFire 6.6 or higher. + * Controls whether pdx ignores fields that were unread during + * deserialization. Applicable on GemFire 6.6 or higher. * * @param pdxIgnoreUnreadFields the pdxIgnoreUnreadFields to set */ @@ -317,8 +553,9 @@ public class CacheFactoryBean implements BeanNameAware, BeanFactoryAware, BeanCl } /** - * Set the disk store that is used for PDX meta data. Applicable on GemFire 6.6 or higher. - * + * Set the disk store that is used for PDX meta data. Applicable on GemFire + * 6.6 or higher. + * * @param pdxDiskStoreName the pdxDiskStoreName to set */ public void setPdxDiskStoreName(String pdxDiskStoreName) { @@ -331,4 +568,48 @@ public class CacheFactoryBean implements BeanNameAware, BeanFactoryAware, BeanCl protected BeanFactory getBeanFactory() { return beanFactory; } + + public void setCopyOnRead(boolean copyOnRead) { + this.copyOnRead = copyOnRead; + } + + public void setLockTimeout(int lockTimeout) { + this.lockTimeout = lockTimeout; + } + + public void setLockLease(int lockLease) { + this.lockLease = lockLease; + } + + public void setMessageSyncInterval(int messageSyncInterval) { + this.messageSyncInterval = messageSyncInterval; + } + + public void setSearchTimeout(int searchTimeout) { + this.searchTimeout = searchTimeout; + } + + public void setEvictionHeapPercentage(Float evictionHeapPercentage) { + this.evictionHeapPercentage = evictionHeapPercentage; + } + + public void setCriticalHeapPercentage(Float criticalHeapPercentage) { + this.criticalHeapPercentage = criticalHeapPercentage; + } + + public void setTransactionListeners(List transactionListeners) { + this.transactionListeners = transactionListeners; + } + + public void setTransactionWriter(TransactionWriter transactionWriter) { + this.transactionWriter = transactionWriter; + } + + public void setDynamicRegionSupport(DynamicRegionSupport dynamicRegionSupport) { + this.dynamicRegionSupport = dynamicRegionSupport; + } + + public void setJndiDataSources(List jndiDataSources) { + this.jndiDataSources = jndiDataSources; + } } \ No newline at end of file diff --git a/src/main/java/org/springframework/data/gemfire/DeclarableSupport.java b/src/main/java/org/springframework/data/gemfire/DeclarableSupport.java index 7fd60b62..e93ec3e7 100644 --- a/src/main/java/org/springframework/data/gemfire/DeclarableSupport.java +++ b/src/main/java/org/springframework/data/gemfire/DeclarableSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2011 the original author or authors. + * Copyright 2010-2012 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. @@ -25,18 +25,21 @@ import com.gemstone.gemfire.cache.CacheCallback; import com.gemstone.gemfire.cache.Declarable; /** - * Convenience class for Spring-aware GemFire Declarable components. - * Provides a reference to the current Spring application context, e.g. for bean lookup or resource loading. + * Convenience class for Spring-aware GemFire Declarable components. Provides a + * reference to the current Spring application context, e.g. for bean lookup or + * resource loading. * - * Note that in most cases, one can just declare the same components as Spring beans, through - * {@link RegionFactoryBean} which gives access to the full container capabilities and does not enforce the - * {@link Declarable} interface to be implemented. + * Note that in most cases, one can just declare the same components as Spring + * beans, through {@link RegionFactoryBean} which gives access to the full + * container capabilities and does not enforce the {@link Declarable} interface + * to be implemented. * * @author Costin Leau */ public abstract class DeclarableSupport implements CacheCallback, Declarable { private String factoryKey = null; + private BeanFactoryReference bfReference = null; public DeclarableSupport() { @@ -48,8 +51,9 @@ public abstract class DeclarableSupport implements CacheCallback, Declarable { * * {@inheritDoc} * - * @see #setFactoryKey(String) + * @see #setFactoryKey(String) */ + @Override public final void init(Properties props) { bfReference = new GemfireBeanFactoryLocator().useBeanFactory(factoryKey); initInstance(props); @@ -67,15 +71,16 @@ public abstract class DeclarableSupport implements CacheCallback, Declarable { return bfReference.getFactory(); } + @Override public void close() { bfReference.release(); bfReference = null; } /** - * Sets the key under which the enclosing beanFactory can be found. - * Needed only if multiple beanFactories are used with GemFire inside - * the same class loader / class space. + * Sets the key under which the enclosing beanFactory can be found. Needed + * only if multiple beanFactories are used with GemFire inside the same + * class loader / class space. * * @see GemfireBeanFactoryLocator * @param key diff --git a/src/main/java/org/springframework/data/gemfire/DiskStoreFactoryBean.java b/src/main/java/org/springframework/data/gemfire/DiskStoreFactoryBean.java new file mode 100644 index 00000000..bf1236ad --- /dev/null +++ b/src/main/java/org/springframework/data/gemfire/DiskStoreFactoryBean.java @@ -0,0 +1,170 @@ +/* + * Copyright 2010-2012 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; + +import java.io.File; +import java.util.List; + +import org.springframework.beans.factory.BeanNameAware; +import org.springframework.beans.factory.FactoryBean; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.util.Assert; +import org.springframework.util.CollectionUtils; + +import com.gemstone.gemfire.cache.DiskStore; +import com.gemstone.gemfire.cache.DiskStoreFactory; +import com.gemstone.gemfire.cache.GemFireCache; + +/** + * FactoryBean for creating a DiskStore + * @author David Turanski + */ +public class DiskStoreFactoryBean implements FactoryBean, InitializingBean, BeanNameAware { + + private DiskStoreFactory diskStoreFactory; + + private Boolean autoCompact; + + private Boolean allowForceCompaction; + + private Integer maxOplogSize; + + private Integer timeInterval; + + private Integer queueSize; + + private Integer compactionThreshold; + + private Integer writeBufferSize; + + private GemFireCache cache; + + private String name; + + private List diskDirs; + + @Override + public DiskStore getObject() throws Exception { + return diskStoreFactory.create(name == null ? DiskStoreFactory.DEFAULT_DISK_STORE_NAME : name); + } + + @Override + public Class getObjectType() { + return DiskStore.class; + } + + @Override + public boolean isSingleton() { + return true; + } + + @Override + public void afterPropertiesSet() throws Exception { + Assert.notNull(cache, "Cache property must be set"); + diskStoreFactory = cache.createDiskStoreFactory(); + + if (allowForceCompaction != null) { + diskStoreFactory.setAllowForceCompaction(allowForceCompaction); + } + if (compactionThreshold != null) { + diskStoreFactory.setCompactionThreshold(compactionThreshold); + } + if (autoCompact != null) { + diskStoreFactory.setAutoCompact(autoCompact); + } + if (queueSize != null) { + diskStoreFactory.setQueueSize(queueSize); + } + if (writeBufferSize != null) { + diskStoreFactory.setWriteBufferSize(writeBufferSize); + } + if (timeInterval != null) { + diskStoreFactory.setTimeInterval(timeInterval); + } + if (maxOplogSize != null) { + diskStoreFactory.setMaxOplogSize(maxOplogSize); + } + + if (!CollectionUtils.isEmpty(diskDirs)) { + File[] diskDirFiles = new File[diskDirs.size()]; + int[] diskDirSizes = new int[diskDirs.size()]; + for (int i = 0; i < diskDirs.size(); i++) { + DiskDir diskDir = diskDirs.get(i); + diskDirFiles[i] = new File(diskDir.location); + diskDirSizes[i] = diskDir.maxSize == null ? DiskStoreFactory.DEFAULT_DISK_DIR_SIZE : diskDir.maxSize; + } + diskStoreFactory.setDiskDirsAndSizes(diskDirFiles, diskDirSizes); + } + } + + public void setCache(GemFireCache cache) { + this.cache = cache; + } + + public void setAutoCompact(Boolean autoCompact) { + this.autoCompact = autoCompact; + } + + public void setAllowForceCompaction(Boolean allowForceCompaction) { + this.allowForceCompaction = allowForceCompaction; + } + + public void setMaxOplogSize(Integer maxOplogSize) { + this.maxOplogSize = maxOplogSize; + } + + public void setTimeInterval(Integer timeInterval) { + this.timeInterval = timeInterval; + } + + public void setQueueSize(Integer queueSize) { + this.queueSize = queueSize; + } + + public void setCompactionThreshold(Integer compactionThreshold) { + this.compactionThreshold = compactionThreshold; + } + + public void setWriteBufferSize(Integer writeBufferSize) { + this.writeBufferSize = writeBufferSize; + } + + public void setDiskDirs(List diskDirs) { + this.diskDirs = diskDirs; + } + + @Override + public void setBeanName(String name) { + this.name = name; + } + + public static class DiskDir { + final String location; + + final Integer maxSize; + + public DiskDir(String location, int maxSize) { + this.location = location; + this.maxSize = maxSize; + } + + public DiskDir(String location) { + this.location = location; + this.maxSize = null; + } + } +} diff --git a/src/main/java/org/springframework/data/gemfire/GemfireAccessor.java b/src/main/java/org/springframework/data/gemfire/GemfireAccessor.java index fa847eb6..ebe738ab 100644 --- a/src/main/java/org/springframework/data/gemfire/GemfireAccessor.java +++ b/src/main/java/org/springframework/data/gemfire/GemfireAccessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2011 the original author or authors. + * Copyright 2010-2012 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. diff --git a/src/main/java/org/springframework/data/gemfire/GemfireBeanFactoryLocator.java b/src/main/java/org/springframework/data/gemfire/GemfireBeanFactoryLocator.java index 2b0eeca2..2f724f82 100644 --- a/src/main/java/org/springframework/data/gemfire/GemfireBeanFactoryLocator.java +++ b/src/main/java/org/springframework/data/gemfire/GemfireBeanFactoryLocator.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2011 the original author or authors. + * Copyright 2010-2012 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. diff --git a/src/main/java/org/springframework/data/gemfire/GemfireCacheUtils.java b/src/main/java/org/springframework/data/gemfire/GemfireCacheUtils.java index cc444b80..e299f379 100644 --- a/src/main/java/org/springframework/data/gemfire/GemfireCacheUtils.java +++ b/src/main/java/org/springframework/data/gemfire/GemfireCacheUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2011 the original author or authors. + * Copyright 2010-2012 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. diff --git a/src/main/java/org/springframework/data/gemfire/GemfireCallback.java b/src/main/java/org/springframework/data/gemfire/GemfireCallback.java index f20f767e..a8c1a3d7 100644 --- a/src/main/java/org/springframework/data/gemfire/GemfireCallback.java +++ b/src/main/java/org/springframework/data/gemfire/GemfireCallback.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2011 the original author or authors. + * Copyright 2010-2012 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. diff --git a/src/main/java/org/springframework/data/gemfire/GemfireCancellationException.java b/src/main/java/org/springframework/data/gemfire/GemfireCancellationException.java index 44d1eebd..66975a08 100644 --- a/src/main/java/org/springframework/data/gemfire/GemfireCancellationException.java +++ b/src/main/java/org/springframework/data/gemfire/GemfireCancellationException.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2011 the original author or authors. + * Copyright 2010-2012 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. diff --git a/src/main/java/org/springframework/data/gemfire/GemfireIndexException.java b/src/main/java/org/springframework/data/gemfire/GemfireIndexException.java index 937e824b..50a07a84 100644 --- a/src/main/java/org/springframework/data/gemfire/GemfireIndexException.java +++ b/src/main/java/org/springframework/data/gemfire/GemfireIndexException.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2011 the original author or authors. + * Copyright 2010-2012 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. diff --git a/src/main/java/org/springframework/data/gemfire/GemfireQueryException.java b/src/main/java/org/springframework/data/gemfire/GemfireQueryException.java index 600d1dbc..b0a1c483 100644 --- a/src/main/java/org/springframework/data/gemfire/GemfireQueryException.java +++ b/src/main/java/org/springframework/data/gemfire/GemfireQueryException.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2011 the original author or authors. + * Copyright 2010-2012 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. diff --git a/src/main/java/org/springframework/data/gemfire/GemfireSystemException.java b/src/main/java/org/springframework/data/gemfire/GemfireSystemException.java index 5c7e5823..3611db75 100644 --- a/src/main/java/org/springframework/data/gemfire/GemfireSystemException.java +++ b/src/main/java/org/springframework/data/gemfire/GemfireSystemException.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2011 the original author or authors. + * Copyright 2010-2012 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. diff --git a/src/main/java/org/springframework/data/gemfire/GemfireTemplate.java b/src/main/java/org/springframework/data/gemfire/GemfireTemplate.java index 28c6a42b..7f9b0e71 100644 --- a/src/main/java/org/springframework/data/gemfire/GemfireTemplate.java +++ b/src/main/java/org/springframework/data/gemfire/GemfireTemplate.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2011 the original author or authors. + * Copyright 2010-2012 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. diff --git a/src/main/java/org/springframework/data/gemfire/GemfireTransactionCommitException.java b/src/main/java/org/springframework/data/gemfire/GemfireTransactionCommitException.java index d1545cde..ddc5a470 100644 --- a/src/main/java/org/springframework/data/gemfire/GemfireTransactionCommitException.java +++ b/src/main/java/org/springframework/data/gemfire/GemfireTransactionCommitException.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 the original author or authors. + * Copyright 2011-2012 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. diff --git a/src/main/java/org/springframework/data/gemfire/GemfireTransactionManager.java b/src/main/java/org/springframework/data/gemfire/GemfireTransactionManager.java index d7c17f9f..d6207184 100644 --- a/src/main/java/org/springframework/data/gemfire/GemfireTransactionManager.java +++ b/src/main/java/org/springframework/data/gemfire/GemfireTransactionManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2011 the original author or authors. + * Copyright 2010-2012 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. @@ -33,22 +33,26 @@ import com.gemstone.gemfire.cache.CacheTransactionManager; import com.gemstone.gemfire.cache.Region; /** - * Local transaction manager for GemFire Enterprise Fabric (GEF). Provides a {@link PlatformTransactionManager} - * implementation for a single GemFire {@link CacheTransactionManager}. + * Local transaction manager for GemFire Enterprise Fabric (GEF). Provides a + * {@link PlatformTransactionManager} implementation for a single GemFire + * {@link CacheTransactionManager}. * - * Binds one or multiple GemFire regions for the specified {@link Cache} to the thread, potentially allowing for one - * region per cache model. + * Binds one or multiple GemFire regions for the specified {@link Cache} to the + * thread, potentially allowing for one region per cache model. * *

- * This local strategy is an alternative to executing cache operations within JTA transactions. Its advantage is that - * is able to work in any environment, for example a stand-alone application or a test suite. It is not able to - * provide XA transactions, for example to share transactions with data access. + * This local strategy is an alternative to executing cache operations within + * JTA transactions. Its advantage is that is able to work in any environment, + * for example a stand-alone application or a test suite. It is not able + * to provide XA transactions, for example to share transactions with data + * access. * *

- * To prevent dirty reads, by default, the cache is configured to return copies rather then direct references for - * get operations. As a workaround, one could use explicitly deep copy objects before making changes + * To prevent dirty reads, by default, the cache is configured to return copies + * rather then direct references for get operations. As a + * workaround, one could use explicitly deep copy objects before making changes * to them to avoid unnecessary copying on every fetch. - * + * * @see com.gemstone.gemfire.cache.CacheTransactionManager * @see com.gemstone.gemfire.cache.Cache#setCopyOnRead(boolean) * @see com.gemstone.gemfire.cache.Region#get(Object) @@ -58,11 +62,13 @@ import com.gemstone.gemfire.cache.Region; * * @author Costin Leau */ -// TODO add lenient behavior if a transaction is already started on the current thread (what should happen then) +// TODO add lenient behavior if a transaction is already started on the current +// thread (what should happen then) public class GemfireTransactionManager extends AbstractPlatformTransactionManager implements InitializingBean, ResourceTransactionManager { private Cache cache; + private boolean copyOnRead = true; /** @@ -81,6 +87,7 @@ public class GemfireTransactionManager extends AbstractPlatformTransactionManage afterPropertiesSet(); } + @Override public void afterPropertiesSet() { Assert.notNull(cache, "Cache property is required"); cache.setCopyOnRead(copyOnRead); @@ -94,6 +101,7 @@ public class GemfireTransactionManager extends AbstractPlatformTransactionManage return txObject; } + @Override protected boolean isExistingTransaction(Object transaction) throws TransactionException { CacheTransactionObject txObject = (CacheTransactionObject) transaction; // Consider a pre-bound cache as transaction. @@ -126,29 +134,34 @@ public class GemfireTransactionManager extends AbstractPlatformTransactionManage @Override protected void doCommit(DefaultTransactionStatus status) throws TransactionException { - //CacheTransactionObject txObject = (CacheTransactionObject) status.getTransaction(); + // CacheTransactionObject txObject = (CacheTransactionObject) + // status.getTransaction(); if (status.isDebug()) { logger.debug("Committing Gemfire local transaction on Cache [" + cache + "]"); } try { cache.getCacheTransactionManager().commit(); - } catch (IllegalStateException ex) { + } + catch (IllegalStateException ex) { throw new NoTransactionException( "No transaction associated with the current thread; are there multiple transaction managers ?", ex); - } catch (TransactionException ex) { + } + catch (TransactionException ex) { throw new GemfireTransactionCommitException("Unexpected failure on commit of Cache local transaction", ex); } } @Override protected void doRollback(DefaultTransactionStatus status) throws TransactionException { - //CacheTransactionObject txObject = (CacheTransactionObject) status.getTransaction(); + // CacheTransactionObject txObject = (CacheTransactionObject) + // status.getTransaction(); if (status.isDebug()) { logger.debug("Rolling back Cache local transaction for [" + cache + "]"); } try { cache.getCacheTransactionManager().rollback(); - } catch (IllegalStateException ex) { + } + catch (IllegalStateException ex) { throw new NoTransactionException( "No transaction associated with the current thread; are there multiple transaction managers ?", ex); } @@ -163,6 +176,7 @@ public class GemfireTransactionManager extends AbstractPlatformTransactionManage txObject.getHolder().setRollbackOnly(); } + @Override protected void doCleanupAfterCompletion(Object transaction) { // Remove the cache holder from the thread. TransactionSynchronizationManager.unbindResource(cache); @@ -183,7 +197,7 @@ public class GemfireTransactionManager extends AbstractPlatformTransactionManage } /** - * Sets the Cache that this instance manages local transactions for. + * Sets the Cache that this instance manages local transactions for. * * @param cache Gemfire cache */ @@ -191,12 +205,14 @@ public class GemfireTransactionManager extends AbstractPlatformTransactionManage this.cache = cache; } + @Override public Object getResourceFactory() { return getCache(); } /** - * Sets the Gemfire {@link Region} (as an alternative in setting in the cache directly). + * Sets the Gemfire {@link Region} (as an alternative in setting in the + * cache directly). * * @param region Gemfire region */ @@ -206,22 +222,24 @@ public class GemfireTransactionManager extends AbstractPlatformTransactionManage } /** - * Indicates whether the cache returns direct references or copies of the objects (default) it manages. - * While copies imply additional work for every fetch operation, direct references can cause dirty reads - * across concurrent threads in the same VM, whether or not transactions are used. - *

- * One could explicitly deep copy objects before making changes (for example by using {@link com.gemstone.gemfire.CopyHelper#copy(Object)} - * in which case this setting can be set to false. However, unless there is a measurable - * performance penalty, the recommendation is to keep this setting to true - * - * @param copyOnRead whether copies (default) rather then direct references will be returned on - * fetch operations + * Indicates whether the cache returns direct references or copies of the + * objects (default) it manages. While copies imply additional work for + * every fetch operation, direct references can cause dirty reads across + * concurrent threads in the same VM, whether or not transactions are used. + *

+ * One could explicitly deep copy objects before making changes (for example + * by using {@link com.gemstone.gemfire.CopyHelper#copy(Object)} in which + * case this setting can be set to false. However, unless there + * is a measurable performance penalty, the recommendation is to keep this + * setting to true + * + * @param copyOnRead whether copies (default) rather then direct references + * will be returned on fetch operations */ public void setCopyOnRead(boolean copyOnRead) { this.copyOnRead = copyOnRead; } - /** * Indicates whether copy on read is set or not on the transaction manager. * @@ -232,7 +250,6 @@ public class GemfireTransactionManager extends AbstractPlatformTransactionManage return copyOnRead; } - /** * GemfireTM local transaction object. * @@ -254,7 +271,6 @@ public class GemfireTransactionManager extends AbstractPlatformTransactionManage private boolean rollbackOnly = false; - public boolean isRollbackOnly() { return rollbackOnly; } diff --git a/src/main/java/org/springframework/data/gemfire/IndexFactoryBean.java b/src/main/java/org/springframework/data/gemfire/IndexFactoryBean.java index fb66051b..4b804a68 100644 --- a/src/main/java/org/springframework/data/gemfire/IndexFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/IndexFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 the original author or authors. + * Copyright 2011-2012 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. diff --git a/src/main/java/org/springframework/data/gemfire/LocalRegionFactoryBean.java b/src/main/java/org/springframework/data/gemfire/LocalRegionFactoryBean.java new file mode 100644 index 00000000..e5db8f69 --- /dev/null +++ b/src/main/java/org/springframework/data/gemfire/LocalRegionFactoryBean.java @@ -0,0 +1,46 @@ +/* + * Copyright 2010-2012 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; + +import com.gemstone.gemfire.cache.DataPolicy; +import com.gemstone.gemfire.cache.RegionFactory; + +/** + * @author David Turanski + * + */ +public class LocalRegionFactoryBean extends RegionFactoryBean { + + @Override + protected void resolveDataPolicy(RegionFactory regionFactory, boolean persistent, String dataPolicyName) { + if (dataPolicyName != null) { + if ("NORMAL".equals(dataPolicyName) || dataPolicyName == null) { + regionFactory.setDataPolicy(DataPolicy.NORMAL); + } + else if ("PRELOADED".equals(dataPolicyName)) { + regionFactory.setDataPolicy(DataPolicy.PRELOADED); + } + else if ("EMPTY".equals(dataPolicyName)) { + regionFactory.setDataPolicy(DataPolicy.EMPTY); + } + else { + throw new IllegalArgumentException("Data policy '" + dataPolicyName + + "' is unsupported or invalid for local regions."); + } + } + } + +} diff --git a/src/main/java/org/springframework/data/gemfire/PartitionAttributesFactoryBean.java b/src/main/java/org/springframework/data/gemfire/PartitionAttributesFactoryBean.java index f2826ea7..d294e47a 100644 --- a/src/main/java/org/springframework/data/gemfire/PartitionAttributesFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/PartitionAttributesFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2011 the original author or authors. + * Copyright 2010-2012 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. diff --git a/src/main/java/org/springframework/data/gemfire/PartitionedRegionFactoryBean.java b/src/main/java/org/springframework/data/gemfire/PartitionedRegionFactoryBean.java new file mode 100644 index 00000000..00764171 --- /dev/null +++ b/src/main/java/org/springframework/data/gemfire/PartitionedRegionFactoryBean.java @@ -0,0 +1,49 @@ +/* + * Copyright 2010-2012 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; + +import java.util.concurrent.ConcurrentMap; + +import com.gemstone.gemfire.cache.CacheFactory; +import com.gemstone.gemfire.cache.DataPolicy; +import com.gemstone.gemfire.cache.Region; +import com.gemstone.gemfire.cache.RegionFactory; + +/** + * @author David Turanski + * + */ +public class PartitionedRegionFactoryBean extends RegionFactoryBean { + + @Override + protected void resolveDataPolicy(RegionFactory regionFactory, boolean persistent, String dataPolicyName) { + if (persistent) { + // check first for GemFire 6.5 + if (ConcurrentMap.class.isAssignableFrom(Region.class)) { + regionFactory.setDataPolicy(DataPolicy.PERSISTENT_PARTITION); + } + else { + throw new IllegalArgumentException( + "Can define persistent partitions only from GemFire 6.5 onwards - current version is [" + + CacheFactory.getVersion() + "]"); + } + } + else { + regionFactory.setDataPolicy(DataPolicy.PARTITION); + } + } + +} diff --git a/src/main/java/org/springframework/data/gemfire/RegionAttributesFactoryBean.java b/src/main/java/org/springframework/data/gemfire/RegionAttributesFactoryBean.java index 23febbc9..cae9685a 100644 --- a/src/main/java/org/springframework/data/gemfire/RegionAttributesFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/RegionAttributesFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2011 the original author or authors. + * Copyright 2010-2012 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. @@ -16,67 +16,40 @@ package org.springframework.data.gemfire; -import java.io.File; - import org.springframework.beans.factory.FactoryBean; import org.springframework.beans.factory.InitializingBean; -import org.springframework.util.ObjectUtils; import com.gemstone.gemfire.cache.AttributesFactory; import com.gemstone.gemfire.cache.RegionAttributes; /** - * Spring-friendly bean for creating {@link RegionAttributes}. Eliminates the need of using - * a XML 'factory-method' tag. + * Spring-friendly bean for creating {@link RegionAttributes}. Eliminates the + * need of using a XML 'factory-method' tag. * * @author Costin Leau */ public class RegionAttributesFactoryBean extends AttributesFactory implements FactoryBean, InitializingBean { - private int[] diskSizes; - private File[] diskDirs; - private RegionAttributes attributes; + @Override public void afterPropertiesSet() throws Exception { - if (diskSizes!= null){ - super.setDiskDirsAndSizes(diskDirs, diskSizes); - } - else{ - if (!ObjectUtils.isEmpty(diskDirs)) { - super.setDiskDirs(diskDirs); - } - } - attributes = super.create(); } + @Override public RegionAttributes getObject() throws Exception { return attributes; } + @Override public Class getObjectType() { return (attributes != null ? attributes.getClass() : RegionAttributes.class); } + @Override public boolean isSingleton() { return true; } - - - @Override - public void setDiskDirs(File[] diskDirs) { - this.diskDirs = diskDirs; - } - - /** - * Sets the sizes (in megabytes) for each disk directory. - * Used only disk directories are specified. - * - * @param sizes - */ - public void setDiskSizes(int[] sizes) { - this.diskSizes = sizes; - } } \ No newline at end of file diff --git a/src/main/java/org/springframework/data/gemfire/RegionFactoryBean.java b/src/main/java/org/springframework/data/gemfire/RegionFactoryBean.java index 7a7ea4eb..bafab68a 100644 --- a/src/main/java/org/springframework/data/gemfire/RegionFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/RegionFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2011 the original author or authors. + * Copyright 2010-2012 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. @@ -17,6 +17,7 @@ package org.springframework.data.gemfire; import java.lang.reflect.Field; +import java.util.List; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -33,7 +34,6 @@ import com.gemstone.gemfire.cache.CacheClosedException; import com.gemstone.gemfire.cache.CacheListener; import com.gemstone.gemfire.cache.CacheLoader; import com.gemstone.gemfire.cache.CacheWriter; -import com.gemstone.gemfire.cache.DataPolicy; import com.gemstone.gemfire.cache.GemFireCache; import com.gemstone.gemfire.cache.Region; import com.gemstone.gemfire.cache.RegionAttributes; @@ -41,30 +41,47 @@ import com.gemstone.gemfire.cache.RegionFactory; import com.gemstone.gemfire.cache.Scope; /** - * FactoryBean for creating generic GemFire {@link Region}s. Will try to first locate the region (by name) - * and, in case none if found, proceed to creating one using the given settings. + * FactoryBean for creating generic GemFire {@link Region}s. Will try to first + * locate the region (by name) and, in case none if found, proceed to creating + * one using the given settings. * - * Note that this factory bean allows for very flexible creation of GemFire {@link Region}. For "client" regions - * however, see {@link ClientRegionFactoryBean} which offers easier configuration and defaults. + * Note that this factory bean allows for very flexible creation of GemFire + * {@link Region}. For "client" regions however, see + * {@link ClientRegionFactoryBean} which offers easier configuration and + * defaults. * * @author Costin Leau + * @author David Turanski */ -public class RegionFactoryBean extends RegionLookupFactoryBean implements DisposableBean { +public abstract class RegionFactoryBean extends RegionLookupFactoryBean implements DisposableBean { protected final Log log = LogFactory.getLog(getClass()); private boolean destroy = false; + private boolean close = true; + private Resource snapshot; private CacheListener cacheListeners[]; + private CacheLoader cacheLoader; + private CacheWriter cacheWriter; + private RegionAttributes attributes; + private Scope scope; - private DataPolicy dataPolicy; + + private boolean persistent; + + private String diskStoreName; + + private String dataPolicyName; + private Region region; + private List> subRegions; @Override public void afterPropertiesSet() throws Exception { @@ -73,7 +90,6 @@ public class RegionFactoryBean extends RegionLookupFactoryBean imple postProcess(region); } - @Override protected Region lookupFallback(GemFireCache cache, String regionName) throws Exception { Assert.isTrue(cache instanceof Cache, "Unable to create regions from " + cache); @@ -83,8 +99,8 @@ public class RegionFactoryBean extends RegionLookupFactoryBean imple if (attributes != null) AttributesFactory.validateAttributes(attributes); - final RegionFactory regionFactory = (attributes != null ? c.createRegionFactory(attributes) - : c. createRegionFactory()); + final RegionFactory regionFactory = (attributes != null ? c.createRegionFactory(attributes) : c + . createRegionFactory()); if (!ObjectUtils.isEmpty(cacheListeners)) { for (CacheListener listener : cacheListeners) { @@ -100,14 +116,20 @@ public class RegionFactoryBean extends RegionLookupFactoryBean imple regionFactory.setCacheWriter(cacheWriter); } - if (dataPolicy != null) { - regionFactory.setDataPolicy(dataPolicy); - } + resolveDataPolicy(regionFactory, persistent, dataPolicyName); if (scope != null) { regionFactory.setScope(scope); } + if (diskStoreName != null) { + regionFactory.setDiskStoreName(diskStoreName); + } + + if (attributes != null) { + Assert.state(!attributes.isLockGrantor() || scope.isGlobal(), + "Lock grantor only applies to a global scoped region"); + } // get underlying AttributesFactory postProcess(findAttrFactory(regionFactory)); @@ -117,9 +139,16 @@ public class RegionFactoryBean extends RegionLookupFactoryBean imple reg.loadSnapshot(snapshot.getInputStream()); } + if (attributes != null && attributes.isLockGrantor()) { + reg.becomeLockGrantor(); + } + return reg; } + protected abstract void resolveDataPolicy(RegionFactory regionFactory, boolean persistent, + String dataPolicyName); + @SuppressWarnings("unchecked") private AttributesFactory findAttrFactory(RegionFactory regionFactory) { Field attrField = ReflectionUtils.findField(RegionFactory.class, "attrsFactory", AttributesFactory.class); @@ -127,24 +156,24 @@ public class RegionFactoryBean extends RegionLookupFactoryBean imple return (AttributesFactory) ReflectionUtils.getField(attrField, regionFactory); } - /** - * Post-process the attribute factory object used for configuring the region of this factory bean during the initialization process. - * The object is already initialized and configured by the factory bean before this method + * Post-process the attribute factory object used for configuring the region + * of this factory bean during the initialization process. The object is + * already initialized and configured by the factory bean before this method * is invoked. * * @param attrFactory attribute factory - * @deprecated as of GemFire 6.5, the use of {@link AttributesFactory} has been deprecated + * @deprecated as of GemFire 6.5, the use of {@link AttributesFactory} has + * been deprecated */ @Deprecated protected void postProcess(AttributesFactory attrFactory) { } - /** - * Post-process the region object for this factory bean during the initialization process. - * The object is already initialized and configured by the factory bean before this method - * is invoked. + * Post-process the region object for this factory bean during the + * initialization process. The object is already initialized and configured + * by the factory bean before this method is invoked. * * @param region */ @@ -152,13 +181,15 @@ public class RegionFactoryBean extends RegionLookupFactoryBean imple // do nothing } + @Override public void destroy() throws Exception { if (region != null) { if (close) { if (!region.getCache().isClosed()) { try { region.close(); - } catch (CacheClosedException cce) { + } + catch (CacheClosedException cce) { // nothing to see folks, move on. } } @@ -171,9 +202,9 @@ public class RegionFactoryBean extends RegionLookupFactoryBean imple } /** - * Indicates whether the region referred by this factory bean, - * will be destroyed on shutdown (default false). - * Note: destroy and close are mutually exclusive. Enabling one will automatically disable the other. + * Indicates whether the region referred by this factory bean, will be + * destroyed on shutdown (default false). Note: destroy and close are + * mutually exclusive. Enabling one will automatically disable the other. * * @param destroy whether or not to destroy the region * @@ -188,9 +219,9 @@ public class RegionFactoryBean extends RegionLookupFactoryBean imple } /** - * Indicates whether the region referred by this factory bean, - * will be closed on shutdown (default true). - * Note: destroy and close are mutually exclusive. Enabling one will automatically disable the other. + * Indicates whether the region referred by this factory bean, will be + * closed on shutdown (default true). Note: destroy and close are mutually + * exclusive. Enabling one will automatically disable the other. * * @param close whether to close or not the region * @see #setDestroy(boolean) @@ -203,9 +234,9 @@ public class RegionFactoryBean extends RegionLookupFactoryBean imple } /** - * Sets the snapshots used for loading a newly created region. - * That is, the snapshot will be used only when a new region is created - if the region - * already exists, no loading will be performed. + * Sets the snapshots used for loading a newly created region. That + * is, the snapshot will be used only when a new region is created - + * if the region already exists, no loading will be performed. * * @see #setName(String) * @param snapshot the snapshot to set @@ -215,9 +246,9 @@ public class RegionFactoryBean extends RegionLookupFactoryBean imple } /** - * Sets the cache listeners used for the region used by this factory. - * Used only when a new region is created.Overrides the settings - * specified through {@link #setAttributes(RegionAttributes)}. + * Sets the cache listeners used for the region used by this factory. Used + * only when a new region is created.Overrides the settings specified + * through {@link #setAttributes(RegionAttributes)}. * * @param cacheListeners the cacheListeners to set on a newly created region */ @@ -225,10 +256,15 @@ public class RegionFactoryBean extends RegionLookupFactoryBean imple this.cacheListeners = cacheListeners; } + public void setSubRegions(List> subRegions) { + log.info("setting subRegions"); + this.subRegions = subRegions; + } + /** - * Sets the cache loader used for the region used by this factory. - * Used only when a new region is created.Overrides the settings - * specified through {@link #setAttributes(RegionAttributes)}. + * Sets the cache loader used for the region used by this factory. Used only + * when a new region is created.Overrides the settings specified through + * {@link #setAttributes(RegionAttributes)}. * * @param cacheLoader the cacheLoader to set on a newly created region */ @@ -237,9 +273,9 @@ public class RegionFactoryBean extends RegionLookupFactoryBean imple } /** - * Sets the cache writer used for the region used by this factory. - * Used only when a new region is created. Overrides the settings - * specified through {@link #setAttributes(RegionAttributes)}. + * Sets the cache writer used for the region used by this factory. Used only + * when a new region is created. Overrides the settings specified through + * {@link #setAttributes(RegionAttributes)}. * * @param cacheWriter the cacheWriter to set on a newly created region */ @@ -248,18 +284,8 @@ public class RegionFactoryBean extends RegionLookupFactoryBean imple } /** - * Sets the data policy. Used only when a new region is created. - * Overrides the settings specified through {@link #setAttributes(RegionAttributes)}. - * - * @param dataPolicy the region data policy - */ - public void setDataPolicy(DataPolicy dataPolicy) { - this.dataPolicy = dataPolicy; - } - - /** - * Sets the region scope. Used only when a new region is created. - * Overrides the settings specified through {@link #setAttributes(RegionAttributes)}. + * Sets the region scope. Used only when a new region is created. Overrides + * the settings specified through {@link #setAttributes(RegionAttributes)}. * * @see Scope * @param scope the region scope @@ -268,10 +294,31 @@ public class RegionFactoryBean extends RegionLookupFactoryBean imple this.scope = scope; } + public void setPersistent(boolean persistent) { + this.persistent = persistent; + } + + /** + * Sets the dataPolicy as a String. Required to support property + * placeholders + * @param dataPolicyName the dataPolicy name (NORMAL, PRELOADED, etc) + */ + public void setDataPolicyName(String dataPolicyName) { + this.dataPolicyName = dataPolicyName; + } + + /** + * Sets the name of disk store to use for overflow and persistence + * @param diskStoreName + */ + public void setDiskStoreName(String diskStoreName) { + this.diskStoreName = diskStoreName; + } + /** * Sets the region attributes used for the region used by this factory. - * Allows maximum control in specifying the region settings. - * Used only when a new region is created. + * Allows maximum control in specifying the region settings. Used only when + * a new region is created. * * @param attributes the attributes to set on a newly created region */ diff --git a/src/main/java/org/springframework/data/gemfire/RegionLookupFactoryBean.java b/src/main/java/org/springframework/data/gemfire/RegionLookupFactoryBean.java index 3333203c..86d0dc04 100644 --- a/src/main/java/org/springframework/data/gemfire/RegionLookupFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/RegionLookupFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2011 the original author or authors. + * Copyright 2010-2012 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. diff --git a/src/main/java/org/springframework/data/gemfire/ReplicatedRegionFactoryBean.java b/src/main/java/org/springframework/data/gemfire/ReplicatedRegionFactoryBean.java new file mode 100644 index 00000000..5d50c439 --- /dev/null +++ b/src/main/java/org/springframework/data/gemfire/ReplicatedRegionFactoryBean.java @@ -0,0 +1,47 @@ +/* + * Copyright 2010-2012 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; + +import org.springframework.util.Assert; + +import com.gemstone.gemfire.cache.DataPolicy; +import com.gemstone.gemfire.cache.RegionFactory; + +/** + * @author David Turanski + * + */ +public class ReplicatedRegionFactoryBean extends RegionFactoryBean { + @Override + protected void resolveDataPolicy(RegionFactory regionFactory, boolean persistent, String dataPolicyName) { + + DataPolicy dataPolicy = null; + if (dataPolicyName != null) { + if ("EMPTY".equals(dataPolicyName)) { + Assert.isTrue(!persistent, "Cannot have persistence on an empty region"); + dataPolicy = DataPolicy.EMPTY; + } + else { + throw new IllegalArgumentException("Data policy '" + dataPolicyName + + "' is unsupported or invalid for replicated regions."); + } + } + else { + dataPolicy = persistent ? DataPolicy.PERSISTENT_REPLICATE : DataPolicy.REPLICATE; + } + regionFactory.setDataPolicy(dataPolicy); + } +} diff --git a/src/main/java/org/springframework/data/gemfire/SubRegionFactoryBean.java b/src/main/java/org/springframework/data/gemfire/SubRegionFactoryBean.java new file mode 100644 index 00000000..dd033209 --- /dev/null +++ b/src/main/java/org/springframework/data/gemfire/SubRegionFactoryBean.java @@ -0,0 +1,117 @@ +/* + * Copyright 2010-2012 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; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.springframework.beans.factory.BeanInitializationException; +import org.springframework.beans.factory.FactoryBean; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.util.Assert; + +import com.gemstone.gemfire.cache.AttributesFactory; +import com.gemstone.gemfire.cache.Region; + +@SuppressWarnings("deprecation") +/** + * FactoryBean for creating a Gemfire Region as a subregion + * @author David Turanski + * + * @param - Region Key Type + * @param - Region Value Type + */ +public class SubRegionFactoryBean extends AttributesFactory implements FactoryBean>, + InitializingBean { + + protected final Log log = LogFactory.getLog(getClass()); + + @SuppressWarnings("unused") + private String name; + + private String regionName; + + private Region subRegion; + + private Region parent; + + private boolean lookupOnly; + + @Override + public void afterPropertiesSet() throws Exception { + Assert.notNull(parent, "parent region must not be null"); + + this.subRegion = parent.getSubregion(regionName); + if (this.subRegion == null) { + if (lookupOnly) { + throw new BeanInitializationException("Cannot find region [" + regionName + "] in cache " + + parent.getRegionService()); + } + else { + log.debug("creating subregion of [" + parent.getFullPath() + "] with name " + regionName); + this.subRegion = this.parent.createSubregion(regionName, create()); + } + } + } + + @Override + public Region getObject() throws Exception { + return this.subRegion; + } + + @Override + public Class getObjectType() { + return Region.class; + } + + @Override + public boolean isSingleton() { + return true; + } + + /** + * Set the bean name - the same as the subregion full path + * @param name + */ + public void setName(String name) { + this.name = name; + } + + /** + * Set the simple name of the region + * @param regionName + */ + public void setRegionName(String regionName) { + this.regionName = regionName; + } + + /** + * Set the parent Region + * @param parent + */ + public void setParent(Region parent) { + this.parent = parent; + } + + /** + * Set to true if the subregion should already exist, e.g., specified by + * <lookup-region> + * @param lookupOnly + */ + public void setLookupOnly(boolean lookupOnly) { + this.lookupOnly = lookupOnly; + } + +} diff --git a/src/main/java/org/springframework/data/gemfire/WiringDeclarableSupport.java b/src/main/java/org/springframework/data/gemfire/WiringDeclarableSupport.java index fe64c4f4..f44233d6 100644 --- a/src/main/java/org/springframework/data/gemfire/WiringDeclarableSupport.java +++ b/src/main/java/org/springframework/data/gemfire/WiringDeclarableSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2011 the original author or authors. + * Copyright 2010-2012 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. diff --git a/src/main/java/org/springframework/data/gemfire/client/ClientCacheFactoryBean.java b/src/main/java/org/springframework/data/gemfire/client/ClientCacheFactoryBean.java index 6b0a180c..e9d5441d 100644 --- a/src/main/java/org/springframework/data/gemfire/client/ClientCacheFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/client/ClientCacheFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 the original author or authors. + * Copyright 2011-2012 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. diff --git a/src/main/java/org/springframework/data/gemfire/client/ClientRegionFactoryBean.java b/src/main/java/org/springframework/data/gemfire/client/ClientRegionFactoryBean.java index 705d7b84..5271cac8 100644 --- a/src/main/java/org/springframework/data/gemfire/client/ClientRegionFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/client/ClientRegionFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2011 the original author or authors. + * Copyright 2010-2012 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. @@ -44,6 +44,7 @@ import com.gemstone.gemfire.internal.cache.GemFireCacheImpl; * Client extension for GemFire regions. * * @author Costin Leau + * @author David Turanski */ public class ClientRegionFactoryBean extends RegionLookupFactoryBean implements BeanFactoryAware, DisposableBean { @@ -51,19 +52,28 @@ public class ClientRegionFactoryBean extends RegionLookupFactoryBean private static final Log log = LogFactory.getLog(ClientRegionFactoryBean.class); private boolean destroy = false; + private boolean close = true; + private Resource snapshot; private CacheListener cacheListeners[]; + private Interest[] interests; + private String poolName; + private BeanFactory beanFactory; + private ClientRegionShortcut shortcut = null; + private DataPolicy dataPolicy; private RegionAttributes attributes; + private Region region; + private String diskStoreName; @Override public void afterPropertiesSet() throws Exception { @@ -76,12 +86,11 @@ public class ClientRegionFactoryBean extends RegionLookupFactoryBean protected Region lookupFallback(GemFireCache cache, String regionName) throws Exception { Assert.isTrue(cache instanceof ClientCache, "Unable to create regions from " + cache); ClientCache c = (ClientCache) cache; - + if (cache instanceof GemFireCacheImpl) { Assert.isTrue(((GemFireCacheImpl) cache).isClient(), "A client-cache instance is required"); } - // first look at shortcut ClientRegionShortcut s = null; @@ -103,7 +112,8 @@ public class ClientRegionFactoryBean extends RegionLookupFactoryBean else { s = ClientRegionShortcut.LOCAL; } - } else { + } + else { s = shortcut; } @@ -154,6 +164,10 @@ public class ClientRegionFactoryBean extends RegionLookupFactoryBean factory.setPoolName(poolName); } + if (diskStoreName != null) { + factory.setDiskStoreName(diskStoreName); + } + Region reg = factory.create(regionName); log.info("Created new cache region [" + regionName + "]"); if (snapshot != null) { @@ -179,6 +193,7 @@ public class ClientRegionFactoryBean extends RegionLookupFactoryBean } } + @Override public void destroy() throws Exception { Region region = getObject(); // unregister interests @@ -193,8 +208,10 @@ public class ClientRegionFactoryBean extends RegionLookupFactoryBean } } } - // should not really happen since interests are validated at start/registration - } catch (UnsupportedOperationException ex) { + // should not really happen since interests are validated at + // start/registration + } + catch (UnsupportedOperationException ex) { log.warn("Cannot unregister cache interests", ex); } @@ -203,7 +220,8 @@ public class ClientRegionFactoryBean extends RegionLookupFactoryBean if (!region.getCache().isClosed()) { try { region.close(); - } catch (CacheClosedException cce) { + } + catch (CacheClosedException cce) { // nothing to see folks, move on. } } @@ -215,13 +233,14 @@ public class ClientRegionFactoryBean extends RegionLookupFactoryBean region = null; } + @Override public void setBeanFactory(BeanFactory beanFactory) throws BeansException { this.beanFactory = beanFactory; } - /** - * Set the interests for this client region. Both key and regex interest are supported. + * Set the interests for this client region. Both key and regex interest are + * supported. * * @param interests the interests to set */ @@ -257,9 +276,9 @@ public class ClientRegionFactoryBean extends RegionLookupFactoryBean } /** - * Initializes the client using a GemFire {@link ClientRegionShortcut}. - * The recommended way for creating clients since it covers all the major scenarios with minimal - * configuration. + * Initializes the client using a GemFire {@link ClientRegionShortcut}. The + * recommended way for creating clients since it covers all the major + * scenarios with minimal configuration. * * @param shortcut */ @@ -268,9 +287,9 @@ public class ClientRegionFactoryBean extends RegionLookupFactoryBean } /** - * Indicates whether the region referred by this factory bean, - * will be destroyed on shutdown (default false). - * Note: destroy and close are mutually exclusive. Enabling one will automatically disable the other. + * Indicates whether the region referred by this factory bean, will be + * destroyed on shutdown (default false). Note: destroy and close are + * mutually exclusive. Enabling one will automatically disable the other. * * @param destroy whether or not to destroy the region * @@ -285,9 +304,9 @@ public class ClientRegionFactoryBean extends RegionLookupFactoryBean } /** - * Indicates whether the region referred by this factory bean, - * will be closed on shutdown (default true). - * Note: destroy and close are mutually exclusive. Enabling one will automatically disable the other. + * Indicates whether the region referred by this factory bean, will be + * closed on shutdown (default true). Note: destroy and close are mutually + * exclusive. Enabling one will automatically disable the other. * * @param close whether to close or not the region * @see #setDestroy(boolean) @@ -300,9 +319,9 @@ public class ClientRegionFactoryBean extends RegionLookupFactoryBean } /** - * Sets the snapshots used for loading a newly created region. - * That is, the snapshot will be used only when a new region is created - if the region - * already exists, no loading will be performed. + * Sets the snapshots used for loading a newly created region. That + * is, the snapshot will be used only when a new region is created - + * if the region already exists, no loading will be performed. * * @see #setName(String) * @param snapshot the snapshot to set @@ -312,9 +331,9 @@ public class ClientRegionFactoryBean extends RegionLookupFactoryBean } /** - * Sets the cache listeners used for the region used by this factory. - * Used only when a new region is created.Overrides the settings - * specified through {@link #setAttributes(RegionAttributes)}. + * Sets the cache listeners used for the region used by this factory. Used + * only when a new region is created.Overrides the settings specified + * through {@link #setAttributes(RegionAttributes)}. * * @param cacheListeners the cacheListeners to set on a newly created region */ @@ -331,12 +350,21 @@ public class ClientRegionFactoryBean extends RegionLookupFactoryBean this.dataPolicy = dataPolicy; } + /** + * Sets the name of disk store to use for overflow and persistence + * @param diskStoreName + */ + public void setDiskStoreName(String diskStoreName) { + this.diskStoreName = diskStoreName; + } + /** * Sets the region attributes used for the region used by this factory. - * Allows maximum control in specifying the region settings. - * Used only when a new region is created. - * Note that using this method allows for advanced customization of the region - while it provides a lot of flexibility, - * note that it's quite easy to create misconfigured regions (especially in a client/server scenario). + * Allows maximum control in specifying the region settings. Used only when + * a new region is created. Note that using this method allows for advanced + * customization of the region - while it provides a lot of flexibility, + * note that it's quite easy to create misconfigured regions (especially in + * a client/server scenario). * * @param attributes the attributes to set on a newly created region */ diff --git a/src/main/java/org/springframework/data/gemfire/client/Interest.java b/src/main/java/org/springframework/data/gemfire/client/Interest.java index 0bce0a0f..1fb1a425 100644 --- a/src/main/java/org/springframework/data/gemfire/client/Interest.java +++ b/src/main/java/org/springframework/data/gemfire/client/Interest.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2011 the original author or authors. + * Copyright 2010-2012 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. diff --git a/src/main/java/org/springframework/data/gemfire/client/PoolConnection.java b/src/main/java/org/springframework/data/gemfire/client/PoolConnection.java index 7a72e0fe..15c6e971 100644 --- a/src/main/java/org/springframework/data/gemfire/client/PoolConnection.java +++ b/src/main/java/org/springframework/data/gemfire/client/PoolConnection.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2011 the original author or authors. + * Copyright 2010-2012 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. diff --git a/src/main/java/org/springframework/data/gemfire/client/PoolFactoryBean.java b/src/main/java/org/springframework/data/gemfire/client/PoolFactoryBean.java index 74c95361..4b296192 100644 --- a/src/main/java/org/springframework/data/gemfire/client/PoolFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/client/PoolFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2011 the original author or authors. + * Copyright 2010-2012 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. diff --git a/src/main/java/org/springframework/data/gemfire/client/RegexInterest.java b/src/main/java/org/springframework/data/gemfire/client/RegexInterest.java index ea14184f..d80afbc6 100644 --- a/src/main/java/org/springframework/data/gemfire/client/RegexInterest.java +++ b/src/main/java/org/springframework/data/gemfire/client/RegexInterest.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2011 the original author or authors. + * Copyright 2010-2012 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. diff --git a/src/main/java/org/springframework/data/gemfire/config/AbstractRegionParser.java b/src/main/java/org/springframework/data/gemfire/config/AbstractRegionParser.java new file mode 100644 index 00000000..601465fb --- /dev/null +++ b/src/main/java/org/springframework/data/gemfire/config/AbstractRegionParser.java @@ -0,0 +1,166 @@ +/* + * Copyright 2012 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 java.util.List; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.springframework.beans.factory.config.BeanDefinition; +import org.springframework.beans.factory.config.BeanDefinitionHolder; +import org.springframework.beans.factory.support.BeanDefinitionBuilder; +import org.springframework.beans.factory.xml.ParserContext; +import org.springframework.util.StringUtils; +import org.springframework.util.xml.DomUtils; +import org.w3c.dom.Element; + +/** + * Base class for all Region Parsers + * + * @author David Turanski + */ +abstract class AbstractRegionParser extends AliasReplacingBeanDefinitionParser { + protected final Log log = LogFactory.getLog(getClass()); + + @Override + protected void doParseInternal(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { + super.doParse(element, builder); + boolean subRegion = isSubRegion(element); + + doParseRegion(element, parserContext, builder, subRegion); + + if (subRegion) { + builder.addPropertyValue("parent", parserContext.getContainingBeanDefinition().getAttribute("parent")); + builder.addPropertyValue("regionName", element.getAttribute(NAME_ATTRIBUTE)); + } + } + + protected abstract void doParseRegion(Element element, ParserContext parserContext, BeanDefinitionBuilder builder, + boolean subRegion); + + protected void doParseSubRegion(Element element, Element subElement, ParserContext parserContext, + BeanDefinitionBuilder builder, boolean subRegion) { + + String regionPath = null; + String parentBeanName = null; + if (subRegion) { + parentBeanName = parserContext.getContainingBeanDefinition().getAttribute("regionPath").toString(); + } + else { + parentBeanName = getRegionNameFromElement(element); + } + regionPath = StringUtils.arrayToDelimitedString(new String[] { parentBeanName, + getRegionNameFromElement(subElement) }, "/"); + if (!regionPath.startsWith("/")) { + regionPath = "/" + regionPath; + } + /* + * The Region parser needs some context to handle recursion correctly + */ + builder.getBeanDefinition().setAttribute("parent", + new BeanDefinitionHolder(builder.getBeanDefinition(), parentBeanName)); + builder.getBeanDefinition().setAttribute("regionPath", regionPath); + + // Make recursive call + BeanDefinition subRegionDef = this.parseSubRegion(subElement, parserContext, builder); + // TODO: Is there a better work-around? + /* + * This setting prevents the BF from generating a name for this been + */ + subRegionDef.setScope(BeanDefinition.SCOPE_PROTOTYPE); + + if (log.isDebugEnabled()) { + log.debug("registering subregion as " + regionPath); + } + this.registerBeanDefinition(new BeanDefinitionHolder(subRegionDef, regionPath), parserContext.getRegistry()); + } + + protected void doParseCommonRegionConfiguration(Element element, ParserContext parserContext, + BeanDefinitionBuilder builder, BeanDefinitionBuilder attrBuilder, boolean subRegion) { + + if (!subRegion) { + String cacheRef = element.getAttribute("cache-ref"); + // add cache reference (fallback to default if nothing is specified) + builder.addPropertyReference("cache", (StringUtils.hasText(cacheRef) ? cacheRef : "gemfire-cache")); + } + // add attributes + ParsingUtils.setPropertyValue(element, builder, "name"); + ParsingUtils.parseOptionalRegionAttributes(parserContext, element, attrBuilder); + ParsingUtils.parseStatistics(element, attrBuilder); + ParsingUtils.setPropertyValue(element, attrBuilder, "publisher"); + if (!isSubRegion(element)) { + ParsingUtils.setPropertyValue(element, builder, "persistent"); + } + // set the data policy + ParsingUtils.setPropertyValue(element, builder, "data-policy", "dataPolicyName"); + + if (StringUtils.hasText(element.getAttribute("disk-store-ref"))) { + ParsingUtils.setPropertyValue(element, builder, "disk-store-ref", "diskStoreName"); + builder.addDependsOn(element.getAttribute("disk-store-ref")); + } + + ParsingUtils.parseExpiration(parserContext, element, attrBuilder); + ParsingUtils.parseEviction(parserContext, element, attrBuilder); + ParsingUtils.parseMembershipAttributes(parserContext, element, attrBuilder); + + List subElements = DomUtils.getChildElements(element); + + // parse nested elements + for (Element subElement : subElements) { + String name = subElement.getLocalName(); + + if ("cache-listener".equals(name)) { + builder.addPropertyValue("cacheListeners", parseCacheListener(parserContext, subElement, builder)); + } + + else if ("cache-loader".equals(name)) { + builder.addPropertyValue("cacheLoader", parseCacheLoader(parserContext, subElement, builder)); + } + + else if ("cache-writer".equals(name)) { + builder.addPropertyValue("cacheWriter", parseCacheWriter(parserContext, subElement, builder)); + } + // subregion + else if (name.endsWith("region")) { + doParseSubRegion(element, subElement, parserContext, builder, subRegion); + } + } + } + + private BeanDefinition parseSubRegion(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { + BeanDefinition beanDefinition = parserContext.getDelegate().parseCustomElement(element, + builder.getBeanDefinition()); + return beanDefinition; + } + + private String getRegionNameFromElement(Element element) { + String name = element.getAttribute(NAME_ATTRIBUTE); + return StringUtils.hasText(name) ? name : element.getAttribute(ID_ATTRIBUTE); + } + + private Object parseCacheListener(ParserContext parserContext, Element subElement, BeanDefinitionBuilder builder) { + return ParsingUtils.parseRefOrNestedBeanDeclaration(parserContext, subElement, builder); + } + + private Object parseCacheLoader(ParserContext parserContext, Element subElement, BeanDefinitionBuilder builder) { + return ParsingUtils.parseRefOrNestedBeanDeclaration(parserContext, subElement, builder); + } + + private Object parseCacheWriter(ParserContext parserContext, Element subElement, BeanDefinitionBuilder builder) { + return ParsingUtils.parseRefOrNestedBeanDeclaration(parserContext, subElement, builder); + } +} \ No newline at end of file diff --git a/src/main/java/org/springframework/data/gemfire/config/AliasReplacingBeanDefinitionParser.java b/src/main/java/org/springframework/data/gemfire/config/AliasReplacingBeanDefinitionParser.java index 1184a87c..c06b9f19 100644 --- a/src/main/java/org/springframework/data/gemfire/config/AliasReplacingBeanDefinitionParser.java +++ b/src/main/java/org/springframework/data/gemfire/config/AliasReplacingBeanDefinitionParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 the original author or authors. + * Copyright 2012 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. @@ -21,19 +21,36 @@ import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.beans.factory.support.BeanDefinitionRegistry; import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser; import org.springframework.beans.factory.xml.ParserContext; +import org.springframework.data.gemfire.SubRegionFactoryBean; import org.w3c.dom.Element; /** - * Extension class dealing with the attribute clash (name) that triggers the region name to - * be considered a bean alias. Overrides the automatic alias detection and replaces it with its own - * using meta attributes (since the parsing method is final). + * Extension class dealing with the attribute clash (name) that triggers the + * region name to be considered a bean alias. Overrides the automatic alias + * detection and replaces it with its own using meta attributes (since the + * parsing method is final). * * @author Costin Leau + * @author David Turanski */ abstract class AliasReplacingBeanDefinitionParser extends AbstractSingleBeanDefinitionParser { + @Override + protected Class getBeanClass(Element element) { + + if (isSubRegion(element)) { + return SubRegionFactoryBean.class; + } + else { + return getRegionFactoryClass(); + } + } + + protected abstract Class getRegionFactoryClass(); + @Override protected final void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { + ParsingUtils.addBeanAliasAsMetadata(element, builder); doParseInternal(element, parserContext, builder); @@ -41,9 +58,13 @@ abstract class AliasReplacingBeanDefinitionParser extends AbstractSingleBeanDefi @Override protected void registerBeanDefinition(BeanDefinitionHolder definition, BeanDefinitionRegistry registry) { - // add the aliases from the metadata + // add the aliases from the metadata super.registerBeanDefinition(ParsingUtils.replaceBeanAliasAsMetadata(definition), registry); } + protected boolean isSubRegion(Element element) { + return element.getParentNode().getLocalName().endsWith("region"); + } + protected abstract void doParseInternal(Element element, ParserContext parserContext, BeanDefinitionBuilder builder); } \ No newline at end of file diff --git a/src/main/java/org/springframework/data/gemfire/config/CacheParser.java b/src/main/java/org/springframework/data/gemfire/config/CacheParser.java index 357306c7..d8cd9755 100644 --- a/src/main/java/org/springframework/data/gemfire/config/CacheParser.java +++ b/src/main/java/org/springframework/data/gemfire/config/CacheParser.java @@ -16,22 +16,33 @@ package org.springframework.data.gemfire.config; +import java.util.List; + import org.springframework.beans.factory.BeanDefinitionStoreException; import org.springframework.beans.factory.support.AbstractBeanDefinition; import org.springframework.beans.factory.support.BeanDefinitionBuilder; -import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser; +import org.springframework.beans.factory.support.ManagedList; +import org.springframework.beans.factory.support.ManagedMap; +import org.springframework.beans.factory.xml.AbstractSimpleBeanDefinitionParser; import org.springframework.beans.factory.xml.ParserContext; import org.springframework.data.gemfire.CacheFactoryBean; +import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; +import org.springframework.util.xml.DomUtils; +import org.w3c.dom.Attr; import org.w3c.dom.Element; +import org.w3c.dom.NamedNodeMap; + +import com.gemstone.gemfire.internal.datasource.ConfigProperty; /** * Parser for <cache;gt; definitions. * * @author Costin Leau * @author Oliver Gierke + * @author David Turanski */ -class CacheParser extends AbstractSingleBeanDefinitionParser { +class CacheParser extends AbstractSimpleBeanDefinitionParser { @Override protected Class getBeanClass(Element element) { @@ -39,17 +50,115 @@ class CacheParser extends AbstractSingleBeanDefinitionParser { } @Override - protected void doParse(Element element, BeanDefinitionBuilder builder) { + protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { super.doParse(element, builder); ParsingUtils.setPropertyValue(element, builder, "cache-xml-location", "cacheXml"); ParsingUtils.setPropertyReference(element, builder, "properties-ref", "properties"); ParsingUtils.setPropertyReference(element, builder, "pdx-serializer", "pdxSerializer"); ParsingUtils.setPropertyValue(element, builder, "pdx-disk-store", "pdxDiskStoreName"); - ParsingUtils.setPropertyValue(element, builder, "pdx-persistent", "pdxPersistent"); - ParsingUtils.setPropertyValue(element, builder, "pdx-read-serialized", "pdxReadSerialized"); - ParsingUtils.setPropertyValue(element, builder, "pdx-ignore-unread-fields", "pdxIgnoreUnreadFields"); - ParsingUtils.setPropertyValue(element, builder, "use-bean-factory-locator", "useBeanFactoryLocator"); + ParsingUtils.setPropertyValue(element, builder, "pdx-persistent"); + ParsingUtils.setPropertyValue(element, builder, "pdx-read-serialized"); + ParsingUtils.setPropertyValue(element, builder, "pdx-ignore-unread-fields"); + ParsingUtils.setPropertyValue(element, builder, "use-bean-factory-locator"); + ParsingUtils.setPropertyValue(element, builder, "copy-on-read"); + ParsingUtils.setPropertyValue(element, builder, "lock-timeout"); + ParsingUtils.setPropertyValue(element, builder, "lock-lease"); + ParsingUtils.setPropertyValue(element, builder, "message-sync-interval"); + ParsingUtils.setPropertyValue(element, builder, "search-timeout"); + ParsingUtils.setPropertyValue(element, builder, "critical-heap-percentage"); + ParsingUtils.setPropertyValue(element, builder, "eviction-heap-percentage"); + + List txListeners = DomUtils.getChildElementsByTagName(element, "transaction-listener"); + if (!CollectionUtils.isEmpty(txListeners)) { + ManagedList transactionListeners = new ManagedList(); + for (Element txListener : txListeners) { + transactionListeners.add(ParsingUtils.parseRefOrNestedBeanDeclaration(parserContext, txListener, + builder)); + } + builder.addPropertyValue("transactionListeners", transactionListeners); + } + Element txWriter = DomUtils.getChildElementByTagName(element, "transaction-writer"); + if (txWriter != null) { + builder.addPropertyValue("transactionWriter", + ParsingUtils.parseRefOrNestedBeanDeclaration(parserContext, txWriter, builder)); + } + + parseDynamicRegionFactory(element, builder); + parseJndiBindings(element, builder); + } + + private void parseDynamicRegionFactory(Element element, BeanDefinitionBuilder builder) { + Element dynamicRegionFactory = DomUtils.getChildElementByTagName(element, "dynamic-region-factory"); + if (dynamicRegionFactory != null) { + BeanDefinitionBuilder dynamicRegionSupport = buildDynamicRegionSupport(dynamicRegionFactory); + postProcessDynamicRegionSupport(element, dynamicRegionSupport); + builder.addPropertyValue("dynamicRegionSupport", dynamicRegionSupport.getBeanDefinition()); + } + } + + /** + * @param dynamicRegionSupport BDB for <dynamic-region-factory> + * element + */ + protected void postProcessDynamicRegionSupport(Element element, BeanDefinitionBuilder dynamicRegionSupport) { + + } + + private BeanDefinitionBuilder buildDynamicRegionSupport(Element dynamicRegionFactory) { + BeanDefinitionBuilder result = null; + if (dynamicRegionFactory != null) { + BeanDefinitionBuilder dynamicRegionSupport = BeanDefinitionBuilder + .genericBeanDefinition(CacheFactoryBean.DynamicRegionSupport.class); + String diskDir = dynamicRegionFactory.getAttribute("disk-dir"); + if (StringUtils.hasText(diskDir)) { + dynamicRegionSupport.addPropertyValue("diskDir", diskDir); + } + String persistent = dynamicRegionFactory.getAttribute("persistent"); + if (StringUtils.hasText(persistent)) { + dynamicRegionSupport.addPropertyValue("persistent", persistent); + } + + String registerInterest = dynamicRegionFactory.getAttribute("register-interest"); + if (StringUtils.hasText(registerInterest)) { + dynamicRegionSupport.addPropertyValue("registerInterest", registerInterest); + } + result = dynamicRegionSupport; + } + return result; + } + + private void parseJndiBindings(Element element, BeanDefinitionBuilder builder) { + List jndiBindings = DomUtils.getChildElementsByTagName(element, "jndi-binding"); + if (!CollectionUtils.isEmpty(jndiBindings)) { + ManagedList jndiDataSources = new ManagedList(); + ManagedMap jndiAttributes = new ManagedMap(); + for (Element jndiBinding : jndiBindings) { + BeanDefinitionBuilder jndiDataSource = BeanDefinitionBuilder + .genericBeanDefinition(CacheFactoryBean.JndiDataSource.class); + NamedNodeMap nnm = jndiBinding.getAttributes(); + for (int i = 0; i < nnm.getLength(); i++) { + Attr attr = (Attr) nnm.item(i); + jndiAttributes.put(attr.getLocalName(), attr.getValue()); + } + jndiDataSource.addPropertyValue("attributes", jndiAttributes); + + List jndiProps = DomUtils.getChildElementsByTagName(element, "jndi-prop"); + if (!CollectionUtils.isEmpty(jndiProps)) { + ManagedList props = new ManagedList(); + for (Element jndiProp : jndiProps) { + String key = jndiProp.getAttribute("key"); + String value = jndiProp.getNodeValue(); + String type = StringUtils.hasText(jndiProp.getAttribute("type")) ? jndiProp + .getAttribute("type") : String.class.getName(); + props.add(new ConfigProperty(key, value, type)); + } + jndiDataSource.addPropertyValue("props", props); + } + jndiDataSources.add(jndiDataSource.getBeanDefinition()); + } + builder.addPropertyValue("jndiDataSources", jndiDataSources); + } } @Override @@ -61,4 +170,5 @@ class CacheParser extends AbstractSingleBeanDefinitionParser { } return name; } + } \ No newline at end of file diff --git a/src/main/java/org/springframework/data/gemfire/config/CacheServerParser.java b/src/main/java/org/springframework/data/gemfire/config/CacheServerParser.java index b2bcafdc..2f1231b3 100644 --- a/src/main/java/org/springframework/data/gemfire/config/CacheServerParser.java +++ b/src/main/java/org/springframework/data/gemfire/config/CacheServerParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 the original author or authors. + * Copyright 2011-2012 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. diff --git a/src/main/java/org/springframework/data/gemfire/config/ClientCacheParser.java b/src/main/java/org/springframework/data/gemfire/config/ClientCacheParser.java index 01683e71..c38ec67c 100644 --- a/src/main/java/org/springframework/data/gemfire/config/ClientCacheParser.java +++ b/src/main/java/org/springframework/data/gemfire/config/ClientCacheParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2011 the original author or authors. + * Copyright 2010-2012 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. @@ -17,13 +17,16 @@ package org.springframework.data.gemfire.config; import org.springframework.beans.factory.support.BeanDefinitionBuilder; +import org.springframework.beans.factory.xml.ParserContext; import org.springframework.data.gemfire.client.ClientCacheFactoryBean; +import org.springframework.util.StringUtils; import org.w3c.dom.Element; /** * Parser for <client-cache;gt; definitions. * * @author Costin Leau + * @author David Turanski */ class ClientCacheParser extends CacheParser { @@ -33,9 +36,17 @@ class ClientCacheParser extends CacheParser { } @Override - protected void doParse(Element element, BeanDefinitionBuilder builder) { - super.doParse(element, builder); + protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { + super.doParse(element, parserContext, builder); ParsingUtils.setPropertyValue(element, builder, "pool-name", "poolName"); } + + @Override + protected void postProcessDynamicRegionSupport(Element element, BeanDefinitionBuilder dynamicRegionSupport) { + String poolName = element.getAttribute("pool-name"); + if (StringUtils.hasText(poolName)) { + dynamicRegionSupport.addPropertyValue("poolName", poolName); + } + } } \ No newline at end of file diff --git a/src/main/java/org/springframework/data/gemfire/config/ClientRegionParser.java b/src/main/java/org/springframework/data/gemfire/config/ClientRegionParser.java index 65270ac7..769a9d7e 100644 --- a/src/main/java/org/springframework/data/gemfire/config/ClientRegionParser.java +++ b/src/main/java/org/springframework/data/gemfire/config/ClientRegionParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2011 the original author or authors. + * Copyright 2010-2012 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. @@ -34,13 +34,15 @@ import com.gemstone.gemfire.cache.DataPolicy; /** * Parser for <client-region;gt; definitions. * - * To avoid eager evaluations, the region interests are declared as nested definition. + * To avoid eager evaluations, the region interests are declared as nested + * definition. * * @author Costin Leau + * @author David Turanski */ class ClientRegionParser extends AliasReplacingBeanDefinitionParser { - - protected Class getBeanClass(Element element) { + @Override + protected Class getRegionFactoryClass() { return ClientRegionFactoryBean.class; } @@ -58,7 +60,6 @@ class ClientRegionParser extends AliasReplacingBeanDefinitionParser { ParsingUtils.setPropertyValue(element, builder, "pool-name", "poolName"); ParsingUtils.setPropertyValue(element, builder, "shortcut", "shortcut"); - // set the persistent policy String attr = element.getAttribute("persistent"); @@ -76,14 +77,19 @@ class ClientRegionParser extends AliasReplacingBeanDefinitionParser { // eviction + overflow attributes // client attributes - BeanDefinitionBuilder attrBuilder = BeanDefinitionBuilder.genericBeanDefinition(RegionAttributesFactoryBean.class); + BeanDefinitionBuilder attrBuilder = BeanDefinitionBuilder + .genericBeanDefinition(RegionAttributesFactoryBean.class); ParsingUtils.parseStatistics(element, attrBuilder); + if (StringUtils.hasText(element.getAttribute("disk-store-ref"))) { + ParsingUtils.setPropertyValue(element, builder, "disk-store-ref", "diskStoreName"); + builder.addDependsOn(element.getAttribute("disk-store-ref")); + } + boolean overwriteDataPolicy = false; overwriteDataPolicy |= ParsingUtils.parseEviction(parserContext, element, attrBuilder); - overwriteDataPolicy |= ParsingUtils.parseDiskStorage(element, attrBuilder); if (!frozenDataPolicy && overwriteDataPolicy) { builder.addPropertyValue("dataPolicy", DataPolicy.NORMAL); diff --git a/src/main/java/org/springframework/data/gemfire/config/DiskStoreParser.java b/src/main/java/org/springframework/data/gemfire/config/DiskStoreParser.java new file mode 100644 index 00000000..9feaf707 --- /dev/null +++ b/src/main/java/org/springframework/data/gemfire/config/DiskStoreParser.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010-2012 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 java.util.List; + +import org.springframework.beans.factory.support.AbstractBeanDefinition; +import org.springframework.beans.factory.support.BeanDefinitionBuilder; +import org.springframework.beans.factory.support.ManagedList; +import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser; +import org.springframework.beans.factory.xml.ParserContext; +import org.springframework.data.gemfire.DiskStoreFactoryBean; +import org.springframework.data.gemfire.DiskStoreFactoryBean.DiskDir; +import org.springframework.util.CollectionUtils; +import org.springframework.util.xml.DomUtils; +import org.w3c.dom.Element; + +/** + * Parser for the <disk-store> definitions. + * @author David Turanski + * + */ +public class DiskStoreParser extends AbstractSingleBeanDefinitionParser { + @Override + protected Class getBeanClass(Element element) { + return DiskStoreFactoryBean.class; + } + + @Override + protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { + super.doParse(element, parserContext, builder); + ParsingUtils.setPropertyReference(element, builder, "cache-ref", "cache"); + ParsingUtils.setPropertyValue(element, builder, "auto-compact"); + ParsingUtils.setPropertyValue(element, builder, "allow-force-compaction"); + ParsingUtils.setPropertyValue(element, builder, "max-oplog-size"); + ParsingUtils.setPropertyValue(element, builder, "time-interval"); + ParsingUtils.setPropertyValue(element, builder, "queue-size"); + ParsingUtils.setPropertyValue(element, builder, "compaction-threshold"); + ParsingUtils.setPropertyValue(element, builder, "write-buffer-size"); + + List diskDirElements = DomUtils.getChildElementsByTagName(element, "disk-dir"); + + if (!CollectionUtils.isEmpty(diskDirElements)) { + ManagedList diskDirs = new ManagedList(); + for (Element diskDirElement : diskDirElements) { + BeanDefinitionBuilder diskDirBuilder = BeanDefinitionBuilder.genericBeanDefinition(DiskDir.class); + diskDirBuilder.addConstructorArgValue(diskDirElement.getAttribute("location")); + if (diskDirElement.hasAttribute("max-size")) { + diskDirBuilder.addConstructorArgValue(diskDirElement.getAttribute("max-size")); + } + diskDirs.add(diskDirBuilder.getBeanDefinition()); + } + builder.addPropertyValue("diskDirs", diskDirs); + } + } +} diff --git a/src/main/java/org/springframework/data/gemfire/config/DiskWriteAttributesFactoryBean.java b/src/main/java/org/springframework/data/gemfire/config/DiskWriteAttributesFactoryBean.java index 32ada080..95b8c823 100644 --- a/src/main/java/org/springframework/data/gemfire/config/DiskWriteAttributesFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/config/DiskWriteAttributesFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2011 the original author or authors. + * Copyright 2010-2012 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. @@ -23,27 +23,35 @@ import com.gemstone.gemfire.cache.DiskWriteAttributes; import com.gemstone.gemfire.cache.DiskWriteAttributesFactory; /** - * Simple utility class used for defining nested factory-method like definitions w/o polluting the container with useless beans. + * Simple utility class used for defining nested factory-method like definitions + * w/o polluting the container with useless beans. * * @author Costin Leau + * @deprecated */ +@Deprecated class DiskWriteAttributesFactoryBean implements FactoryBean, InitializingBean { private DiskWriteAttributes attributes; + private DiskWriteAttributesFactory attrFactory; + @Override public void afterPropertiesSet() { attributes = attrFactory.create(); } + @Override public DiskWriteAttributes getObject() throws Exception { return attributes; } + @Override public Class getObjectType() { return (attributes != null ? attributes.getClass() : DiskWriteAttributes.class); } + @Override public boolean isSingleton() { return true; } diff --git a/src/main/java/org/springframework/data/gemfire/config/EvictionAttributesFactoryBean.java b/src/main/java/org/springframework/data/gemfire/config/EvictionAttributesFactoryBean.java index 415343dc..2469863b 100644 --- a/src/main/java/org/springframework/data/gemfire/config/EvictionAttributesFactoryBean.java +++ b/src/main/java/org/springframework/data/gemfire/config/EvictionAttributesFactoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2011 the original author or authors. + * Copyright 2010-2012 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. diff --git a/src/main/java/org/springframework/data/gemfire/config/EvictionType.java b/src/main/java/org/springframework/data/gemfire/config/EvictionType.java index 880bbf98..79d17efd 100644 --- a/src/main/java/org/springframework/data/gemfire/config/EvictionType.java +++ b/src/main/java/org/springframework/data/gemfire/config/EvictionType.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2011 the original author or authors. + * Copyright 2010-2012 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. diff --git a/src/main/java/org/springframework/data/gemfire/config/GemfireListenerContainerParser.java b/src/main/java/org/springframework/data/gemfire/config/GemfireListenerContainerParser.java index 1b58c77f..0139eeaf 100644 --- a/src/main/java/org/springframework/data/gemfire/config/GemfireListenerContainerParser.java +++ b/src/main/java/org/springframework/data/gemfire/config/GemfireListenerContainerParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 the original author or authors. + * Copyright 2011-2012 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. 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 68f52bfa..80ffcdfa 100644 --- a/src/main/java/org/springframework/data/gemfire/config/GemfireNamespaceHandler.java +++ b/src/main/java/org/springframework/data/gemfire/config/GemfireNamespaceHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2011 the original author or authors. + * Copyright 2010-2012 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. @@ -23,9 +23,11 @@ import org.springframework.data.gemfire.repository.config.GemfireRepositoryParse * Namespace handler for GemFire definitions. * * @author Costin Leau + * @author David Turanski */ class GemfireNamespaceHandler extends NamespaceHandlerSupport { + @Override public void init() { registerBeanDefinitionParser("cache", new CacheParser()); registerBeanDefinitionParser("client-cache", new ClientCacheParser()); @@ -33,15 +35,14 @@ class GemfireNamespaceHandler extends NamespaceHandlerSupport { registerBeanDefinitionParser("lookup-region", new LookupRegionParser()); registerBeanDefinitionParser("replicated-region", new ReplicatedRegionParser()); registerBeanDefinitionParser("partitioned-region", new PartitionedRegionParser()); + registerBeanDefinitionParser("local-region", new LocalRegionParser()); registerBeanDefinitionParser("client-region", new ClientRegionParser()); registerBeanDefinitionParser("pool", new PoolParser()); registerBeanDefinitionParser("index", new IndexParser()); + registerBeanDefinitionParser("disk-store", new DiskStoreParser()); registerBeanDefinitionParser("cache-server", new CacheServerParser()); - registerBeanDefinitionParser("transaction-manager", new TransactionManagerParser()); - registerBeanDefinitionParser("cq-listener-container", new GemfireListenerContainerParser()); - registerBeanDefinitionParser("repositories", new GemfireRepositoryParser()); } } \ No newline at end of file diff --git a/src/main/java/org/springframework/data/gemfire/config/IndexParser.java b/src/main/java/org/springframework/data/gemfire/config/IndexParser.java index b97f428c..77296e16 100644 --- a/src/main/java/org/springframework/data/gemfire/config/IndexParser.java +++ b/src/main/java/org/springframework/data/gemfire/config/IndexParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 the original author or authors. + * Copyright 2011-2012 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. diff --git a/src/main/java/org/springframework/data/gemfire/config/LocalRegionParser.java b/src/main/java/org/springframework/data/gemfire/config/LocalRegionParser.java new file mode 100644 index 00000000..e948cc58 --- /dev/null +++ b/src/main/java/org/springframework/data/gemfire/config/LocalRegionParser.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010-2012 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.support.BeanDefinitionBuilder; +import org.springframework.beans.factory.xml.ParserContext; +import org.springframework.data.gemfire.LocalRegionFactoryBean; +import org.springframework.data.gemfire.RegionAttributesFactoryBean; +import org.w3c.dom.Element; + +import com.gemstone.gemfire.cache.Scope; + +/** + * Parser for <replicated-region;gt; definitions. + * + * @author Costin Leau + * @author David Turanski + */ +class LocalRegionParser extends AbstractRegionParser { + @Override + protected void doParseRegion(Element element, ParserContext parserContext, BeanDefinitionBuilder builder, + boolean subRegion) { + + builder.addPropertyValue("scope", Scope.LOCAL); + + BeanDefinitionBuilder attrBuilder = subRegion ? builder : BeanDefinitionBuilder + .genericBeanDefinition(RegionAttributesFactoryBean.class); + + super.doParseCommonRegionConfiguration(element, parserContext, builder, attrBuilder, subRegion); + if (!subRegion) { + builder.addPropertyValue("attributes", attrBuilder.getBeanDefinition()); + } + } + + @Override + protected Class getRegionFactoryClass() { + return LocalRegionFactoryBean.class; + } + +} \ No newline at end of file diff --git a/src/main/java/org/springframework/data/gemfire/config/LookupRegionParser.java b/src/main/java/org/springframework/data/gemfire/config/LookupRegionParser.java index 8c4c925e..b322d155 100644 --- a/src/main/java/org/springframework/data/gemfire/config/LookupRegionParser.java +++ b/src/main/java/org/springframework/data/gemfire/config/LookupRegionParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2011 the original author or authors. + * Copyright 2010-2012 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. @@ -16,32 +16,51 @@ package org.springframework.data.gemfire.config; +import java.util.List; + import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.beans.factory.xml.ParserContext; import org.springframework.data.gemfire.RegionLookupFactoryBean; import org.springframework.util.StringUtils; +import org.springframework.util.xml.DomUtils; import org.w3c.dom.Element; /** * Parser for <lookup-region;gt; definitions. * * @author Costin Leau + * @author David Turanski */ -class LookupRegionParser extends AliasReplacingBeanDefinitionParser { - - protected Class getBeanClass(Element element) { - return RegionLookupFactoryBean.class; - } +class LookupRegionParser extends AbstractRegionParser { @Override - protected void doParseInternal(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { + protected void doParseRegion(Element element, ParserContext parserContext, BeanDefinitionBuilder builder, + boolean subRegion) { super.doParse(element, builder); ParsingUtils.setPropertyValue(element, builder, "name", "name"); - String attr = element.getAttribute("cache-ref"); - // add cache reference (fallback to default if nothing is specified) - builder.addPropertyReference("cache", (StringUtils.hasText(attr) ? attr : "gemfire-cache")); + if (!subRegion) { + String attr = element.getAttribute("cache-ref"); + // add cache reference (fallback to default if nothing is specified) + builder.addPropertyReference("cache", (StringUtils.hasText(attr) ? attr : "gemfire-cache")); + } + else { + builder.addPropertyValue("lookupOnly", true); + } + // parse nested elements + List subElements = DomUtils.getChildElements(element); + for (Element subElement : subElements) { + String name = subElement.getLocalName(); + if (name.endsWith("region")) { + doParseSubRegion(element, subElement, parserContext, builder, subRegion); + } + } + } + + @Override + protected Class getRegionFactoryClass() { + return RegionLookupFactoryBean.class; } } diff --git a/src/main/java/org/springframework/data/gemfire/config/ParsingUtils.java b/src/main/java/org/springframework/data/gemfire/config/ParsingUtils.java index 14def796..f47c1d60 100644 --- a/src/main/java/org/springframework/data/gemfire/config/ParsingUtils.java +++ b/src/main/java/org/springframework/data/gemfire/config/ParsingUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2011 the original author or authors. + * Copyright 2010-2012 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. @@ -23,35 +23,47 @@ import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.config.BeanDefinitionHolder; import org.springframework.beans.factory.config.RuntimeBeanReference; import org.springframework.beans.factory.support.BeanDefinitionBuilder; +import org.springframework.beans.factory.support.ManagedArray; import org.springframework.beans.factory.support.ManagedList; import org.springframework.beans.factory.xml.AbstractBeanDefinitionParser; import org.springframework.beans.factory.xml.BeanDefinitionParserDelegate; import org.springframework.beans.factory.xml.ParserContext; +import org.springframework.core.Conventions; import org.springframework.util.StringUtils; import org.springframework.util.xml.DomUtils; import org.w3c.dom.Element; -import com.gemstone.gemfire.cache.DiskWriteAttributesFactory; import com.gemstone.gemfire.cache.ExpirationAction; import com.gemstone.gemfire.cache.ExpirationAttributes; +import com.gemstone.gemfire.cache.LossAction; +import com.gemstone.gemfire.cache.MembershipAttributes; +import com.gemstone.gemfire.cache.ResumptionAction; +import com.gemstone.gemfire.cache.Scope; /** * Various minor utility used by the parser. * * @author Costin Leau + * @author David Turanski */ abstract class ParsingUtils { private static final String ALIASES_KEY = ParsingUtils.class.getName() + ":aliases"; - static void setPropertyValue(Element element, BeanDefinitionBuilder builder, String attrName, String propertyName) { - String attr = element.getAttribute(attrName); + static void setPropertyValue(Element element, BeanDefinitionBuilder builder, String attributeName, + String propertyName) { + String attr = element.getAttribute(attributeName); if (StringUtils.hasText(attr)) { builder.addPropertyValue(propertyName, attr); } } - static void setPropertyReference(Element element, BeanDefinitionBuilder builder, String attrName, String propertyName) { + static void setPropertyValue(Element element, BeanDefinitionBuilder builder, String attributeName) { + setPropertyValue(element, builder, attributeName, Conventions.attributeNameToPropertyName(attributeName)); + } + + static void setPropertyReference(Element element, BeanDefinitionBuilder builder, String attrName, + String propertyName) { String attr = element.getAttribute(attrName); if (StringUtils.hasText(attr)) { builder.addPropertyReference(propertyName, attr); @@ -59,9 +71,11 @@ abstract class ParsingUtils { } /** - * Utility for parsing bean aliases. Normally parsed by AbstractBeanDefinitionParser however due to the attribute clash - * (bean uses 'name' for aliases while region use it to indicate their name), the parser needs to handle this differently by - * storing them as metadata which gets deleted just before registration. + * Utility for parsing bean aliases. Normally parsed by + * AbstractBeanDefinitionParser however due to the attribute clash (bean + * uses 'name' for aliases while region use it to indicate their name), the + * parser needs to handle this differently by storing them as metadata which + * gets deleted just before registration. * * @param element * @param builder @@ -87,10 +101,13 @@ abstract class ParsingUtils { /** * Utility method handling parsing of nested definition of the type: + * *
 	 *   
 	 * 
- * or + * + * or + * *
 	 *   
 	 *     
@@ -100,11 +117,13 @@ abstract class ParsingUtils {
 	 * @param element
 	 * @return
 	 */
-	static Object parseRefOrNestedBeanDeclaration(ParserContext parserContext, Element element, BeanDefinitionBuilder builder) {
+	static Object parseRefOrNestedBeanDeclaration(ParserContext parserContext, Element element,
+			BeanDefinitionBuilder builder) {
 		return parseRefOrNestedBeanDeclaration(parserContext, element, builder, "ref");
 	}
 
-	static Object parseRefOrNestedBeanDeclaration(ParserContext parserContext, Element element, BeanDefinitionBuilder builder, String refAttrName) {
+	static Object parseRefOrNestedBeanDeclaration(ParserContext parserContext, Element element,
+			BeanDefinitionBuilder builder, String refAttrName) {
 		String attr = element.getAttribute(refAttrName);
 		boolean hasRef = StringUtils.hasText(attr);
 
@@ -142,51 +161,8 @@ abstract class ParsingUtils {
 	}
 
 	/**
-	 * Parses disk store sub-element. Populates the given attribute factory with the proper attributes.
-	 * 
-	 * @param element - element enclosing the disk-store definition
-	 * @param beanBuilder - beanbuilder for a RegionAttributesFactoryBean instance
-	 * @return true if parsing actually occured, false otherwise
-	 */
-	static boolean parseDiskStorage(Element element, BeanDefinitionBuilder beanBuilder) {
-		Element diskStoreElement = DomUtils.getChildElementByTagName(element, "disk-store");
-
-		if (diskStoreElement == null)
-			return false;
-
-		BeanDefinitionBuilder diskDefBuilder = BeanDefinitionBuilder.genericBeanDefinition(DiskWriteAttributesFactory.class);
-		setPropertyValue(diskStoreElement, diskDefBuilder, "synchronous-write", "synchronous");
-		setPropertyValue(diskStoreElement, diskDefBuilder, "auto-compact", "rollOplogs");
-		setPropertyValue(diskStoreElement, diskDefBuilder, "max-oplog-size", "maxOplogSize");
-		setPropertyValue(diskStoreElement, diskDefBuilder, "time-interval", "timeInterval");
-		setPropertyValue(diskStoreElement, diskDefBuilder, "queue-size", "bytesThreshold");
-
-
-		// parse nested disk-dir
-		List list = DomUtils.getChildElementsByTagName(diskStoreElement, "disk-dir");
-		ManagedList locations = new ManagedList(list.size());
-		ManagedList sizes = new ManagedList(list.size());
-
-		for (Element diskDirElement : list) {
-			locations.add(diskDirElement.getAttribute("location"));
-
-			String attr = diskDirElement.getAttribute("max-size");
-			sizes.add(StringUtils.hasText(attr) ? attr : "10240");
-		}
-
-		// wrap up the disk attributes factory to call 'create'
-
-		BeanDefinitionBuilder factoryWrapper = BeanDefinitionBuilder.genericBeanDefinition(DiskWriteAttributesFactoryBean.class);
-		factoryWrapper.addPropertyValue("diskAttributesFactory", diskDefBuilder.getBeanDefinition());
-		beanBuilder.addPropertyValue("diskWriteAttributes", factoryWrapper.getBeanDefinition());
-		beanBuilder.addPropertyValue("diskDirs", locations);
-		beanBuilder.addPropertyValue("diskSizes", sizes);
-
-		return true;
-	}
-
-	/**
-	 * Parses the eviction sub-element. Populates the given attribute factory with the proper attributes.
+	 * Parses the eviction sub-element. Populates the given attribute factory
+	 * with the proper attributes.
 	 * 
 	 * @param parserContext
 	 * @param element
@@ -199,7 +175,8 @@ abstract class ParsingUtils {
 		if (evictionElement == null)
 			return false;
 
-		BeanDefinitionBuilder evictionDefBuilder = BeanDefinitionBuilder.genericBeanDefinition(EvictionAttributesFactoryBean.class);
+		BeanDefinitionBuilder evictionDefBuilder = BeanDefinitionBuilder
+				.genericBeanDefinition(EvictionAttributesFactoryBean.class);
 
 		// do manual conversion since the enum is not public
 		String attr = evictionElement.getAttribute("type");
@@ -207,9 +184,8 @@ abstract class ParsingUtils {
 			evictionDefBuilder.addPropertyValue("type", EvictionType.valueOf(attr.toUpperCase()));
 		}
 
-		setPropertyValue(evictionElement, evictionDefBuilder, "threshold", "threshold");
-		setPropertyValue(evictionElement, evictionDefBuilder, "action", "action");
-
+		setPropertyValue(evictionElement, evictionDefBuilder, "threshold");
+		setPropertyValue(evictionElement, evictionDefBuilder, "action");
 
 		// get object sizer (if declared)
 		Element objectSizerElement = DomUtils.getChildElementByTagName(evictionElement, "object-sizer");
@@ -223,13 +199,13 @@ abstract class ParsingUtils {
 		return true;
 	}
 
-
 	static void parseStatistics(Element element, BeanDefinitionBuilder attrBuilder) {
 		setPropertyValue(element, attrBuilder, "statistics", "statisticsEnabled");
 	}
 
 	/**
-	 * Parses the expiration sub-elements. Populates the given attribute factory with proper attributes. 
+	 * Parses the expiration sub-elements. Populates the given attribute factory
+	 * with proper attributes.
 	 * 
 	 * @param parserContext
 	 * @param element
@@ -250,7 +226,68 @@ abstract class ParsingUtils {
 		return result;
 	}
 
-	private static boolean parseExpiration(Element rootElement, String elementName, String propertyName, BeanDefinitionBuilder attrBuilder) {
+	static void parseOptionalRegionAttributes(ParserContext parserContext, Element element,
+			BeanDefinitionBuilder attrBuilder) {
+		if (!("partitioned-region".equals(element.getLocalName()))) {
+			setPropertyValue(element, attrBuilder, "persistent", "persistBackup");
+		}
+		setPropertyValue(element, attrBuilder, "ignore-jta", "ignoreJTA");
+		setPropertyValue(element, attrBuilder, "key-constraint");
+		setPropertyValue(element, attrBuilder, "value-constraint");
+		setPropertyValue(element, attrBuilder, "is-lock-grantor", "lockGrantor");
+		setPropertyValue(element, attrBuilder, "enable-subscription-conflation");
+		setPropertyValue(element, attrBuilder, "enable-async-conflation");
+		setPropertyValue(element, attrBuilder, "initial-capacity");
+		setPropertyValue(element, attrBuilder, "load-factor");
+		setPropertyValue(element, attrBuilder, "cloning-enabled");
+		setPropertyValue(element, attrBuilder, "concurrency-level");
+		setPropertyValue(element, attrBuilder, "multicast-enabled");
+
+		String indexUpdateType = element.getAttribute("index-update-type");
+		if (StringUtils.hasText(indexUpdateType)) {
+			attrBuilder.addPropertyValue("indexMaintenanceSynchronous", "synchronous".equals(indexUpdateType));
+		}
+	}
+
+	static void parseMembershipAttributes(ParserContext parserContext, Element element,
+			BeanDefinitionBuilder attrBuilder) {
+		Element membershipAttributes = DomUtils.getChildElementByTagName(element, "membership-attributes");
+		if (membershipAttributes != null) {
+			String requiredRoles[] = StringUtils.commaDelimitedListToStringArray(membershipAttributes
+					.getAttribute("required-roles"));
+			String lossActionAttr = membershipAttributes.getAttribute("loss-action");
+			LossAction lossAction = StringUtils.hasText(lossActionAttr) ? LossAction.fromName(lossActionAttr
+					.toUpperCase().replace("-", "_")) : null;
+			String resumptionActionAttr = membershipAttributes.getAttribute("resumption-action");
+			ResumptionAction resumptionAction = StringUtils.hasText(resumptionActionAttr) ? ResumptionAction
+					.fromName(resumptionActionAttr.toUpperCase().replace("-", "_")) : null;
+
+			ManagedArray requiredRolesArray = new ManagedArray("java.lang.String", requiredRoles.length);
+			for (int i = 0; i < requiredRoles.length; i++) {
+				requiredRolesArray.add(requiredRoles[i]);
+			}
+			BeanDefinitionBuilder membershipAttributesBuilder = BeanDefinitionBuilder
+					.genericBeanDefinition(MembershipAttributes.class);
+			membershipAttributesBuilder.addConstructorArgValue(requiredRolesArray);
+			membershipAttributesBuilder.addConstructorArgValue(lossAction);
+			membershipAttributesBuilder.addConstructorArgValue(resumptionAction);
+
+			attrBuilder.addPropertyValue("membershipAttributes", membershipAttributesBuilder.getRawBeanDefinition());
+		}
+	}
+
+	static void parseScope(Element element, BeanDefinitionBuilder builder) {
+		String scope = element.getAttribute("scope");
+		if (StringUtils.hasText(scope)) {
+			builder.addPropertyValue("scope", Scope.fromString(scope.toUpperCase().replace("-", "_")));
+		}
+		else {
+			builder.addPropertyValue("scope", Scope.DISTRIBUTED_ACK);
+		}
+	}
+
+	private static boolean parseExpiration(Element rootElement, String elementName, String propertyName,
+			BeanDefinitionBuilder attrBuilder) {
 		Element expirationElement = DomUtils.getChildElementByTagName(rootElement, elementName);
 
 		if (expirationElement == null)
@@ -259,7 +296,6 @@ abstract class ParsingUtils {
 		String expirationTime = null;
 		ExpirationAction action = ExpirationAction.INVALIDATE;
 
-
 		// do manual conversion since the enum is not public
 		String attr = expirationElement.getAttribute("timeout");
 		if (StringUtils.hasText(attr)) {
@@ -284,7 +320,8 @@ abstract class ParsingUtils {
 				action = ExpirationAction.LOCAL_INVALIDATE;
 			}
 		}
-		BeanDefinitionBuilder expirationAttributes = BeanDefinitionBuilder.genericBeanDefinition(ExpirationAttributes.class);
+		BeanDefinitionBuilder expirationAttributes = BeanDefinitionBuilder
+				.genericBeanDefinition(ExpirationAttributes.class);
 		expirationAttributes.addConstructorArgValue(expirationTime);
 		expirationAttributes.addConstructorArgValue(action);
 		attrBuilder.addPropertyValue(propertyName, expirationAttributes.getBeanDefinition());
diff --git a/src/main/java/org/springframework/data/gemfire/config/PartitionedRegionParser.java b/src/main/java/org/springframework/data/gemfire/config/PartitionedRegionParser.java
index 5d046db3..65bdec6d 100644
--- a/src/main/java/org/springframework/data/gemfire/config/PartitionedRegionParser.java
+++ b/src/main/java/org/springframework/data/gemfire/config/PartitionedRegionParser.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010-2011 the original author or authors.
+ * Copyright 2010-2012 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.
@@ -17,75 +17,46 @@
 package org.springframework.data.gemfire.config;
 
 import java.util.List;
-import java.util.concurrent.ConcurrentMap;
 
 import org.springframework.beans.factory.support.BeanDefinitionBuilder;
 import org.springframework.beans.factory.xml.ParserContext;
 import org.springframework.data.gemfire.PartitionAttributesFactoryBean;
+import org.springframework.data.gemfire.PartitionedRegionFactoryBean;
 import org.springframework.data.gemfire.RegionAttributesFactoryBean;
-import org.springframework.data.gemfire.RegionFactoryBean;
 import org.springframework.util.StringUtils;
 import org.springframework.util.xml.DomUtils;
 import org.w3c.dom.Element;
 
-import com.gemstone.gemfire.cache.CacheFactory;
-import com.gemstone.gemfire.cache.DataPolicy;
-import com.gemstone.gemfire.cache.Region;
-
 /**
  * Parser for <partitioned-region;gt; definitions.
  * 
- * To avoid eager evaluations, the region attributes are declared as a nested definition.
+ * To avoid eager evaluations, the region attributes are declared as a nested
+ * definition.
  * 
  * @author Costin Leau
+ * @author David Turanski
  */
-class PartitionedRegionParser extends AliasReplacingBeanDefinitionParser {
-
-	protected Class getBeanClass(Element element) {
-		return RegionFactoryBean.class;
+class PartitionedRegionParser extends AbstractRegionParser {
+	@Override
+	protected Class getRegionFactoryClass() {
+		return PartitionedRegionFactoryBean.class;
 	}
 
 	@Override
-	protected void doParseInternal(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {
+	protected void doParseRegion(Element element, ParserContext parserContext, BeanDefinitionBuilder builder,
+			boolean subRegion) {
 		super.doParse(element, builder);
 
-		// set the data policy
-		String attr = element.getAttribute("persistent");
-
-		if (Boolean.parseBoolean(attr)) {
-			// check first for GemFire 6.5
-			if (ConcurrentMap.class.isAssignableFrom(Region.class)) {
-				builder.addPropertyValue("dataPolicy", "PERSISTENT_PARTITION");
-			}
-			else {
-				parserContext.getReaderContext().error(
-						"Can define persistent partitions only from GemFire 6.5 onwards - current version is ["
-								+ CacheFactory.getVersion() + "]", element);
-			}
-		}
-		else {
-			builder.addPropertyValue("dataPolicy", DataPolicy.PARTITION);
-		}
-
-		ParsingUtils.setPropertyValue(element, builder, "name", "name");
-
-		attr = element.getAttribute("cache-ref");
-		// add cache reference (fallback to default if nothing is specified)
-		builder.addPropertyReference("cache", (StringUtils.hasText(attr) ? attr : "gemfire-cache"));
-
-		// region attributes
-		BeanDefinitionBuilder attrBuilder = BeanDefinitionBuilder.genericBeanDefinition(RegionAttributesFactoryBean.class);
-
-		ParsingUtils.parseStatistics(element, attrBuilder);
-		ParsingUtils.parseExpiration(parserContext, element, attrBuilder);
-		ParsingUtils.parseEviction(parserContext, element, attrBuilder);
-		ParsingUtils.parseDiskStorage(element, attrBuilder);
+		BeanDefinitionBuilder attrBuilder = subRegion ? builder : BeanDefinitionBuilder
+				.genericBeanDefinition(RegionAttributesFactoryBean.class);
 
+		super.doParseCommonRegionConfiguration(element, parserContext, builder, attrBuilder, subRegion);
+		//
 		// partition attributes
-		BeanDefinitionBuilder parAttrBuilder = BeanDefinitionBuilder.genericBeanDefinition(PartitionAttributesFactoryBean.class);
+		BeanDefinitionBuilder parAttrBuilder = BeanDefinitionBuilder
+				.genericBeanDefinition(PartitionAttributesFactoryBean.class);
 
-
-		attr = element.getAttribute("colocated-with");
+		String attr = element.getAttribute("colocated-with");
 
 		if (StringUtils.hasText(attr)) {
 			parAttrBuilder.addPropertyValue("colocatedWith", attr);
@@ -121,48 +92,21 @@ class PartitionedRegionParser extends AliasReplacingBeanDefinitionParser {
 		if (StringUtils.hasText(attr)) {
 			parAttrBuilder.addPropertyValue("totalNumBuckets", Integer.valueOf(attr));
 		}
-
-
-		List subElements = DomUtils.getChildElements(element);
-
-		// parse nested cache-listener elements
+		//
+		List subElements = DomUtils.getChildElementsByTagName(element, "partition-resolver");
+		//
+		// // parse nested cache-listener elements
 		for (Element subElement : subElements) {
-			String name = subElement.getLocalName();
-
-			if ("cache-listener".equals(name)) {
-				builder.addPropertyValue("cacheListeners", parseCacheListener(parserContext, subElement, builder));
-			}
-
-			else if ("cache-loader".equals(name)) {
-				builder.addPropertyValue("cacheLoader", parseCacheLoader(parserContext, subElement, builder));
-			}
-
-			else if ("cache-writer".equals(name)) {
-				builder.addPropertyValue("cacheWriter", parseCacheWriter(parserContext, subElement, builder));
-			}
-
-			else if ("partition-resolver".equals(name)) {
-				parAttrBuilder.addPropertyValue("partitionResolver", parsePartitionResolver(parserContext, subElement,
-						builder));
-			}
+			parAttrBuilder.addPropertyValue("partitionResolver",
+					parsePartitionResolver(parserContext, subElement, builder));
 		}
-
-		// add partition attributes attributes
+		//
+		// // add partition attributes attributes
 		attrBuilder.addPropertyValue("partitionAttributes", parAttrBuilder.getBeanDefinition());
 		// add partition/overflow settings as attributes
-		builder.addPropertyValue("attributes", attrBuilder.getBeanDefinition());
-	}
-
-	private Object parseCacheListener(ParserContext parserContext, Element subElement, BeanDefinitionBuilder builder) {
-		return ParsingUtils.parseRefOrNestedBeanDeclaration(parserContext, subElement, builder);
-	}
-
-	private Object parseCacheLoader(ParserContext parserContext, Element subElement, BeanDefinitionBuilder builder) {
-		return ParsingUtils.parseRefOrNestedBeanDeclaration(parserContext, subElement, builder);
-	}
-
-	private Object parseCacheWriter(ParserContext parserContext, Element subElement, BeanDefinitionBuilder builder) {
-		return ParsingUtils.parseRefOrNestedBeanDeclaration(parserContext, subElement, builder);
+		if (!subRegion) {
+			builder.addPropertyValue("attributes", attrBuilder.getBeanDefinition());
+		}
 	}
 
 	private Object parsePartitionResolver(ParserContext parserContext, Element subElement, BeanDefinitionBuilder builder) {
diff --git a/src/main/java/org/springframework/data/gemfire/config/PoolParser.java b/src/main/java/org/springframework/data/gemfire/config/PoolParser.java
index 968dad4f..27c882dd 100644
--- a/src/main/java/org/springframework/data/gemfire/config/PoolParser.java
+++ b/src/main/java/org/springframework/data/gemfire/config/PoolParser.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010-2011 the original author or authors.
+ * Copyright 2010-2012 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.
diff --git a/src/main/java/org/springframework/data/gemfire/config/ReplicatedRegionParser.java b/src/main/java/org/springframework/data/gemfire/config/ReplicatedRegionParser.java
index 13df6b7e..408f20e2 100644
--- a/src/main/java/org/springframework/data/gemfire/config/ReplicatedRegionParser.java
+++ b/src/main/java/org/springframework/data/gemfire/config/ReplicatedRegionParser.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010-2011 the original author or authors.
+ * Copyright 2010-2012 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.
@@ -16,96 +16,36 @@
 
 package org.springframework.data.gemfire.config;
 
-import java.util.List;
-
 import org.springframework.beans.factory.support.BeanDefinitionBuilder;
 import org.springframework.beans.factory.xml.ParserContext;
 import org.springframework.data.gemfire.RegionAttributesFactoryBean;
-import org.springframework.data.gemfire.RegionFactoryBean;
-import org.springframework.util.StringUtils;
-import org.springframework.util.xml.DomUtils;
+import org.springframework.data.gemfire.ReplicatedRegionFactoryBean;
 import org.w3c.dom.Element;
 
-import com.gemstone.gemfire.cache.DataPolicy;
-import com.gemstone.gemfire.cache.Scope;
-
 /**
  * Parser for <replicated-region;gt; definitions.
  * 
  * @author Costin Leau
+ * @author David Turanski
  */
-class ReplicatedRegionParser extends AliasReplacingBeanDefinitionParser {
+class ReplicatedRegionParser extends AbstractRegionParser {
+	@Override
+	protected void doParseRegion(Element element, ParserContext parserContext, BeanDefinitionBuilder builder,
+			boolean subRegion) {
 
-	protected Class getBeanClass(Element element) {
-		return RegionFactoryBean.class;
+		ParsingUtils.parseScope(element, builder);
+
+		BeanDefinitionBuilder attrBuilder = subRegion ? builder : BeanDefinitionBuilder
+				.genericBeanDefinition(RegionAttributesFactoryBean.class);
+
+		super.doParseCommonRegionConfiguration(element, parserContext, builder, attrBuilder, subRegion);
+		if (!subRegion) {
+			builder.addPropertyValue("attributes", attrBuilder.getBeanDefinition());
+		}
 	}
 
 	@Override
-	protected void doParseInternal(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {
-		super.doParse(element, builder);
-
-		// set the data policy
-		String attr = element.getAttribute("persistent");
-		if (Boolean.parseBoolean(attr)) {
-			builder.addPropertyValue("dataPolicy", DataPolicy.PERSISTENT_REPLICATE);
-		}
-		else {
-			builder.addPropertyValue("dataPolicy", DataPolicy.REPLICATE);
-		}
-
-		builder.addPropertyValue("scope", Scope.DISTRIBUTED_ACK);
-
-		ParsingUtils.setPropertyValue(element, builder, "name", "name");
-
-		attr = element.getAttribute("cache-ref");
-		// add cache reference (fallback to default if nothing is specified)
-		builder.addPropertyReference("cache", (StringUtils.hasText(attr) ? attr : "gemfire-cache"));
-
-		// add attributes
-		BeanDefinitionBuilder attrBuilder = BeanDefinitionBuilder.genericBeanDefinition(RegionAttributesFactoryBean.class);
-
-		ParsingUtils.parseStatistics(element, attrBuilder);
-
-		attr = element.getAttribute("publisher");
-		if (StringUtils.hasText(attr)) {
-			attrBuilder.addPropertyValue("publisher", Boolean.valueOf(attr));
-		}
-
-		ParsingUtils.parseExpiration(parserContext, element, attrBuilder);
-		ParsingUtils.parseEviction(parserContext, element, attrBuilder);
-		ParsingUtils.parseDiskStorage(element, attrBuilder);
-
-		builder.addPropertyValue("attributes", attrBuilder.getBeanDefinition());
-
-		List subElements = DomUtils.getChildElements(element);
-
-		// parse nested cache-listener elements
-		for (Element subElement : subElements) {
-			String name = subElement.getLocalName();
-
-			if ("cache-listener".equals(name)) {
-				builder.addPropertyValue("cacheListeners", parseCacheListener(parserContext, subElement, builder));
-			}
-
-			else if ("cache-loader".equals(name)) {
-				builder.addPropertyValue("cacheLoader", parseCacheLoader(parserContext, subElement, builder));
-			}
-
-			else if ("cache-writer".equals(name)) {
-				builder.addPropertyValue("cacheWriter", parseCacheWriter(parserContext, subElement, builder));
-			}
-		}
-	}
-
-	private Object parseCacheListener(ParserContext parserContext, Element subElement, BeanDefinitionBuilder builder) {
-		return ParsingUtils.parseRefOrNestedBeanDeclaration(parserContext, subElement, builder);
-	}
-
-	private Object parseCacheLoader(ParserContext parserContext, Element subElement, BeanDefinitionBuilder builder) {
-		return ParsingUtils.parseRefOrNestedBeanDeclaration(parserContext, subElement, builder);
-	}
-
-	private Object parseCacheWriter(ParserContext parserContext, Element subElement, BeanDefinitionBuilder builder) {
-		return ParsingUtils.parseRefOrNestedBeanDeclaration(parserContext, subElement, builder);
+	protected Class getRegionFactoryClass() {
+		return ReplicatedRegionFactoryBean.class;
 	}
 }
\ No newline at end of file
diff --git a/src/main/java/org/springframework/data/gemfire/config/TransactionManagerParser.java b/src/main/java/org/springframework/data/gemfire/config/TransactionManagerParser.java
index b5cf6c65..7143ef44 100644
--- a/src/main/java/org/springframework/data/gemfire/config/TransactionManagerParser.java
+++ b/src/main/java/org/springframework/data/gemfire/config/TransactionManagerParser.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010-2011 the original author or authors.
+ * Copyright 2010-2012the 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.
@@ -32,6 +32,7 @@ import org.w3c.dom.Element;
  */
 class TransactionManagerParser extends AbstractSingleBeanDefinitionParser {
 
+	@Override
 	protected Class getBeanClass(Element element) {
 		return GemfireTransactionManager.class;
 	}
diff --git a/src/main/java/org/springframework/data/gemfire/listener/ContinuousQueryDefinition.java b/src/main/java/org/springframework/data/gemfire/listener/ContinuousQueryDefinition.java
index d9fd0934..75daf0fd 100644
--- a/src/main/java/org/springframework/data/gemfire/listener/ContinuousQueryDefinition.java
+++ b/src/main/java/org/springframework/data/gemfire/listener/ContinuousQueryDefinition.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011 the original author or authors.
+ * Copyright 2011-2012 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.
diff --git a/src/main/java/org/springframework/data/gemfire/listener/ContinuousQueryListener.java b/src/main/java/org/springframework/data/gemfire/listener/ContinuousQueryListener.java
index c96581c5..23d75298 100644
--- a/src/main/java/org/springframework/data/gemfire/listener/ContinuousQueryListener.java
+++ b/src/main/java/org/springframework/data/gemfire/listener/ContinuousQueryListener.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011 the original author or authors.
+ * Copyright 2011-2012 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.
diff --git a/src/main/java/org/springframework/data/gemfire/listener/ContinuousQueryListenerContainer.java b/src/main/java/org/springframework/data/gemfire/listener/ContinuousQueryListenerContainer.java
index c4a4db4d..540ae713 100644
--- a/src/main/java/org/springframework/data/gemfire/listener/ContinuousQueryListenerContainer.java
+++ b/src/main/java/org/springframework/data/gemfire/listener/ContinuousQueryListenerContainer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011 the original author or authors.
+ * Copyright 2011-2012 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.
diff --git a/src/main/java/org/springframework/data/gemfire/listener/GemfireListenerExecutionFailedException.java b/src/main/java/org/springframework/data/gemfire/listener/GemfireListenerExecutionFailedException.java
index 63540f6c..36e4cad4 100644
--- a/src/main/java/org/springframework/data/gemfire/listener/GemfireListenerExecutionFailedException.java
+++ b/src/main/java/org/springframework/data/gemfire/listener/GemfireListenerExecutionFailedException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011 the original author or authors.
+ * Copyright 2011-2012 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.
diff --git a/src/main/java/org/springframework/data/gemfire/listener/adapter/ContinuousQueryListenerAdapter.java b/src/main/java/org/springframework/data/gemfire/listener/adapter/ContinuousQueryListenerAdapter.java
index 406ff2af..1c32a3eb 100644
--- a/src/main/java/org/springframework/data/gemfire/listener/adapter/ContinuousQueryListenerAdapter.java
+++ b/src/main/java/org/springframework/data/gemfire/listener/adapter/ContinuousQueryListenerAdapter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011-2012 the original author or authors.
+ * Copyright 2011-2012-2012 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.
diff --git a/src/main/java/org/springframework/data/gemfire/serialization/AsmInstantiatorGenerator.java b/src/main/java/org/springframework/data/gemfire/serialization/AsmInstantiatorGenerator.java
index 3cd71ae5..4530ad92 100644
--- a/src/main/java/org/springframework/data/gemfire/serialization/AsmInstantiatorGenerator.java
+++ b/src/main/java/org/springframework/data/gemfire/serialization/AsmInstantiatorGenerator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010-2011 the original author or authors.
+ * Copyright 2010-2012 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.
diff --git a/src/main/java/org/springframework/data/gemfire/serialization/EnumSerializer.java b/src/main/java/org/springframework/data/gemfire/serialization/EnumSerializer.java
index 54f5f0f0..80b739ec 100644
--- a/src/main/java/org/springframework/data/gemfire/serialization/EnumSerializer.java
+++ b/src/main/java/org/springframework/data/gemfire/serialization/EnumSerializer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010-2011 the original author or authors.
+ * Copyright 2010-2012 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.
diff --git a/src/main/java/org/springframework/data/gemfire/serialization/InstantiatorFactoryBean.java b/src/main/java/org/springframework/data/gemfire/serialization/InstantiatorFactoryBean.java
index 83bbafce..5505f9c6 100644
--- a/src/main/java/org/springframework/data/gemfire/serialization/InstantiatorFactoryBean.java
+++ b/src/main/java/org/springframework/data/gemfire/serialization/InstantiatorFactoryBean.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010-2011 the original author or authors.
+ * Copyright 2010-2012 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.
diff --git a/src/main/java/org/springframework/data/gemfire/serialization/InstantiatorGenerator.java b/src/main/java/org/springframework/data/gemfire/serialization/InstantiatorGenerator.java
index 4c05a9eb..df61fb71 100644
--- a/src/main/java/org/springframework/data/gemfire/serialization/InstantiatorGenerator.java
+++ b/src/main/java/org/springframework/data/gemfire/serialization/InstantiatorGenerator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010-2011 the original author or authors.
+ * Copyright 2010-2012 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.
diff --git a/src/main/java/org/springframework/data/gemfire/serialization/WiringInstantiator.java b/src/main/java/org/springframework/data/gemfire/serialization/WiringInstantiator.java
index 33472f1b..57a93846 100644
--- a/src/main/java/org/springframework/data/gemfire/serialization/WiringInstantiator.java
+++ b/src/main/java/org/springframework/data/gemfire/serialization/WiringInstantiator.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010-2011 the original author or authors.
+ * Copyright 2010-2012 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.
diff --git a/src/main/java/org/springframework/data/gemfire/server/CacheServerFactoryBean.java b/src/main/java/org/springframework/data/gemfire/server/CacheServerFactoryBean.java
index ea800a54..9a8ae8dc 100644
--- a/src/main/java/org/springframework/data/gemfire/server/CacheServerFactoryBean.java
+++ b/src/main/java/org/springframework/data/gemfire/server/CacheServerFactoryBean.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011 the original author or authors.
+ * Copyright 2011-2012 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.
diff --git a/src/main/java/org/springframework/data/gemfire/server/SubscriptionEvictionPolicy.java b/src/main/java/org/springframework/data/gemfire/server/SubscriptionEvictionPolicy.java
index d7c1efda..b46a24ea 100644
--- a/src/main/java/org/springframework/data/gemfire/server/SubscriptionEvictionPolicy.java
+++ b/src/main/java/org/springframework/data/gemfire/server/SubscriptionEvictionPolicy.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011 the original author or authors.
+ * Copyright 2011-2012 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.
diff --git a/src/main/java/org/springframework/data/gemfire/support/GemfireCache.java b/src/main/java/org/springframework/data/gemfire/support/GemfireCache.java
index f6a1282c..390b308b 100644
--- a/src/main/java/org/springframework/data/gemfire/support/GemfireCache.java
+++ b/src/main/java/org/springframework/data/gemfire/support/GemfireCache.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010-2011 the original author or authors.
+ * Copyright 2010-2012 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.
diff --git a/src/main/java/org/springframework/data/gemfire/support/GemfireCacheManager.java b/src/main/java/org/springframework/data/gemfire/support/GemfireCacheManager.java
index a94e9495..17fd981a 100644
--- a/src/main/java/org/springframework/data/gemfire/support/GemfireCacheManager.java
+++ b/src/main/java/org/springframework/data/gemfire/support/GemfireCacheManager.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010-2011 the original author or authors.
+ * Copyright 2010-2012 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.
diff --git a/src/main/java/org/springframework/data/gemfire/support/GemfireDaoSupport.java b/src/main/java/org/springframework/data/gemfire/support/GemfireDaoSupport.java
index 97a652d3..b287b768 100644
--- a/src/main/java/org/springframework/data/gemfire/support/GemfireDaoSupport.java
+++ b/src/main/java/org/springframework/data/gemfire/support/GemfireDaoSupport.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011 the original author or authors.
+ * Copyright 2011-2012 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.
diff --git a/src/main/resources/org/springframework/data/gemfire/config/spring-gemfire-1.2.xsd b/src/main/resources/org/springframework/data/gemfire/config/spring-gemfire-1.2.xsd
index 60797d8d..543041a9 100644
--- a/src/main/resources/org/springframework/data/gemfire/config/spring-gemfire-1.2.xsd
+++ b/src/main/resources/org/springframework/data/gemfire/config/spring-gemfire-1.2.xsd
@@ -1,27 +1,81 @@
 
-
-
-    
-    
-    
-
-    
-        
+
+	
+	
+	
+	
+	
+		
-    
-    
-    
-   	
+	
+	
+	
+		
+			
+				
+					
+				
+			
+			
+				
+					
+				
+			
+			
+				
+					
+				
+				
+					
+                        
+                    
+                
+                    
+					
+                        
+                    
+                
+                    
+					
+                        
+                    
+                
+                    
+				
+			
+			
+                
+                    
+                
+            
+		
+		
+			
+				
+			
+		
 		
 			
 				 namespace and its 'prop
 				]]>
 			
 		
-		
+		
 			
 				
 			
 				
 			
-				
+		
 		
 			
 				
 			
-				
+		
 		
 			
 				
 			
-				
+		
 		
 			
 				
 			
-				
+		
 		
 			
 				
 			
-				
+		
+		
+			
+				
+			
+		
+		
+			
+				
+			
+		
 	
-    
-    
+	
+	
 		
 			
 			
 				
-					
+					
 				
 			
 		
+		
+			
+				
+					
+						
+							
+						
+					
+					
+						
+							
+						
+					
+					
+						
+							
+						
+					
+					
+						
+							
+						
+					
+				
+			
+		
 	
-	
+	
 	
 		
 			
 			
 				
-					
+					
 				
 			
 		
 		
 			
-				
-					
+				
+					
 						
 							
 		
 	
-
+	
 	
 		
 			
 				
 			
-			
+			
 				
 					
 				
 			
-			
+			
 				
 					
 				
-			 
+			
 		
 	
-	
 	
 	
 		
-			
-    			
-         			
+				
+					
 				
-         							
+			
 		
 		
 			
@@ -197,40 +309,47 @@ The name of the bean referred by this declaration. If no reference exists, use a
 			
 		
 	
-	
+	
+	
+		
+			
+			
+				
+					
+				
+			
+		
+		
+			
+				
+			
+		
+	
+	
+		
+			
+				
+					
+						
+					
+				
+			
+		
+	
 	
 		
 			
 				
-					
+					
 				
 			
 		
-		
-			
-				
-			
-		
-		
-			
-				
-			
-		
-		
-			
-				
-			
-		 
-	 
-	
-	
-	
+	
+	
+	
 		
 			
 				
@@ -252,13 +371,13 @@ other thread for accessing the region and not waiting for it to complete its tas
 						
 						
 							
-								
-					    			
-					         			
+									
+										
 									
-					         							
+								
 							
 							
 								
@@ -270,13 +389,38 @@ use inner bean declarations.
 							
 						
 					
-					
-						
-							
-						
-												
+                    
+                      
+                        
+                    
+                    
+                        
+                         
+                           
+                       
+                     
+                        
+                         
+                           
+                       
+                     
+                        
+                         
+                           
+                       
+                     
+                    
+                    
 				
 				
 					
@@ -286,12 +430,30 @@ Indicates whether the defined region is persistent or not. GemFire ensures that
 region. This allows data to be recovered after a machine or process failure or after an orderly shutdown and restart 
 of GemFire.
 
-Default is false, meaning the regions are not persisted.
+Default is false, meaning the regions are not persisted. 
 
 Note: Persistence for partitioned regions is supported only from GemFire 6.5 onwards.						
 						]]>
 					
 				
+				
+					
+						
+					
+				
+				
+					
+						
+					
+				
 				
 					
 						
 					
 				
+				
+					
+						
+					
+				
+				
+					
+						
+					
+				
+				
+					
+						
+					
+				
+				
+					
+						
+					
+				
+				
+					
+						
+					
+					
+						
+							
+							
+						
+					
+				
 			
 		
 	
-	
-	
+	
+	
 		
-			
+			
+				
+			
+		
+	
+	
+	
+		
+			
+				
+					
+						
+					
+				
+			
+		
+	
+	
+	
+		
+			
 				
-					
+					
 						
 							
 						
 					
-					
+					
 						
 							
 						
 					
-					
-					
+					
 						
 							
 						
 					
-					
+					
 						
 							
 						
 					
-					
+					
 						
 							
 						
 					
-					
+					
 						
 							
 					
 				
+				
+					
+						
+					
+				
+				
+					
+						
+					
+				
 			
 		
 	
-	
-	
-		
-			
-		
-	
-	
-	
+	
+	
+		
+			
+				
+			
+		
+	
+	
+		
+			
+				
+					
+						
+					
+				
+			
+		
+	
+	
+	
+		
+			
+				
+			
+		
+	
+	
+		
+			
+				
+					
+						
+					
+				
+			
+		
+	
+	
+	
+		
+			
+			
+			
+			
+		
+	
+	
+	
+		
+			
+				
+			
+		
+		
+			
+				
+			
+		
+		
+			
+				
+			
+		
+	
+	
+	
+		
+			
+				
+			
+		
+		
+			
+				
+			
+		
+		
+			
+				
+			
+		
+	
+	
+	
+	
+	
 		
 			
+            ]]>
 			
 				
-					
+					
 				
 			
 		
-		
-			
-				
-					
-						
-							
-								
+			
+				
+					
+						
+							
-							
-							
-								
-									
-										
-											
-												
+						
+						
+							
+								
+									
+										
+											
-											
-										
-									
-								
-							
-						
-					
-				
-			
-		
-	
-	
-	
+                                                ]]>
+										
+									
+								
+							
+						
+					
+					
+				
+				
+				
+					
+						
+					
+				
+				
+                
+				
+					
+						
+					
+				
+			
+		
+	
+	
+	
+		
+			
+				
+			
+		
+	
+	
+	
+		
+			
+				
+					
+						
+					
+				
+			
+		
+	
+	
+	
+	
+	
+		
+			
+			
+				
+					
+				
+			
+		
+		
+			
+				
+					
+						
+							
+						
+						
+							
+								
+									
+										
+											
+										
+									
+								
+							
+						
+					
+					
+				
+				
+					
+						
+					
+				
+				
+					
+						
+					
+				
+			
+		
+	
+	
+	
+		
+			
+				
+			
+		
+	
+	
+	
+		
+			
+				
+					
+						
+					
+				
+			
+		
+	
+	
+	
+	
+	
 		
 			
 			
 				
-					
+					
 				
 			
 		
-		
-			
-				
-					
-						
-							
-								
+			
+				
+					
+						
+							
-								
-									
-										
-									
-								
-							
-						
-						
-							
-								
-							
-							
-								
-									
-										
-											
-												
-											
-										
-									
-								
-							
-						
-					
-					
+							
+								
+									
+								
+							
+						
+					
+					
 						
 							
+						
+						
+							
+								
+									
+										
+											
+										
+									
+								
+							
+						
+					
+				
+				
+				
+					
+						
-						
-						
-							
-								
-								
-							
-						
-					
-					
-						
-							
+					
+						
+							
+							
+						
+					
+				
+				
+					
+						
-						
-					
-					
-						
-							
+				
+				
+					
+						
-						
-					
-					
-						
-							
+				
+				
+					
+						
-						
-					
-					
-						
-							
+				
+				
+					
+						
-						
-					
-					
-						
-							
+				
+				
+					
+						
-						
-					
-					
-						
-							
+				
+				
+					
+						
-						
-					
-				
-			
-		
-	
-	
+					
+				
+			
+		
+	
+	
+	
+		
+			
+				
+			
+			
+		
+	
+	
+	
+		
+			
+				
+					
+						
+					
+				
+			
+			
+		
+	
+	
+	
+	
 	
 		
 			
@@ -619,7 +1089,7 @@ When the region or cached object expires, it is destroyed locally only. Not supp
 			
 		
 	
-	
+	
 	
 		
 			
@@ -629,7 +1099,7 @@ Entity computing sizes for objects stored into the grid.
 					]]>
 					
 						
-							
+							
 						
 					
 				
@@ -671,7 +1141,7 @@ performed.
 			
 		
 	
-	
+	
 	
 		
 			
@@ -693,8 +1163,8 @@ reclaim memory.
 			
 		
 	
-	
-	
+	
+	
 		
 			
 				
@@ -705,69 +1175,44 @@ Directory on the file system for storing data.
 
 Note: the directory must already exist.						
 							]]>
+							
+								
+									
+								
+							
 						
 					
-					
+					
 						
 							
 						
 					
 				
 			
 		
-		
-			
-				
-				
-			
-				
 		
 			
 				
-				
+				]]>
 			
 		
-		
 		
 			
 				
-				
+				]]>
 			
 		
-		
+		
 			
 				
-				
+				]]>
 			
 		
 		
@@ -776,12 +1221,61 @@ It is considered only for asynchronous writing.
 The maximum number of operations that can be asynchronously queued. Once this many pending async operations have been 
 queued async ops will begin blocking until some of the queued ops have been flushed to disk.
 Considered only for asynchronous writing.
-				]]>
-				
+				]]>
+			
+		
+		
+			
+				
+			
+			
+				
+					
+					
+				
+			
+		
+		
+			
+				
+			
+		
+		
+			
+				
 			
 		
 	
-
+	
+	
+		
+			
+				
+					
+						
+					
+				
+				
+					
+						
+					
+				
+			
+		
+	
+	
+	
+	
 	
 		
 			
 			
 				
-					
+					
 				
 			
 		
@@ -811,13 +1305,13 @@ to any key in this region in the CacheServer to be pushed to the client.
 									
 										
 											
-												
-			    									
-			         									
+													
+														
 													
-			         													
+												
 											
 											
 												
@@ -865,9 +1359,9 @@ The action to take when performing eviction.
 									
 								
 							
-												
+						
 					
-					
+					
 						
 							
 						
-						
-							
-								
-								
-							
-						
 					
-					
+					
 						
 							
 		
 	
-	
+	
 	
 		
 			
@@ -935,19 +1423,19 @@ The port number of the connection (between 1 and 65535 inclusive).
 			
 			
 				
-						
+			
 		
 	
-
+	
 	
-		
+		
 			
 				
 			
 		
-		
+		
 			
 				
 			
 		
-		
+		
 			
 				
 			
-				
+		
 	
-	
+	
 	
 		
 			
 			
 				
-					
+					
 				
 			
 		
@@ -1000,37 +1488,36 @@ Note that in order to instantiate a pool, a GemFire cache needs to be already st
 The name of the pool definition (by default "gemfire-pool").]]>
 				
 			
-			
-			
-			
-			
-			
-			
-			
-			
-			
-			
-			
-			
-			
-			
-			
-			
-			
-			
+			
+			
+			
+			
+			
+			
+			
+			
+			
+			
+			
+			
+			
+			
+			
+			
+			
+			
 		
 	
-	
+	
 	
 		
-			
 			
 				
-					
+					
 				
 			
 		
@@ -1052,8 +1539,8 @@ The client subscription configuration that is used to control a clients use of s
 								
 							
 						
-						
-						
+						
+						
 					
 				
 			
@@ -1062,146 +1549,145 @@ The client subscription configuration that is used to control a clients use of s
 					
 				
 			
-			
-			
-			
+			
+			
+			
 				
 					
 				
 			
-			
-			
-			
-			
-			
-			
-			
-			
-			
-			
+			
+			
+			
+			
+			
+			
+			
+			
+			
+			
 				
 					
 				
 			
-			
+			
 				
 					
 				
 			
-			
+			
 				
 					
 				
 			
 		
 	
-	
-  	
-	    
-	      
+	
+		
+			
-	      
-	        
-	          
-	        
-	      
-	    
-	    
-	      
-	        
-	      
-	      
-	        
-	          
+				
+					
+				
+			
+		
+		
+			
+				
+			
+			
+				
+					
-	          
-	            
-	              
-	            
-	          
-	        
-	      
-	      
-	        
-	          
+						
+							
+						
+					
+				
+			
+			
+				
+					
-	          
-	            
-	              
-	            
-	          
-	        
-	      
-	      
-	        
-	          
+						
+							
+						
+					
+				
+			
+			
+				
+					
-	        
-	      
-		  
-			
-				
+			
+			
+				
+					
-			
-		  
-	    
-	  
-	
-	  
-	    
-	      
-	        
+			
+		
+	
+	
+	
+		
+			
+				
-	        
-	          
-	        
-	      
-	    
-	    
-	      
-	        
+					
+				
+			
+		
+		
+			
+				
-	      
-	    
-	    
-	      
-	        
+		
+		
+			
+				
-	      
-	    
-	    
-	      
-	        
+		
+		
+			
+				
-	      
-	    
-	    
-	      
-	        
+		
+		
+			
+				
-	      
-	    
-	    
+			
+		
 	
-	
+	
 	
 		
 			
 			
 				
-					
+					
 				
 			
 		
@@ -1217,7 +1703,7 @@ Defines a GemFire index.
 			
 				
 					
+The name of the index bean definition. If property 'name' is not set, it will be used as the index name as well.]]>
 				
 			
 			
@@ -1228,30 +1714,29 @@ The name of the bean index definition. If property 'name' is not set, it will be
 					
 				
 			
-			
+			
 				
 					
 				
 			
-			
-			
-			
-			
+			
+			
+			
+			
 				
 					
 				
 			
-			
-			
+			
 				
 					
 				
 			
-			
+			
 				
 					
 		
 	
-	
 	
 	
 		
 			
 				
 					
-						
+						
 					
 					
 					
@@ -1275,7 +1759,7 @@ The name of the pool used by the index. Used usually in client scenarios.
 			
 		
 	
-	
+	
 	
 		
 			
@@ -1284,17 +1768,18 @@ The name of the pool used by the index. Used usually in client scenarios.
 			
 		
 	
-	
+	
 	
 		
 			
 				
-					The reference to a GemfireTemplate. Will default to 'gemfireTemplate'.
-				
+                    The reference to a GemfireTemplate.
+                    Will default to 'gemfireTemplate'.
+                
 			
 		
 	
-	
+	
 	
 		
 			
@@ -1305,5 +1790,89 @@ The name of the pool used by the index. Used usually in client scenarios.
 		
 		
 	
-	
-
\ No newline at end of file
+	
+	
+		
+			
+    
+                    
+                
+            
+		
+		
+            
+                    
+                
+        
+		
+            
+                    
+                
+			
+				
+					
+					
+					
+					
+				
+			
+		
+		
+		
+		
+		
+		
+		
+		
+		
+		
+		
+		
+		
+		
+	
+	
+	
+		
+            
+                    
+                
+        
+		
+            
+                    
+                
+        
+	
+	
+	
+		
+			
+			
+			
+		
+	
+	
+	
+		
+			
+		
+		
+			
+			
+			
+		
+	
+
diff --git a/src/test/java/org/springframework/data/gemfire/CacheIntegrationTest.java b/src/test/java/org/springframework/data/gemfire/CacheIntegrationTest.java
index dd197edf..e43169d2 100644
--- a/src/test/java/org/springframework/data/gemfire/CacheIntegrationTest.java
+++ b/src/test/java/org/springframework/data/gemfire/CacheIntegrationTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010-2011 the original author or authors.
+ * Copyright 2010-2012 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.
@@ -16,7 +16,6 @@
 
 package org.springframework.data.gemfire;
 
-
 import junit.framework.Assert;
 
 import org.junit.Test;
@@ -24,9 +23,10 @@ import org.junit.Test;
 import com.gemstone.gemfire.cache.Cache;
 
 /**
- * Integration test trying various basic configurations of GemFire through Spring.
+ * Integration test trying various basic configurations of GemFire through
+ * Spring.
  * 
- * Made abstract to avoid multiple caches running at the same time. 
+ * Made abstract to avoid multiple caches running at the same time.
  * 
  * @author Costin Leau
  */
diff --git a/src/test/java/org/springframework/data/gemfire/DeclarableSupportTest.java b/src/test/java/org/springframework/data/gemfire/DeclarableSupportTest.java
index 618932e7..3997fd9c 100644
--- a/src/test/java/org/springframework/data/gemfire/DeclarableSupportTest.java
+++ b/src/test/java/org/springframework/data/gemfire/DeclarableSupportTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010-2011 the original author or authors.
+ * Copyright 2010-2012 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.
diff --git a/src/test/java/org/springframework/data/gemfire/ForkUtil.java b/src/test/java/org/springframework/data/gemfire/ForkUtil.java
index d00007a2..350d767e 100644
--- a/src/test/java/org/springframework/data/gemfire/ForkUtil.java
+++ b/src/test/java/org/springframework/data/gemfire/ForkUtil.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011 the original author or authors.
+ * Copyright 2011-2012 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.
diff --git a/src/test/java/org/springframework/data/gemfire/GemfireBeanFactoryLocatorTest.java b/src/test/java/org/springframework/data/gemfire/GemfireBeanFactoryLocatorTest.java
index 9e319e07..8629bb35 100644
--- a/src/test/java/org/springframework/data/gemfire/GemfireBeanFactoryLocatorTest.java
+++ b/src/test/java/org/springframework/data/gemfire/GemfireBeanFactoryLocatorTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010-2011 the original author or authors.
+ * Copyright 2010-2012 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.
diff --git a/src/test/java/org/springframework/data/gemfire/GemfireTemplateTest.java b/src/test/java/org/springframework/data/gemfire/GemfireTemplateTest.java
index 69f2665e..762e4a22 100644
--- a/src/test/java/org/springframework/data/gemfire/GemfireTemplateTest.java
+++ b/src/test/java/org/springframework/data/gemfire/GemfireTemplateTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011 the original author or authors.
+ * Copyright 2011-2012 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.
diff --git a/src/test/java/org/springframework/data/gemfire/Init.java b/src/test/java/org/springframework/data/gemfire/Init.java
index 7c873d6a..2d9c69ca 100644
--- a/src/test/java/org/springframework/data/gemfire/Init.java
+++ b/src/test/java/org/springframework/data/gemfire/Init.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011 the original author or authors.
+ * Copyright 2011-2012 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.
diff --git a/src/test/java/org/springframework/data/gemfire/RecreatingContextTest.java b/src/test/java/org/springframework/data/gemfire/RecreatingContextTest.java
index f2282dc1..8ffd4a61 100644
--- a/src/test/java/org/springframework/data/gemfire/RecreatingContextTest.java
+++ b/src/test/java/org/springframework/data/gemfire/RecreatingContextTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010-2011 the original author or authors.
+ * Copyright 2010-2012 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.
diff --git a/src/test/java/org/springframework/data/gemfire/SimpleCacheListener.java b/src/test/java/org/springframework/data/gemfire/SimpleCacheListener.java
index 76e6220d..c6c923d4 100644
--- a/src/test/java/org/springframework/data/gemfire/SimpleCacheListener.java
+++ b/src/test/java/org/springframework/data/gemfire/SimpleCacheListener.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010-2011 the original author or authors.
+ * Copyright 2010-2012 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.
diff --git a/src/test/java/org/springframework/data/gemfire/SimpleCacheLoader.java b/src/test/java/org/springframework/data/gemfire/SimpleCacheLoader.java
index 40df9573..0e174d0a 100644
--- a/src/test/java/org/springframework/data/gemfire/SimpleCacheLoader.java
+++ b/src/test/java/org/springframework/data/gemfire/SimpleCacheLoader.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010-2011 the original author or authors.
+ * Copyright 2010-2012 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.
diff --git a/src/test/java/org/springframework/data/gemfire/SimpleCacheWriter.java b/src/test/java/org/springframework/data/gemfire/SimpleCacheWriter.java
index 486af831..89642282 100644
--- a/src/test/java/org/springframework/data/gemfire/SimpleCacheWriter.java
+++ b/src/test/java/org/springframework/data/gemfire/SimpleCacheWriter.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010-2011 the original author or authors.
+ * Copyright 2010-2012 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.
diff --git a/src/test/java/org/springframework/data/gemfire/SimpleObjectSizer.java b/src/test/java/org/springframework/data/gemfire/SimpleObjectSizer.java
index d8c140e4..b1149704 100644
--- a/src/test/java/org/springframework/data/gemfire/SimpleObjectSizer.java
+++ b/src/test/java/org/springframework/data/gemfire/SimpleObjectSizer.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010-2011 the original author or authors.
+ * Copyright 2010-2012 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.
diff --git a/src/test/java/org/springframework/data/gemfire/SimplePartitionResolver.java b/src/test/java/org/springframework/data/gemfire/SimplePartitionResolver.java
index cf46a0c3..284a0dc8 100644
--- a/src/test/java/org/springframework/data/gemfire/SimplePartitionResolver.java
+++ b/src/test/java/org/springframework/data/gemfire/SimplePartitionResolver.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010-2011 the original author or authors.
+ * Copyright 2010-2012 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.
diff --git a/src/test/java/org/springframework/data/gemfire/SubRegionTest.java b/src/test/java/org/springframework/data/gemfire/SubRegionTest.java
new file mode 100644
index 00000000..c8d4e10c
--- /dev/null
+++ b/src/test/java/org/springframework/data/gemfire/SubRegionTest.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2010-2012 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;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertSame;
+
+import org.junit.Test;
+
+import com.gemstone.gemfire.cache.GemFireCache;
+import com.gemstone.gemfire.cache.Region;
+
+/**
+ * 
+ * @author David Turanski
+ * 
+ */
+public class SubRegionTest extends RecreatingContextTest {
+	@Override
+	protected String location() {
+		return "org/springframework/data/gemfire/basic-subregion.xml";
+	}
+
+	@SuppressWarnings({ "rawtypes", "unchecked" })
+	@Test
+	public void testBasic() throws Exception {
+		CacheFactoryBean cfb = new CacheFactoryBean();
+		cfb.setUseBeanFactoryLocator(false);
+		cfb.afterPropertiesSet();
+		GemFireCache cache = cfb.getObject();
+		RegionFactoryBean rfb = new ReplicatedRegionFactoryBean();
+		rfb.setCache(cache);
+		rfb.setName("parent");
+		rfb.afterPropertiesSet();
+		Region parent = rfb.getObject();
+
+		SubRegionFactoryBean srfb = new SubRegionFactoryBean();
+		srfb.setParent(parent);
+		srfb.setName("/parent/child");
+		srfb.setRegionName("child");
+		srfb.afterPropertiesSet();
+		Region child = srfb.getObject();
+
+		assertNotNull(parent.getSubregion("child"));
+		assertSame(child, parent.getSubregion("child"));
+
+		cache.close();
+	}
+
+	@SuppressWarnings("rawtypes")
+	@Test
+	public void testContext() throws Exception {
+		Region parent = ctx.getBean("parent", Region.class);
+		Region child = ctx.getBean("/parent/child", Region.class);
+		assertNotNull(parent.getSubregion("child"));
+		assertSame(child, parent.getSubregion("child"));
+		assertEquals("/parent/child", child.getFullPath());
+	}
+
+	@SuppressWarnings("rawtypes")
+	@Test
+	public void testChildOnly() throws Exception {
+		Region child = ctx.getBean("/parent/child", Region.class);
+		assertEquals("/parent/child", child.getFullPath());
+	}
+}
diff --git a/src/test/java/org/springframework/data/gemfire/TestUtils.java b/src/test/java/org/springframework/data/gemfire/TestUtils.java
index 39e615b9..25dbbde5 100644
--- a/src/test/java/org/springframework/data/gemfire/TestUtils.java
+++ b/src/test/java/org/springframework/data/gemfire/TestUtils.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010-2011 the original author or authors.
+ * Copyright 2010-2012 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.
diff --git a/src/test/java/org/springframework/data/gemfire/TxIntegrationTest.java b/src/test/java/org/springframework/data/gemfire/TxIntegrationTest.java
index 755eeae0..e6b8e3b6 100644
--- a/src/test/java/org/springframework/data/gemfire/TxIntegrationTest.java
+++ b/src/test/java/org/springframework/data/gemfire/TxIntegrationTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010-2011 the original author or authors.
+ * Copyright 2010-2012 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.
diff --git a/src/test/java/org/springframework/data/gemfire/UserObject.java b/src/test/java/org/springframework/data/gemfire/UserObject.java
index 59311c60..8f84a309 100644
--- a/src/test/java/org/springframework/data/gemfire/UserObject.java
+++ b/src/test/java/org/springframework/data/gemfire/UserObject.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010-2011 the original author or authors.
+ * Copyright 2010-2012 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.
diff --git a/src/test/java/org/springframework/data/gemfire/client/RegionIntegrationTest.java b/src/test/java/org/springframework/data/gemfire/client/RegionIntegrationTest.java
index 68e59c6e..97fb1adc 100644
--- a/src/test/java/org/springframework/data/gemfire/client/RegionIntegrationTest.java
+++ b/src/test/java/org/springframework/data/gemfire/client/RegionIntegrationTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010-2011 the original author or authors.
+ * Copyright 2010-2012 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.
diff --git a/src/test/java/org/springframework/data/gemfire/config/CacheNamespaceTest.java b/src/test/java/org/springframework/data/gemfire/config/CacheNamespaceTest.java
index 8b5b2ec5..5e75f95a 100644
--- a/src/test/java/org/springframework/data/gemfire/config/CacheNamespaceTest.java
+++ b/src/test/java/org/springframework/data/gemfire/config/CacheNamespaceTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010-2011 the original author or authors.
+ * Copyright 2010-2012 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.
@@ -16,8 +16,13 @@
 
 package org.springframework.data.gemfire.config;
 
-import static org.hamcrest.CoreMatchers.*;
-import static org.junit.Assert.*;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.nullValue;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
 
 import org.junit.Test;
 import org.springframework.core.io.Resource;
@@ -79,7 +84,8 @@ public class CacheNamespaceTest extends RecreatingContextTest {
 		try {
 			assertNotNull(locator.useBeanFactory("cache-with-name"));
 			locator.useBeanFactory("no-bl");
-		} finally {
+		}
+		finally {
 			locator.destroy();
 		}
 	}
@@ -99,4 +105,14 @@ public class CacheNamespaceTest extends RecreatingContextTest {
 		Resource res = TestUtils.readField("cacheXml", cfb);
 		assertEquals("gemfire-client-cache.xml", res.getFilename());
 	}
+
+	@Test
+	public void testHeapTunedCache() throws Exception {
+		assertTrue(ctx.containsBean("heap-tuned-cache"));
+		CacheFactoryBean cfb = (CacheFactoryBean) ctx.getBean("&heap-tuned-cache");
+		Float chp = (Float) TestUtils.readField("criticalHeapPercentage", cfb);
+		Float ehp = (Float) TestUtils.readField("evictionHeapPercentage", cfb);
+		assertEquals(70, chp, 0.0001);
+		assertEquals(60, ehp, 0.0001);
+	}
 }
\ No newline at end of file
diff --git a/src/test/java/org/springframework/data/gemfire/config/CacheServerNamespaceTest.java b/src/test/java/org/springframework/data/gemfire/config/CacheServerNamespaceTest.java
index 023d5750..13b12113 100644
--- a/src/test/java/org/springframework/data/gemfire/config/CacheServerNamespaceTest.java
+++ b/src/test/java/org/springframework/data/gemfire/config/CacheServerNamespaceTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011 the original author or authors.
+ * Copyright 2011-2012 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.
diff --git a/src/test/java/org/springframework/data/gemfire/config/ClientRegionNamespaceTest.java b/src/test/java/org/springframework/data/gemfire/config/ClientRegionNamespaceTest.java
index e7e4ae7e..57fac6a3 100644
--- a/src/test/java/org/springframework/data/gemfire/config/ClientRegionNamespaceTest.java
+++ b/src/test/java/org/springframework/data/gemfire/config/ClientRegionNamespaceTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010-2011 the original author or authors.
+ * Copyright 2010-2012 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.
@@ -21,8 +21,6 @@ import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertSame;
 import static org.junit.Assert.assertTrue;
 
-import java.io.File;
-
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -42,11 +40,13 @@ import com.gemstone.gemfire.cache.EvictionAction;
 import com.gemstone.gemfire.cache.EvictionAlgorithm;
 import com.gemstone.gemfire.cache.EvictionAttributes;
 import com.gemstone.gemfire.cache.InterestResultPolicy;
+import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.RegionAttributes;
 import com.gemstone.gemfire.cache.util.ObjectSizer;
 
 /**
  * @author Costin Leau
+ * @author David Turanski
  */
 @RunWith(SpringJUnit4ClassRunner.class)
 @ContextConfiguration("client-ns.xml")
@@ -72,7 +72,7 @@ public class ClientRegionNamespaceTest {
 		assertEquals(DataPolicy.EMPTY, TestUtils.readField("dataPolicy", fb));
 	}
 
-	//@Test
+	// @Test
 	public void testComplexClient() throws Exception {
 		assertTrue(context.containsBean("complex"));
 		ClientRegionFactoryBean fb = context.getBean("&complex", ClientRegionFactoryBean.class);
@@ -87,7 +87,8 @@ public class ClientRegionNamespaceTest {
 		Interest keyInt = ints[0];
 		assertTrue((Boolean) TestUtils.readField("durable", keyInt));
 		assertEquals(InterestResultPolicy.KEYS, TestUtils.readField("policy", keyInt));
-		//assertEquals(Object.class, TestUtils.readField("key", keyInt).getClass());
+		// assertEquals(Object.class, TestUtils.readField("key",
+		// keyInt).getClass());
 
 		// regex interest
 		RegexInterest regexInt = (RegexInterest) ints[1];
@@ -99,14 +100,10 @@ public class ClientRegionNamespaceTest {
 	@Test
 	public void testPersistent() throws Exception {
 		assertTrue(context.containsBean("persistent"));
-		ClientRegionFactoryBean fb = context.getBean("&persistent", ClientRegionFactoryBean.class);
-		assertEquals(DataPolicy.PERSISTENT_REPLICATE, TestUtils.readField("dataPolicy", fb));
-		RegionAttributes attrs = TestUtils.readField("attributes", fb);
-		File[] diskDirs = attrs.getDiskDirs();
-		assertEquals(1, diskDirs.length);
-		int[] diskDirSizes = attrs.getDiskDirSizes();
-		assertEquals(1, diskDirSizes.length);
-		assertEquals(1, diskDirSizes[0]);
+		Region region = context.getBean("persistent", Region.class);
+		RegionAttributes attrs = region.getAttributes();
+		assertEquals("diskStore", attrs.getDiskStoreName());
+		assertEquals(1, attrs.getDiskDirSizes()[0]);
 	}
 
 	@Test
@@ -116,10 +113,11 @@ public class ClientRegionNamespaceTest {
 		assertEquals(DataPolicy.NORMAL, TestUtils.readField("dataPolicy", fb));
 		RegionAttributes attrs = TestUtils.readField("attributes", fb);
 		EvictionAttributes evicAttr = attrs.getEvictionAttributes();
-		assertEquals(EvictionAction.LOCAL_DESTROY, evicAttr.getAction());
+		assertEquals(EvictionAction.OVERFLOW_TO_DISK, evicAttr.getAction());
 		assertEquals(EvictionAlgorithm.LRU_MEMORY, evicAttr.getAlgorithm());
-		// for some reason GemFire resets this to 56 on my machine (not sure why)
-		//assertEquals(10, evicAttr.getMaximum());
+		// for some reason GemFire resets this to 56 on my machine (not sure
+		// why)
+		// assertEquals(10, evicAttr.getMaximum());
 		ObjectSizer sizer = evicAttr.getObjectSizer();
 		assertEquals(SimpleObjectSizer.class, sizer.getClass());
 	}
diff --git a/src/test/java/org/springframework/data/gemfire/config/DiskStoreAndEvictionRegionParsingTest.java b/src/test/java/org/springframework/data/gemfire/config/DiskStoreAndEvictionRegionParsingTest.java
index c4e0bec8..df572f52 100644
--- a/src/test/java/org/springframework/data/gemfire/config/DiskStoreAndEvictionRegionParsingTest.java
+++ b/src/test/java/org/springframework/data/gemfire/config/DiskStoreAndEvictionRegionParsingTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010-2011 the original author or authors.
+ * Copyright 2010-2012 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.
@@ -18,26 +18,34 @@ package org.springframework.data.gemfire.config;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
 import static org.junit.Assert.assertTrue;
 
 import java.io.File;
 
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.ApplicationContext;
+import org.springframework.data.gemfire.PartitionedRegionFactoryBean;
 import org.springframework.data.gemfire.RegionFactoryBean;
+import org.springframework.data.gemfire.ReplicatedRegionFactoryBean;
 import org.springframework.data.gemfire.SimpleObjectSizer;
 import org.springframework.data.gemfire.TestUtils;
 import org.springframework.test.context.ContextConfiguration;
 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
 
-import com.gemstone.gemfire.cache.DataPolicy;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.DiskStore;
+import com.gemstone.gemfire.cache.DiskStoreFactory;
 import com.gemstone.gemfire.cache.EvictionAction;
 import com.gemstone.gemfire.cache.EvictionAlgorithm;
 import com.gemstone.gemfire.cache.EvictionAttributes;
 import com.gemstone.gemfire.cache.ExpirationAction;
 import com.gemstone.gemfire.cache.ExpirationAttributes;
+import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.RegionAttributes;
 import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.util.ObjectSizer;
@@ -52,20 +60,50 @@ public class DiskStoreAndEvictionRegionParsingTest {
 	@Autowired
 	private ApplicationContext context;
 
+	@Autowired
+	DiskStore diskStore1;
+
+	private static File diskStoreDir;
+
+	@BeforeClass
+	public static void setUp() {
+		String path = "./build/tmp";
+		diskStoreDir = new File(path);
+		if (!diskStoreDir.exists()) {
+			diskStoreDir.mkdir();
+		}
+	}
+
+	@AfterClass
+	public static void tearDown() {
+		for (File file : diskStoreDir.listFiles()) {
+			file.delete();
+		}
+		diskStoreDir.delete();
+	}
+
+	@Test
+	public void testDiskStore() {
+		assertEquals("diskStore1", diskStore1.getName());
+		assertEquals(50, diskStore1.getQueueSize());
+		assertEquals(true, diskStore1.getAutoCompact());
+		assertEquals(DiskStoreFactory.DEFAULT_COMPACTION_THRESHOLD, diskStore1.getCompactionThreshold());
+		assertEquals(9999, diskStore1.getTimeInterval());
+		assertEquals(10, diskStore1.getMaxOplogSize());
+		assertEquals(diskStoreDir, diskStore1.getDiskDirs()[0]);
+		Cache cache = context.getBean("gemfire-cache", Cache.class);
+		assertSame(diskStore1, cache.findDiskStore("diskStore1"));
+	}
+
 	@Test
 	public void testReplicaDataOptions() throws Exception {
 		assertTrue(context.containsBean("replicated-data"));
 		RegionFactoryBean fb = context.getBean("&replicated-data", RegionFactoryBean.class);
-		assertEquals(DataPolicy.PERSISTENT_REPLICATE, TestUtils.readField("dataPolicy", fb));
+		assertTrue(fb instanceof ReplicatedRegionFactoryBean);
 		assertEquals(Scope.DISTRIBUTED_ACK, TestUtils.readField("scope", fb));
-		RegionAttributes attrs = TestUtils.readField("attributes", fb);
-		File[] diskDirs = attrs.getDiskDirs();
-		assertEquals(1, diskDirs.length);
-		int[] diskDirSizes = attrs.getDiskDirSizes();
-		assertEquals(1, diskDirSizes.length);
-		assertEquals(1, diskDirSizes[0]);
-
+		Region region = context.getBean("replicated-data", Region.class);
 		// eviction tests
+		RegionAttributes attrs = TestUtils.readField("attributes", fb);
 		EvictionAttributes evicAttr = attrs.getEvictionAttributes();
 		assertEquals(EvictionAction.OVERFLOW_TO_DISK, evicAttr.getAction());
 		assertEquals(EvictionAlgorithm.LRU_ENTRY, evicAttr.getAlgorithm());
@@ -77,13 +115,16 @@ public class DiskStoreAndEvictionRegionParsingTest {
 	public void testPartitionDataOptions() throws Exception {
 		assertTrue(context.containsBean("partition-data"));
 		RegionFactoryBean fb = context.getBean("&partition-data", RegionFactoryBean.class);
-		assertEquals(DataPolicy.PARTITION, TestUtils.readField("dataPolicy", fb));
+		assertTrue(fb instanceof PartitionedRegionFactoryBean);
+		assertTrue((Boolean) TestUtils.readField("persistent", fb));
 		RegionAttributes attrs = TestUtils.readField("attributes", fb);
+
 		EvictionAttributes evicAttr = attrs.getEvictionAttributes();
 		assertEquals(EvictionAction.LOCAL_DESTROY, evicAttr.getAction());
 		assertEquals(EvictionAlgorithm.LRU_MEMORY, evicAttr.getAlgorithm());
-		// for some reason GemFire resets this to 56 on my machine (not sure why)
-		//assertEquals(10, evicAttr.getMaximum());
+		// for some reason GemFire resets this to 56 on my machine (not sure
+		// why)
+		// assertEquals(10, evicAttr.getMaximum());
 		ObjectSizer sizer = evicAttr.getObjectSizer();
 		assertEquals(SimpleObjectSizer.class, sizer.getClass());
 	}
@@ -109,6 +150,5 @@ public class DiskStoreAndEvictionRegionParsingTest {
 		ExpirationAttributes regionTTI = attrs.getRegionIdleTimeout();
 		assertEquals(400, regionTTI.getTimeout());
 		assertEquals(ExpirationAction.INVALIDATE, regionTTI.getAction());
-
 	}
 }
\ No newline at end of file
diff --git a/src/test/java/org/springframework/data/gemfire/config/DynamicRegionNamespaceTest.java b/src/test/java/org/springframework/data/gemfire/config/DynamicRegionNamespaceTest.java
new file mode 100644
index 00000000..9eee572c
--- /dev/null
+++ b/src/test/java/org/springframework/data/gemfire/config/DynamicRegionNamespaceTest.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2010-2012 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 static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+import org.springframework.data.gemfire.RecreatingContextTest;
+
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.DynamicRegionFactory;
+
+/**
+ * @author David Turanski
+ */
+public class DynamicRegionNamespaceTest extends RecreatingContextTest {
+
+	@Override
+	protected String location() {
+		return "org/springframework/data/gemfire/config/dynamic-region-ns.xml";
+	}
+
+	@Test
+	public void testBasicCache() throws Exception {
+		DynamicRegionFactory drf = DynamicRegionFactory.get();
+		assertFalse(drf.isOpen());
+		assertNull(drf.getConfig());
+		ctx.getBean("gemfire-cache", Cache.class);
+		assertTrue(drf.isOpen());
+		DynamicRegionFactory.Config config = drf.getConfig();
+		assertFalse(config.persistBackup);
+		assertFalse(config.registerInterest);
+		assertEquals("/foo", config.diskDir.getAbsolutePath());
+	}
+}
\ No newline at end of file
diff --git a/src/test/java/org/springframework/data/gemfire/config/IndexNamespaceTest.java b/src/test/java/org/springframework/data/gemfire/config/IndexNamespaceTest.java
index ecd60028..012c92bd 100644
--- a/src/test/java/org/springframework/data/gemfire/config/IndexNamespaceTest.java
+++ b/src/test/java/org/springframework/data/gemfire/config/IndexNamespaceTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011 the original author or authors.
+ * Copyright 2011-2012 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.
diff --git a/src/test/java/org/springframework/data/gemfire/config/JndiBindingsTest.java b/src/test/java/org/springframework/data/gemfire/config/JndiBindingsTest.java
new file mode 100644
index 00000000..153bc962
--- /dev/null
+++ b/src/test/java/org/springframework/data/gemfire/config/JndiBindingsTest.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2010-2012 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 static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import org.junit.Test;
+import org.springframework.data.gemfire.RecreatingContextTest;
+
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.internal.datasource.GemFireBasicDataSource;
+
+/**
+ * @author David Turanski
+ * 
+ */
+public class JndiBindingsTest extends RecreatingContextTest {
+
+	@Override
+	protected String location() {
+		return "org/springframework/data/gemfire/config/jndi-binding-ns.xml";
+	}
+
+	@Test
+	public void testJndiBindings() throws Exception {
+		Cache cache = ctx.getBean("gemfire-cache", Cache.class);
+		assertNotNull(cache.getJNDIContext().lookup("java:/SimpleDataSource"));
+		GemFireBasicDataSource ds = (GemFireBasicDataSource) cache.getJNDIContext().lookup("java:/SimpleDataSource");
+		assertEquals("org.apache.derby.jdbc.EmbeddedDriver", ds.getJDBCDriver());
+		assertEquals(60, ds.getLoginTimeout());
+	}
+}
diff --git a/src/test/java/org/springframework/data/gemfire/config/LocalRegionNamespaceTest.java b/src/test/java/org/springframework/data/gemfire/config/LocalRegionNamespaceTest.java
new file mode 100644
index 00000000..d646e752
--- /dev/null
+++ b/src/test/java/org/springframework/data/gemfire/config/LocalRegionNamespaceTest.java
@@ -0,0 +1,102 @@
+/*
+ * Copyright 2010-2012 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 static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.ApplicationContext;
+import org.springframework.data.gemfire.RegionFactoryBean;
+import org.springframework.data.gemfire.RegionLookupFactoryBean;
+import org.springframework.data.gemfire.TestUtils;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+import org.springframework.util.ObjectUtils;
+
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheListener;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+import com.gemstone.gemfire.cache.Scope;
+
+/**
+ * @author Costin Leau
+ */
+@RunWith(SpringJUnit4ClassRunner.class)
+@ContextConfiguration("local-ns.xml")
+public class LocalRegionNamespaceTest {
+
+	@Autowired
+	private ApplicationContext context;
+
+	@Test
+	public void testBasicLocal() throws Exception {
+		assertTrue(context.containsBean("simple"));
+	}
+
+	@Test
+	public void testPublishingLocal() throws Exception {
+		assertTrue(context.containsBean("pub"));
+		RegionFactoryBean fb = context.getBean("&pub", RegionFactoryBean.class);
+		assertEquals("NORMAL", TestUtils.readField("dataPolicyName", fb));
+		assertEquals(Scope.LOCAL, TestUtils.readField("scope", fb));
+		assertEquals("publisher", TestUtils.readField("name", fb));
+		RegionAttributes attrs = TestUtils.readField("attributes", fb);
+		assertFalse(attrs.getPublisher());
+	}
+
+	@Test
+	public void testComplexLocal() throws Exception {
+		assertTrue(context.containsBean("complex"));
+		RegionFactoryBean fb = context.getBean("&complex", RegionFactoryBean.class);
+		CacheListener[] listeners = TestUtils.readField("cacheListeners", fb);
+		assertFalse(ObjectUtils.isEmpty(listeners));
+		assertEquals(2, listeners.length);
+		assertSame(listeners[0], context.getBean("c-listener"));
+
+		assertSame(context.getBean("c-loader"), TestUtils.readField("cacheLoader", fb));
+		assertSame(context.getBean("c-writer"), TestUtils.readField("cacheWriter", fb));
+	}
+
+	@Test
+	public void testLocalWithAttributes() throws Exception {
+		assertTrue(context.containsBean("local-with-attributes"));
+		Region region = context.getBean("local-with-attributes", Region.class);
+		RegionAttributes attrs = region.getAttributes();
+		assertEquals(10, attrs.getInitialCapacity());
+		assertEquals(true, attrs.getIgnoreJTA());
+		assertEquals(false, attrs.getIndexMaintenanceSynchronous());
+		assertEquals(String.class, attrs.getKeyConstraint());
+		assertEquals(String.class, attrs.getValueConstraint());
+		assertEquals(true, attrs.isDiskSynchronous());
+	}
+
+	@Test
+	public void testRegionLookup() throws Exception {
+		Cache cache = context.getBean(Cache.class);
+		Region existing = cache.createRegionFactory().create("existing");
+		assertTrue(context.containsBean("lookup"));
+		RegionLookupFactoryBean lfb = context.getBean("&lookup", RegionLookupFactoryBean.class);
+		assertEquals("existing", TestUtils.readField("name", lfb));
+		assertEquals(existing, context.getBean("lookup"));
+	}
+}
\ No newline at end of file
diff --git a/src/test/java/org/springframework/data/gemfire/config/MembershipAttributesTest.java b/src/test/java/org/springframework/data/gemfire/config/MembershipAttributesTest.java
new file mode 100644
index 00000000..240340a8
--- /dev/null
+++ b/src/test/java/org/springframework/data/gemfire/config/MembershipAttributesTest.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2010-2012 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 static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+import org.springframework.data.gemfire.RecreatingContextTest;
+
+import com.gemstone.gemfire.cache.LossAction;
+import com.gemstone.gemfire.cache.MembershipAttributes;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.ResumptionAction;
+import com.gemstone.gemfire.distributed.Role;
+
+/**
+ * @author David Turanski
+ * 
+ */
+public class MembershipAttributesTest extends RecreatingContextTest {
+
+	@Override
+	protected String location() {
+		return "org/springframework/data/gemfire/config/membership-attributes-ns.xml";
+	}
+
+	@Test
+	public void testMembershipAttributes() {
+		Region simple = ctx.getBean("simple", Region.class);
+		MembershipAttributes ma = simple.getAttributes().getMembershipAttributes();
+		assertFalse(ma.hasRequiredRoles());
+
+		Region secure = ctx.getBean("secure", Region.class);
+		ma = secure.getAttributes().getMembershipAttributes();
+		assertTrue(ma.hasRequiredRoles());
+		assertEquals(ResumptionAction.REINITIALIZE, ma.getResumptionAction());
+		assertEquals(LossAction.LIMITED_ACCESS, ma.getLossAction());
+		for (Role role : ma.getRequiredRoles()) {
+			assertTrue("ROLE1".equals(role.getName()) || "ROLE2".equals(role.getName()));
+		}
+	}
+}
diff --git a/src/test/java/org/springframework/data/gemfire/config/PartitionedRegionNamespaceTest.java b/src/test/java/org/springframework/data/gemfire/config/PartitionedRegionNamespaceTest.java
index 15b6624b..e4056f79 100644
--- a/src/test/java/org/springframework/data/gemfire/config/PartitionedRegionNamespaceTest.java
+++ b/src/test/java/org/springframework/data/gemfire/config/PartitionedRegionNamespaceTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010-2011 the original author or authors.
+ * Copyright 2010-2012 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.
@@ -25,6 +25,7 @@ import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.ApplicationContext;
+import org.springframework.data.gemfire.PartitionedRegionFactoryBean;
 import org.springframework.data.gemfire.RegionFactoryBean;
 import org.springframework.data.gemfire.SimplePartitionResolver;
 import org.springframework.data.gemfire.TestUtils;
@@ -33,7 +34,6 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
 import org.springframework.util.ObjectUtils;
 
 import com.gemstone.gemfire.cache.CacheListener;
-import com.gemstone.gemfire.cache.DataPolicy;
 import com.gemstone.gemfire.cache.PartitionAttributes;
 import com.gemstone.gemfire.cache.RegionAttributes;
 
@@ -48,7 +48,7 @@ public class PartitionedRegionNamespaceTest {
 	private ApplicationContext context;
 
 	@Test
-	public void testBasicReplica() throws Exception {
+	public void testBasicPartition() throws Exception {
 		assertTrue(context.containsBean("simple"));
 	}
 
@@ -56,7 +56,7 @@ public class PartitionedRegionNamespaceTest {
 	public void testPartitionOptions() throws Exception {
 		assertTrue(context.containsBean("options"));
 		RegionFactoryBean fb = context.getBean("&options", RegionFactoryBean.class);
-		assertEquals(DataPolicy.PARTITION, TestUtils.readField("dataPolicy", fb));
+		assertTrue(fb instanceof PartitionedRegionFactoryBean);
 		assertEquals(null, TestUtils.readField("scope", fb));
 		assertEquals("redundant", TestUtils.readField("name", fb));
 
diff --git a/src/test/java/org/springframework/data/gemfire/config/PoolNamespaceTest.java b/src/test/java/org/springframework/data/gemfire/config/PoolNamespaceTest.java
index f0719580..cd11c51a 100644
--- a/src/test/java/org/springframework/data/gemfire/config/PoolNamespaceTest.java
+++ b/src/test/java/org/springframework/data/gemfire/config/PoolNamespaceTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010-2011 the original author or authors.
+ * Copyright 2010-2012 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.
diff --git a/src/test/java/org/springframework/data/gemfire/config/ReplicatedRegionNamespaceTest.java b/src/test/java/org/springframework/data/gemfire/config/ReplicatedRegionNamespaceTest.java
index 56eaf569..0184f1d9 100644
--- a/src/test/java/org/springframework/data/gemfire/config/ReplicatedRegionNamespaceTest.java
+++ b/src/test/java/org/springframework/data/gemfire/config/ReplicatedRegionNamespaceTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010-2011 the original author or authors.
+ * Copyright 2010-2012 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.
@@ -27,6 +27,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.ApplicationContext;
 import org.springframework.data.gemfire.RegionFactoryBean;
 import org.springframework.data.gemfire.RegionLookupFactoryBean;
+import org.springframework.data.gemfire.ReplicatedRegionFactoryBean;
 import org.springframework.data.gemfire.TestUtils;
 import org.springframework.test.context.ContextConfiguration;
 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@@ -34,7 +35,6 @@ import org.springframework.util.ObjectUtils;
 
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.CacheListener;
-import com.gemstone.gemfire.cache.DataPolicy;
 import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.RegionAttributes;
 import com.gemstone.gemfire.cache.Scope;
@@ -58,7 +58,7 @@ public class ReplicatedRegionNamespaceTest {
 	public void testPublishingReplica() throws Exception {
 		assertTrue(context.containsBean("pub"));
 		RegionFactoryBean fb = context.getBean("&pub", RegionFactoryBean.class);
-		assertEquals(DataPolicy.REPLICATE, TestUtils.readField("dataPolicy", fb));
+		assertTrue(fb instanceof ReplicatedRegionFactoryBean);
 		assertEquals(Scope.DISTRIBUTED_ACK, TestUtils.readField("scope", fb));
 		assertEquals("publisher", TestUtils.readField("name", fb));
 		RegionAttributes attrs = TestUtils.readField("attributes", fb);
@@ -78,6 +78,27 @@ public class ReplicatedRegionNamespaceTest {
 		assertSame(context.getBean("c-writer"), TestUtils.readField("cacheWriter", fb));
 	}
 
+	@Test
+	public void testReplicaWithAttributes() throws Exception {
+		assertTrue(context.containsBean("replicated-with-attributes"));
+		Region region = context.getBean("replicated-with-attributes", Region.class);
+		RegionAttributes attrs = region.getAttributes();
+		assertEquals(10, attrs.getInitialCapacity());
+		assertEquals(true, attrs.getIgnoreJTA());
+		assertEquals(false, attrs.getIndexMaintenanceSynchronous());
+		assertEquals(String.class, attrs.getKeyConstraint());
+		assertEquals(String.class, attrs.getValueConstraint());
+		assertEquals(true, attrs.isDiskSynchronous());
+		assertEquals(Scope.GLOBAL, attrs.getScope());
+		assertEquals(true, attrs.isLockGrantor());
+		assertEquals(true, attrs.getEnableAsyncConflation());
+		assertEquals(true, attrs.getEnableSubscriptionConflation());
+		assertEquals(0.50, attrs.getLoadFactor(), 0.001);
+		assertEquals(false, attrs.getCloningEnabled());
+		assertEquals(10, attrs.getConcurrencyLevel());
+		assertEquals(true, attrs.getMulticastEnabled());
+	}
+
 	@Test
 	public void testRegionLookup() throws Exception {
 		Cache cache = context.getBean(Cache.class);
diff --git a/src/test/java/org/springframework/data/gemfire/config/SubRegionNamespaceTest.java b/src/test/java/org/springframework/data/gemfire/config/SubRegionNamespaceTest.java
new file mode 100644
index 00000000..dc7b8c67
--- /dev/null
+++ b/src/test/java/org/springframework/data/gemfire/config/SubRegionNamespaceTest.java
@@ -0,0 +1,114 @@
+/*
+ * Copyright 2010-2012 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 static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertSame;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.ApplicationContext;
+import org.springframework.data.gemfire.SubRegionFactoryBean;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+
+import com.gemstone.gemfire.cache.AttributesFactory;
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.CacheLoader;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionAttributes;
+
+/**
+ * @author David Turanski
+ */
+@SuppressWarnings("deprecation")
+@RunWith(SpringJUnit4ClassRunner.class)
+@ContextConfiguration("subregion-ns.xml")
+public class SubRegionNamespaceTest {
+
+	@Autowired
+	private ApplicationContext context;
+
+	 
+	
+	@SuppressWarnings("rawtypes")
+	@Test
+	public void testNestedReplicatedRegions() {
+		Region parent = context.getBean("parent",Region.class);
+		Region child = context.getBean("/parent/child", Region.class);
+		Region grandchild = context.getBean("/parent/child/grandchild", Region.class);
+		assertNotNull(child);
+		assertEquals("/parent/child",child.getFullPath());
+		assertSame(child,parent.getSubregion("child"));
+		
+		assertEquals("/parent/child/grandchild",grandchild.getFullPath());
+		assertSame(grandchild,child.getSubregion("grandchild"));
+		
+	}
+	
+	@SuppressWarnings({ "unused", "rawtypes", "unchecked" })
+	@Test
+	public void testMixedNestedRegions() {
+		Cache cache = context.getBean(Cache.class);
+		
+		Region parent = context.getBean("replicatedParent",Region.class);
+		parent.createSubregion("lookupChild",new AttributesFactory().create());
+		
+		Region child = context.getBean("/replicatedParent/lookupChild", Region.class);
+		Region grandchild = context.getBean("/replicatedParent/lookupChild/partitionedGrandchild", Region.class);
+		assertNotNull(child);
+		assertEquals("/replicatedParent/lookupChild",child.getFullPath());
+		assertSame(child,parent.getSubregion("lookupChild"));
+		
+		assertEquals("/replicatedParent/lookupChild/partitionedGrandchild",grandchild.getFullPath());
+		assertSame(grandchild,child.getSubregion("partitionedGrandchild"));
+		
+	}
+	
+	@SuppressWarnings("rawtypes")
+	@Test
+	public void testNestedRegionsWithSiblings() {
+		Region parent = context.getBean("parentWithSiblings",Region.class);
+		Region child1 = context.getBean("/parentWithSiblings/child1",Region.class);
+		assertEquals("/parentWithSiblings/child1",child1.getFullPath());
+		Region child2 = context.getBean("/parentWithSiblings/child2",Region.class);
+		assertEquals("/parentWithSiblings/child2",child2.getFullPath());
+		assertSame(child1,parent.getSubregion("child1"));
+		assertSame(child2,parent.getSubregion("child2"));
+		
+		Region grandchild1 = context.getBean("/parentWithSiblings/child1/grandChild11",Region.class);
+		assertEquals("/parentWithSiblings/child1/grandChild11",grandchild1.getFullPath());
+	}
+	
+	@SuppressWarnings({ "unused", "rawtypes" })
+	@Test
+	public void testComplexNestedRegions() throws Exception {
+		Region parent = context.getBean("complexNested",Region.class);
+		Region child1 = context.getBean("/complexNested/child1",Region.class);
+		Region child2 = context.getBean("/complexNested/child2",Region.class);
+		Region grandchild1 = context.getBean("/complexNested/child1/grandChild11",Region.class);	
+		
+		SubRegionFactoryBean grandchild1fb = context.getBean("&/complexNested/child1/grandChild11",SubRegionFactoryBean.class);	
+		assertNotNull(grandchild1fb);
+		RegionAttributes attr =  grandchild1fb.create();
+		assertNotNull(attr);
+		CacheLoader cl = attr.getCacheLoader();
+		assertNotNull(cl);
+	}
+}
\ No newline at end of file
diff --git a/src/test/java/org/springframework/data/gemfire/config/TxEventHandlersTest.java b/src/test/java/org/springframework/data/gemfire/config/TxEventHandlersTest.java
new file mode 100644
index 00000000..618c5cf1
--- /dev/null
+++ b/src/test/java/org/springframework/data/gemfire/config/TxEventHandlersTest.java
@@ -0,0 +1,133 @@
+/*
+ * Copyright 2010-2012 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 static org.junit.Assert.assertEquals;
+
+import javax.annotation.Resource;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.BeanNameAware;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.TransactionEvent;
+import com.gemstone.gemfire.cache.TransactionListener;
+import com.gemstone.gemfire.cache.TransactionWriter;
+import com.gemstone.gemfire.cache.TransactionWriterException;
+
+/**
+ * @author David Turanski
+ * 
+ */
+@RunWith(SpringJUnit4ClassRunner.class)
+@ContextConfiguration("tx-listeners-and-writers.xml")
+public class TxEventHandlersTest {
+	@Autowired
+	TestListener txListener1;
+
+	@Autowired
+	TestListener txListener2;
+
+	@Autowired
+	TestWriter txWriter;
+
+	@Resource(name = "gemfire-cache")
+	Cache cache;
+
+	@Resource(name = "local")
+	Region local;
+
+	@Test
+	public void test() throws Exception {
+		cache.getCacheTransactionManager().begin();
+		local.put("hello", "world");
+		cache.getCacheTransactionManager().commit();
+		assertEquals("txListener1", txListener1.value);
+		assertEquals("txListener2", txListener2.value);
+		assertEquals("txWriter", txWriter.value);
+
+	}
+
+	public static class TestListener implements TransactionListener, BeanNameAware {
+
+		private String name;
+
+		public String value;
+
+		public boolean closed;
+
+		public boolean afterCommit;
+
+		@Override
+		public void close() {
+			closed = true;
+
+		}
+
+		@Override
+		public void afterCommit(TransactionEvent arg0) {
+			afterCommit = true;
+			value = name;
+		}
+
+		@Override
+		public void afterFailedCommit(TransactionEvent arg0) {
+			// TODO Auto-generated method stub
+
+		}
+
+		@Override
+		public void afterRollback(TransactionEvent arg0) {
+			// TODO Auto-generated method stub
+
+		}
+
+		@Override
+		public void setBeanName(String name) {
+			this.name = name;
+		};
+	}
+
+	public static class TestWriter implements TransactionWriter, BeanNameAware {
+
+		private String name;
+
+		public String value;
+
+		@Override
+		public void close() {
+			// TODO Auto-generated method stub
+
+		}
+
+		@Override
+		public void beforeCommit(TransactionEvent arg0) throws TransactionWriterException {
+			this.value = name;
+
+		}
+
+		@Override
+		public void setBeanName(String name) {
+			this.name = name;
+		};
+
+	}
+}
diff --git a/src/test/java/org/springframework/data/gemfire/config/TxManagerNamespaceTest.java b/src/test/java/org/springframework/data/gemfire/config/TxManagerNamespaceTest.java
index f6d1e4a6..babb5c3f 100644
--- a/src/test/java/org/springframework/data/gemfire/config/TxManagerNamespaceTest.java
+++ b/src/test/java/org/springframework/data/gemfire/config/TxManagerNamespaceTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010-2011 the original author or authors.
+ * Copyright 2010-2012 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.
diff --git a/src/test/java/org/springframework/data/gemfire/fork/CacheServerProcess.java b/src/test/java/org/springframework/data/gemfire/fork/CacheServerProcess.java
index 76ff596b..3f5bfbc7 100644
--- a/src/test/java/org/springframework/data/gemfire/fork/CacheServerProcess.java
+++ b/src/test/java/org/springframework/data/gemfire/fork/CacheServerProcess.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011 the original author or authors.
+ * Copyright 2011-2012 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.
diff --git a/src/test/java/org/springframework/data/gemfire/listener/GemfireMDP.java b/src/test/java/org/springframework/data/gemfire/listener/GemfireMDP.java
index f64cec97..0dbf6372 100644
--- a/src/test/java/org/springframework/data/gemfire/listener/GemfireMDP.java
+++ b/src/test/java/org/springframework/data/gemfire/listener/GemfireMDP.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011 the original author or authors.
+ * Copyright 2011-2012 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.
diff --git a/src/test/java/org/springframework/data/gemfire/listener/ListenerContainerTests.java b/src/test/java/org/springframework/data/gemfire/listener/ListenerContainerTests.java
index 5344de04..24969471 100644
--- a/src/test/java/org/springframework/data/gemfire/listener/ListenerContainerTests.java
+++ b/src/test/java/org/springframework/data/gemfire/listener/ListenerContainerTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011 the original author or authors.
+ * Copyright 2011-2012 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.
diff --git a/src/test/java/org/springframework/data/gemfire/listener/StubErrorHandler.java b/src/test/java/org/springframework/data/gemfire/listener/StubErrorHandler.java
index 7aad6baf..65bbe67c 100644
--- a/src/test/java/org/springframework/data/gemfire/listener/StubErrorHandler.java
+++ b/src/test/java/org/springframework/data/gemfire/listener/StubErrorHandler.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011 the original author or authors.
+ * Copyright 2011-2012 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.
diff --git a/src/test/java/org/springframework/data/gemfire/listener/ThrowableEventListener.java b/src/test/java/org/springframework/data/gemfire/listener/ThrowableEventListener.java
index 19e8f405..3c4daf50 100644
--- a/src/test/java/org/springframework/data/gemfire/listener/ThrowableEventListener.java
+++ b/src/test/java/org/springframework/data/gemfire/listener/ThrowableEventListener.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011 the original author or authors.
+ * Copyright 2011-2012 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.
diff --git a/src/test/java/org/springframework/data/gemfire/listener/adapter/ContainerXmlSetupTest.java b/src/test/java/org/springframework/data/gemfire/listener/adapter/ContainerXmlSetupTest.java
index 8fee892d..e9743c4b 100644
--- a/src/test/java/org/springframework/data/gemfire/listener/adapter/ContainerXmlSetupTest.java
+++ b/src/test/java/org/springframework/data/gemfire/listener/adapter/ContainerXmlSetupTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011 the original author or authors.
+ * Copyright 2011-2012 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.
diff --git a/src/test/java/org/springframework/data/gemfire/listener/adapter/QueryListenerAdapterTest.java b/src/test/java/org/springframework/data/gemfire/listener/adapter/QueryListenerAdapterTest.java
index a3126ce4..b5d5c964 100644
--- a/src/test/java/org/springframework/data/gemfire/listener/adapter/QueryListenerAdapterTest.java
+++ b/src/test/java/org/springframework/data/gemfire/listener/adapter/QueryListenerAdapterTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011-2012 the original author or authors.
+ * Copyright 2011-2012-2012 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.
diff --git a/src/test/java/org/springframework/data/gemfire/serialization/AsmInstantiatorFactoryTest.java b/src/test/java/org/springframework/data/gemfire/serialization/AsmInstantiatorFactoryTest.java
index aac59925..0e7c80aa 100644
--- a/src/test/java/org/springframework/data/gemfire/serialization/AsmInstantiatorFactoryTest.java
+++ b/src/test/java/org/springframework/data/gemfire/serialization/AsmInstantiatorFactoryTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010-2011 the original author or authors.
+ * Copyright 2010-2012 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.
diff --git a/src/test/java/org/springframework/data/gemfire/serialization/WiringInstantiatorTest.java b/src/test/java/org/springframework/data/gemfire/serialization/WiringInstantiatorTest.java
index 8d09482c..cf1ce7db 100644
--- a/src/test/java/org/springframework/data/gemfire/serialization/WiringInstantiatorTest.java
+++ b/src/test/java/org/springframework/data/gemfire/serialization/WiringInstantiatorTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010-2011 the original author or authors.
+ * Copyright 2010-2012 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.
diff --git a/src/test/java/org/springframework/data/gemfire/support/GemfireDaoSupportTests.java b/src/test/java/org/springframework/data/gemfire/support/GemfireDaoSupportTests.java
index 5b369dda..2a7b8537 100644
--- a/src/test/java/org/springframework/data/gemfire/support/GemfireDaoSupportTests.java
+++ b/src/test/java/org/springframework/data/gemfire/support/GemfireDaoSupportTests.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2011 the original author or authors.
+ * Copyright 2011-2012 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.
diff --git a/src/test/resources/log4j.properties b/src/test/resources/log4j.properties
index 5b8659e2..bdaf64ef 100644
--- a/src/test/resources/log4j.properties
+++ b/src/test/resources/log4j.properties
@@ -5,7 +5,8 @@ log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
 log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n
 
 log4j.category.org.springframework.data.gemfire.listener=TRACE
-log4j.category.org.springframework.data.gemfire.repository=DEBUG
+log4j.category.org.springframework.data.gemfire=DEBUG
+log4j.category.org.springframework.beans.=DEBUG
 
 # for debugging datasource initialization
 # log4j.category.test.jdbc=DEBUG
diff --git a/src/test/resources/org/springframework/data/gemfire/basic-subregion.xml b/src/test/resources/org/springframework/data/gemfire/basic-subregion.xml
new file mode 100644
index 00000000..ad750a24
--- /dev/null
+++ b/src/test/resources/org/springframework/data/gemfire/basic-subregion.xml
@@ -0,0 +1,18 @@
+
+
+
+	
+    
+    
+    
+        
+        
+    	
+     
+
diff --git a/src/test/resources/org/springframework/data/gemfire/basic-tx-config.xml b/src/test/resources/org/springframework/data/gemfire/basic-tx-config.xml
index 467e5aba..c7ed983f 100644
--- a/src/test/resources/org/springframework/data/gemfire/basic-tx-config.xml
+++ b/src/test/resources/org/springframework/data/gemfire/basic-tx-config.xml
@@ -8,7 +8,7 @@
 	
 	
 	
-	
-	
+	
+	
 	
 
diff --git a/src/test/resources/org/springframework/data/gemfire/client/basic-region.xml b/src/test/resources/org/springframework/data/gemfire/client/basic-region.xml
index 11ad80ed..367acbcb 100644
--- a/src/test/resources/org/springframework/data/gemfire/client/basic-region.xml
+++ b/src/test/resources/org/springframework/data/gemfire/client/basic-region.xml
@@ -14,12 +14,12 @@
 		
 	
 	
-	
+	
 	
 	
-	
+	
 	
-	
+	
 		
 			
 				
@@ -48,7 +48,7 @@
 	
 	
 	
-	
+	
 		
 			
 				
diff --git a/src/test/resources/org/springframework/data/gemfire/config/cache-ns.xml b/src/test/resources/org/springframework/data/gemfire/config/cache-ns.xml
index 75700484..fbe5d6ce 100644
--- a/src/test/resources/org/springframework/data/gemfire/config/cache-ns.xml
+++ b/src/test/resources/org/springframework/data/gemfire/config/cache-ns.xml
@@ -27,4 +27,6 @@
 	
 	
 	
+
+    
 
\ No newline at end of file
diff --git a/src/test/resources/org/springframework/data/gemfire/config/client-ns.xml b/src/test/resources/org/springframework/data/gemfire/config/client-ns.xml
index f2a229e8..e8b675c9 100644
--- a/src/test/resources/org/springframework/data/gemfire/config/client-ns.xml
+++ b/src/test/resources/org/springframework/data/gemfire/config/client-ns.xml
@@ -32,18 +32,14 @@
 		
 	
 
-	
-		
-			
-		
-	
+	
+ 
+     
+            
+     
 	
-	
-		
-			
-		
-
-		
+	
+		
 			
 				
 			
diff --git a/src/test/resources/org/springframework/data/gemfire/config/diskstore-ns.xml b/src/test/resources/org/springframework/data/gemfire/config/diskstore-ns.xml
index a91f7f85..b9941aae 100644
--- a/src/test/resources/org/springframework/data/gemfire/config/diskstore-ns.xml
+++ b/src/test/resources/org/springframework/data/gemfire/config/diskstore-ns.xml
@@ -10,44 +10,48 @@
 		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
 		http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
 
-	 
-       300
-     
-
+    
+    
+        ./build/tmp
+        50
+        true
+        10
+        9999
+        1
+        300
+    
+    
     
-    
-		
-	
-    
-    
-        
-    
-	
-	
-		
-			
-		
 
+    
+        
+    
+ 
+
+
+
+	
+	
 		
 		
 
 		
 		
 		
-		
+		
 	
  	
- 	
-	
-		
-			
-		 
-
+	
 		
 			
 				
 			
 		
 	
-	
+    
+        
+            
+    
+ 
 
\ No newline at end of file
diff --git a/src/test/resources/org/springframework/data/gemfire/config/dynamic-region-ns.xml b/src/test/resources/org/springframework/data/gemfire/config/dynamic-region-ns.xml
new file mode 100644
index 00000000..7e343493
--- /dev/null
+++ b/src/test/resources/org/springframework/data/gemfire/config/dynamic-region-ns.xml
@@ -0,0 +1,15 @@
+
+
+
+	
+        
+    
+
\ No newline at end of file
diff --git a/src/test/resources/org/springframework/data/gemfire/config/jndi-binding-ns.xml b/src/test/resources/org/springframework/data/gemfire/config/jndi-binding-ns.xml
new file mode 100644
index 00000000..547bbac5
--- /dev/null
+++ b/src/test/resources/org/springframework/data/gemfire/config/jndi-binding-ns.xml
@@ -0,0 +1,29 @@
+
+
+
+	
+    
+            hi
+            newDB
+         
+    
+
\ No newline at end of file
diff --git a/src/test/resources/org/springframework/data/gemfire/config/local-ns.xml b/src/test/resources/org/springframework/data/gemfire/config/local-ns.xml
new file mode 100644
index 00000000..e3656389
--- /dev/null
+++ b/src/test/resources/org/springframework/data/gemfire/config/local-ns.xml
@@ -0,0 +1,41 @@
+
+
+
+	
+	
+	
+	
+	
+	
+	
+		
+			
+			
+		
+		
+		
+	
+    
+    
+	
+	
+	
+	
+	
+	
+
\ No newline at end of file
diff --git a/src/test/resources/org/springframework/data/gemfire/config/membership-attributes-ns.xml b/src/test/resources/org/springframework/data/gemfire/config/membership-attributes-ns.xml
new file mode 100644
index 00000000..3eba8ee3
--- /dev/null
+++ b/src/test/resources/org/springframework/data/gemfire/config/membership-attributes-ns.xml
@@ -0,0 +1,21 @@
+
+
+
+	
+	
+	
+        
+    
+
+    
+
\ No newline at end of file
diff --git a/src/test/resources/org/springframework/data/gemfire/config/replicated-ns.xml b/src/test/resources/org/springframework/data/gemfire/config/replicated-ns.xml
index 3fe3436a..e8c5ce65 100644
--- a/src/test/resources/org/springframework/data/gemfire/config/replicated-ns.xml
+++ b/src/test/resources/org/springframework/data/gemfire/config/replicated-ns.xml
@@ -23,6 +23,23 @@
 		
 	
 	
+    
+    
 	
 	
 	
diff --git a/src/test/resources/org/springframework/data/gemfire/config/subregion-ns.xml b/src/test/resources/org/springframework/data/gemfire/config/subregion-ns.xml
new file mode 100644
index 00000000..d0803639
--- /dev/null
+++ b/src/test/resources/org/springframework/data/gemfire/config/subregion-ns.xml
@@ -0,0 +1,50 @@
+
+
+	
+    
+    
+        
+             
+        
+    
+    
+    
+     
+        
+            
+        
+    
+    
+     
+        
+            
+             
+        
+        
+    
+    
+     
+       
+        
+            
+                
+            
+             
+        
+        
+            
+        
+    
+    
+    
+    
+    
+    
+
\ No newline at end of file
diff --git a/src/test/resources/org/springframework/data/gemfire/config/tx-listeners-and-writers.xml b/src/test/resources/org/springframework/data/gemfire/config/tx-listeners-and-writers.xml
new file mode 100644
index 00000000..91a8d41c
--- /dev/null
+++ b/src/test/resources/org/springframework/data/gemfire/config/tx-listeners-and-writers.xml
@@ -0,0 +1,33 @@
+
+
+
+	
+	
+
+	
+        
+        
+        
+     
+     
+     
+        
+        
+        
+     
+
+    
+    
+    
+
+    
+
+
\ No newline at end of file
diff --git a/template.mf b/template.mf
index d29cfb28..69e19047 100644
--- a/template.mf
+++ b/template.mf
@@ -2,21 +2,20 @@ Bundle-SymbolicName: org.springframework.data.gemfire
 Bundle-Name: Spring Data GemFire
 Bundle-Vendor: SpringSource
 Bundle-ManifestVersion: 2
-Export-Template: org.springframework.data.gemfire.*;version=${version}
 Import-Package: 
  sun.reflect;version="0";resolution:=optional
 Import-Template: 
- org.springframework.asm.*;version=${spring.range},
- org.springframework.beans.*;version=${spring.range},
- org.springframework.cache.*;version=${spring.range},
- org.springframework.context.*;version=${spring.range},
- org.springframework.core.*;version=${spring.range},
- org.springframework.dao.*;version=${spring.range},
- org.springframework.data.*;version="${springDataCommonsVersion:[=.=.=.=,+1.0.0)}",
- org.springframework.expression.*;version="${springVersion:[=.=.=,+1.0.0)}",
- org.springframework.util.*;version=${spring.range},
- org.springframework.transaction.*;version=${spring.range},
- com.gemstone.gemfire.*;version=${gemfire.range},
+ org.springframework.asm.*;version="[3.0.0, 4.0.0)",
+ org.springframework.beans.*;version="[3.0.0, 4.0.0)",
+ org.springframework.cache.*;version="[3.0.0, 4.0.0)",
+ org.springframework.context.*;version="[3.0.0, 4.0.0)",
+ org.springframework.core.*;version="[3.0.0, 4.0.0)",
+ org.springframework.dao.*;version="[3.0.0, 4.0.0)",
+ org.springframework.data.*;version="[1.2.0,2.0.0)",
+ org.springframework.expression.*;version="[3.0.0, 4.0.0)",
+ org.springframework.util.*;version="[3.0.0, 4.0.0)",
+ org.springframework.transaction.*;version="[3.0.0, 4.0.0)",
+ com.gemstone.*;version="[6.5, 7.0)",
  org.aopalliance.*;version="[1.0.0, 2.0.0)";resolution:=optional,
  org.apache.commons.logging.*;version="[1.1.1, 2.0.0)",
- org.w3c.dom.*;version="0"
\ No newline at end of file
+ org.w3c.dom.*;version="0"