merge pull request #13 from dturanski/1.2.0.RC1

* 1.2.0.RC1:
  doc update:temporarily removed link to spring data chapter in index.xml and fixed a typo in mapping.xml
  updating docs
  clean up build
  update schema task
  update sample build
  fix docs
  merged first draft build
  Refactored region factories
  added membership attributes support
  added dynamic region and jndi binding support
  Updated copyright, fixed support for transaction handlers, added initializers
  Complete disk store refactoring and added region attributes
  Refactored to use DiskStoreFactory
  Added missing cache attributes
  modified schema to make name attribute optional for root regions and required for subregions
  added subregion support
  demonstrate problem trying to create subregions
This commit is contained in:
David Turanski
2012-07-10 08:17:33 -04:00
194 changed files with 3975 additions and 3345 deletions

View File

@@ -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'
task wrapper(type: Wrapper) {
description = 'Generates gradlew[.bat] scripts'
gradleVersion = '1.0'
}
assemble.dependsOn = ['jar', 'sourcesJar']
defaultTasks 'build'

View File

@@ -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)
}

View File

@@ -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)

View File

@@ -3,7 +3,7 @@
<title>Spring GemFire Integration Schema</title>
<para>Spring GemFire Schema</para>
<programlisting language="xml"><xi:include href="../../../../../src/main/resources/org/springframework/data/gemfire/config/spring-gemfire-1.1.xsd" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude">
<programlisting language="xml"><xi:include href="../../../src/main/resources/org/springframework/data/gemfire/config/spring-gemfire-1.1.xsd" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:fallback>
<para><emphasis>FIXME: SGF SCHEMA LOCATION/NAME CHANGED</emphasis></para>
</xi:fallback>

View File

@@ -5,7 +5,10 @@
xmlns:xlink="http://www.w3.org/1999/xlink">
<bookinfo>
<title>Spring Gemfire Integration Reference Guide</title>
<releaseinfo>@version@</releaseinfo>
<releaseinfo>${version}</releaseinfo>
<titleabbrev>Spring GemFire ${version}</titleabbrev>
<productname>Spring GemFire</productname>
<authorgroup>
<author>
@@ -18,6 +21,11 @@
<surname>Gierke</surname>
<affiliation>SpringSource, a division of VMware</affiliation>
</author>
<author>
<firstname>David</firstname>
<surname>Turanski</surname>
<affiliation>SpringSource, a division of VMware</affiliation>
</author>
</authorgroup>
@@ -47,9 +55,11 @@
<xi:include href="reference/data.xml"/>
<xi:include href="reference/serialization.xml"/>
<xi:include href="reference/mapping.xml"/>
<!--
<xi:include href="https://github.com/SpringSource/spring-data-commons/raw/master/src/docbkx/repositories.xml">
<xi:fallback href="../../../../../../spring-data-commons/src/docbkx/repositories.xml" />
</xi:include>
-->
<xi:include href="reference/repositories.xml"/>
<xi:include href="reference/samples.xml"/>
</part>
@@ -59,7 +69,7 @@
<partintro>
<para>
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.
</para>
</partintro>

View File

@@ -20,23 +20,16 @@
<para>To use the SGF namespace, one just needs to import it inside the configuration:</para>
<programlistingco>
<areaspec>
<area id="gfe#ns#prefix" coords="4 11"/>
<area id="gfe#ns#uri" coords="4 58"/>
<area id="gfe#ns#uri#loc" coords="7 119"/>
<area id="gfe#ns#example" coords="10 9"/>
</areaspec>
<programlisting language="xml"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:gfe="http://www.springframework.org/schema/gemfire"
xmlns:]]><co id="gfe#ns#prefix"/><![CDATA[gfe="http://www.springframework.org/schema/gemfire"]]><co id="gfe#ns#uri"/><![CDATA[
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/gemfire http://www.springframework.org/schema/gemfire/spring-gemfire.xsd">
]]><co id="gfe#ns#uri#loc"/><![CDATA[http://www.springframework.org/schema/gemfire http://www.springframework.org/schema/gemfire/spring-gemfire.xsd">
<bean id ... >
<gfe:cache ...>
]]><co id="gfe#ns#example"/><![CDATA[<gfe:cache ...>
</beans>]]></programlisting>
<calloutlist>
@@ -54,30 +47,22 @@
<para>Declaration example for the GemFire namespace. Notice the prefix usage.</para>
</callout>
</calloutlist>
</programlistingco>
<para>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 <literal>&lt;beans&gt;</literal> to <literal>&lt;gfe&gt;</literal>. 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:</para>
<programlistingco>
<areaspec>
<area id="gfe#default-ns#prefix" coords="2 64"/>
<area id="gfe#default-ns#beans-prefix" coords="3 64"/>
<area id="gfe#default-ns#beans-example" coords="9 64"/>
<area id="gfe#default-ns#gfe-example" coords="11 64"/>
</areaspec>
<programlisting language="xml"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/gemfire"
<beans xmlns="]]><co id="gfe#default-ns#prefix"/><![CDATA[http://www.springframework.org/schema/gemfire"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:]]><co id="gfe#default-ns#beans-prefix"/><![CDATA[beans="http://www.springframework.org/schema/beans"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/gemfire http://www.springframework.org/schema/gemfire/spring-gemfire.xsd">
<beans:bean id ... >
]]><co id="gfe#default-ns#beans-example"/><![CDATA[<beans:bean id ... >
<cache ...>
]]><co id="gfe#default-ns#gfe-example"/><![CDATA[<cache ...>
</beans>]]></programlisting>
<calloutlist>
@@ -94,7 +79,6 @@
<para>Bean declaration using the <literal>&lt;gfe&gt;</literal> namespace. Notice the lack of prefix (as the default namespace is used).</para>
</callout>
</calloutlist>
</programlistingco>
<para>For the remainder of this doc, to improve readability, the XML examples will simply refer to the <literal>&lt;gfe&gt;</literal> namespace
without the namespace declaration, where possible.</para>

View File

@@ -32,6 +32,7 @@ public class Person {
} </programlisting>
</example>
<para>The first thing you see here is the
@@ -71,8 +72,8 @@ public class Person {
// …
}
} </programlisting>
</example>
<para>The entity annotated as such will get the field <code>foo</code>

View File

@@ -14,7 +14,7 @@
<para>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 <xref linkend="repositories" />.</para>
</section>

View File

@@ -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;
}

View File

@@ -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;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 743 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 321 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1003 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 580 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 598 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 259 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 264 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 613 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 329 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 361 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 565 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 617 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 623 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 411 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 640 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 353 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 350 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 345 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 348 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 355 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 344 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

View File

@@ -1,449 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This is the XSL FO (PDF) stylesheet for the Spring Data reference
documentation.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
version="1.0">
<xsl:import href="urn:docbkx:stylesheet"/>
<xsl:import href="highlight-fo.xsl"/>
<!--###################################################
Custom Title Page
################################################### -->
<xsl:template name="book.titlepage.recto">
<fo:block>
<fo:table table-layout="fixed" width="175mm">
<fo:table-column column-width="175mm"/>
<fo:table-body>
<fo:table-row>
<fo:table-cell text-align="center">
<!-- Logo
<fo:block>
<fo:external-graphic src="file:src/docbkx/resources/images/s2_box_logo.png"/>
</fo:block>
-->
<fo:block font-family="Helvetica" font-size="22pt" padding-before="10mm">
<xsl:value-of select="bookinfo/subtitle"/>
</fo:block>
<fo:block font-family="Helvetica" font-size="14pt" padding="10mm">
<xsl:value-of select="bookinfo/title"/>
</fo:block>
<fo:block font-family="Helvetica" font-size="12pt" padding="10mm">
<xsl:value-of select="bookinfo/releaseinfo"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell text-align="center">
<fo:block font-family="Helvetica" font-size="14pt" padding="10mm">
<xsl:value-of select="bookinfo/pubdate"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<fo:table-cell text-align="center">
<fo:block font-family="Helvetica" font-size="12pt" padding="10mm">
<xsl:for-each select="bookinfo/authorgroup/author">
<xsl:if test="position() > 1">
<xsl:text>, </xsl:text>
</xsl:if>
<xsl:value-of select="firstname"/>
<xsl:text> </xsl:text>
<xsl:value-of select="surname"/>
<xsl:text> (</xsl:text>
<xsl:value-of select="affiliation"/>
<xsl:text>)</xsl:text>
</xsl:for-each>
</fo:block>
<fo:block font-family="Helvetica" font-size="12pt" padding="10mm">
<xsl:text>Copyright &#xA9; 2010-2011</xsl:text>
</fo:block>
<fo:block font-family="Helvetica" font-size="10pt" padding="1mm">
<xsl:value-of select="bookinfo/legalnotice"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:block>
</xsl:template>
<!-- Prevent blank pages in output -->
<xsl:template name="book.titlepage.before.verso">
</xsl:template>
<xsl:template name="book.titlepage.verso">
</xsl:template>
<xsl:template name="book.titlepage.separator">
</xsl:template>
<!--###################################################
Header
################################################### -->
<!-- More space in the center header for long text -->
<xsl:attribute-set name="header.content.properties">
<xsl:attribute name="font-family">
<xsl:value-of select="$body.font.family"/>
</xsl:attribute>
<xsl:attribute name="margin-left">-5em</xsl:attribute>
<xsl:attribute name="margin-right">-5em</xsl:attribute>
</xsl:attribute-set>
<!--###################################################
Custom Footer
################################################### -->
<xsl:template name="footer.content">
<xsl:param name="pageclass" select="''"/>
<xsl:param name="sequence" select="''"/>
<xsl:param name="position" select="''"/>
<xsl:param name="gentext-key" select="''"/>
<xsl:variable name="Version">
<xsl:if test="//releaseinfo">
<xsl:text>Spring Data Redis (</xsl:text><xsl:value-of select="//releaseinfo" /><xsl:text>)</xsl:text>
</xsl:if>
</xsl:variable>
<xsl:choose>
<xsl:when test="$sequence='blank'">
<xsl:if test="$position = 'center'">
<xsl:value-of select="$Version"/>
</xsl:if>
</xsl:when>
<!-- for double sided printing, print page numbers on alternating sides (of the page) -->
<xsl:when test="$double.sided != 0">
<xsl:choose>
<xsl:when test="$sequence = 'even' and $position='left'">
<fo:page-number/>
</xsl:when>
<xsl:when test="$sequence = 'odd' and $position='right'">
<fo:page-number/>
</xsl:when>
<xsl:when test="$position='center'">
<xsl:value-of select="$Version"/>
</xsl:when>
</xsl:choose>
</xsl:when>
<!-- for single sided printing, print all page numbers on the right (of the page) -->
<xsl:when test="$double.sided = 0">
<xsl:choose>
<xsl:when test="$position='center'">
<xsl:value-of select="$Version"/>
</xsl:when>
<xsl:when test="$position='right'">
<fo:page-number/>
</xsl:when>
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:template>
<!--###################################################
Extensions
################################################### -->
<!-- These extensions are required for table printing and other stuff -->
<xsl:param name="tablecolumns.extension">0</xsl:param>
<!-- FOP provide only PDF Bookmarks at the moment -->
<xsl:param name="fop.extensions">1</xsl:param>
<xsl:param name="fop1.extensions">1</xsl:param>
<xsl:param name="ignore.image.scaling">0</xsl:param>
<!--###################################################
Table Of Contents
################################################### -->
<!-- Generate the TOCs for named components only -->
<xsl:param name="generate.toc">
book toc
</xsl:param>
<!-- Show only Sections up to level 3 in the TOCs -->
<xsl:param name="toc.section.depth">2</xsl:param>
<!-- Dot and Whitespace as separator in TOC between Label and Title-->
<xsl:param name="autotoc.label.separator" select="'. '"/>
<!--###################################################
Paper & Page Size
################################################### -->
<!-- Paper type, no headers on blank pages, no double sided printing -->
<xsl:param name="paper.type" select="'A4'"/>
<xsl:param name="double.sided">0</xsl:param>
<xsl:param name="headers.on.blank.pages">0</xsl:param>
<xsl:param name="footers.on.blank.pages">0</xsl:param>
<!-- Space between paper border and content (chaotic stuff, don't touch) -->
<xsl:param name="page.margin.top">5mm</xsl:param>
<xsl:param name="region.before.extent">10mm</xsl:param>
<xsl:param name="body.margin.top">10mm</xsl:param>
<xsl:param name="body.margin.bottom">15mm</xsl:param>
<xsl:param name="region.after.extent">10mm</xsl:param>
<xsl:param name="page.margin.bottom">0mm</xsl:param>
<xsl:param name="page.margin.outer">18mm</xsl:param>
<xsl:param name="page.margin.inner">18mm</xsl:param>
<!-- No intendation of Titles -->
<xsl:param name="title.margin.left">0pc</xsl:param>
<!--###################################################
Fonts & Styles
################################################### -->
<!-- Left aligned text and no hyphenation -->
<xsl:param name="alignment">justify</xsl:param>
<xsl:param name="hyphenate">false</xsl:param>
<!-- Default Font size -->
<xsl:param name="body.font.master">11</xsl:param>
<xsl:param name="body.font.small">8</xsl:param>
<!-- Line height in body text -->
<xsl:param name="line-height">1.4</xsl:param>
<!-- Monospaced fonts are smaller than regular text -->
<xsl:attribute-set name="monospace.properties">
<xsl:attribute name="font-family">
<xsl:value-of select="$monospace.font.family"/>
</xsl:attribute>
<xsl:attribute name="font-size">0.8em</xsl:attribute>
</xsl:attribute-set>
<!--###################################################
Tables
################################################### -->
<!-- The table width should be adapted to the paper size -->
<xsl:param name="default.table.width">17.4cm</xsl:param>
<!-- Some padding inside tables -->
<xsl:attribute-set name="table.cell.padding">
<xsl:attribute name="padding-left">4pt</xsl:attribute>
<xsl:attribute name="padding-right">4pt</xsl:attribute>
<xsl:attribute name="padding-top">4pt</xsl:attribute>
<xsl:attribute name="padding-bottom">4pt</xsl:attribute>
</xsl:attribute-set>
<!-- Only hairlines as frame and cell borders in tables -->
<xsl:param name="table.frame.border.thickness">0.1pt</xsl:param>
<xsl:param name="table.cell.border.thickness">0.1pt</xsl:param>
<!--###################################################
Labels
################################################### -->
<!-- Label Chapters and Sections (numbering) -->
<xsl:param name="chapter.autolabel">1</xsl:param>
<xsl:param name="section.autolabel" select="1"/>
<xsl:param name="section.label.includes.component.label" select="1"/>
<!--###################################################
Titles
################################################### -->
<!-- Chapter title size -->
<xsl:attribute-set name="chapter.titlepage.recto.style">
<xsl:attribute name="text-align">left</xsl:attribute>
<xsl:attribute name="font-weight">bold</xsl:attribute>
<xsl:attribute name="font-size">
<xsl:value-of select="$body.font.master * 1.8"/>
<xsl:text>pt</xsl:text>
</xsl:attribute>
</xsl:attribute-set>
<!-- Why is the font-size for chapters hardcoded in the XSL FO templates?
Let's remove it, so this sucker can use our attribute-set only... -->
<xsl:template match="title" mode="chapter.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format"
xsl:use-attribute-sets="chapter.titlepage.recto.style">
<xsl:call-template name="component.title">
<xsl:with-param name="node" select="ancestor-or-self::chapter[1]"/>
</xsl:call-template>
</fo:block>
</xsl:template>
<!-- Sections 1, 2 and 3 titles have a small bump factor and padding -->
<xsl:attribute-set name="section.title.level1.properties">
<xsl:attribute name="space-before.optimum">0.8em</xsl:attribute>
<xsl:attribute name="space-before.minimum">0.8em</xsl:attribute>
<xsl:attribute name="space-before.maximum">0.8em</xsl:attribute>
<xsl:attribute name="font-size">
<xsl:value-of select="$body.font.master * 1.5"/>
<xsl:text>pt</xsl:text>
</xsl:attribute>
<xsl:attribute name="space-after.optimum">0.1em</xsl:attribute>
<xsl:attribute name="space-after.minimum">0.1em</xsl:attribute>
<xsl:attribute name="space-after.maximum">0.1em</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="section.title.level2.properties">
<xsl:attribute name="space-before.optimum">0.6em</xsl:attribute>
<xsl:attribute name="space-before.minimum">0.6em</xsl:attribute>
<xsl:attribute name="space-before.maximum">0.6em</xsl:attribute>
<xsl:attribute name="font-size">
<xsl:value-of select="$body.font.master * 1.25"/>
<xsl:text>pt</xsl:text>
</xsl:attribute>
<xsl:attribute name="space-after.optimum">0.1em</xsl:attribute>
<xsl:attribute name="space-after.minimum">0.1em</xsl:attribute>
<xsl:attribute name="space-after.maximum">0.1em</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="section.title.level3.properties">
<xsl:attribute name="space-before.optimum">0.4em</xsl:attribute>
<xsl:attribute name="space-before.minimum">0.4em</xsl:attribute>
<xsl:attribute name="space-before.maximum">0.4em</xsl:attribute>
<xsl:attribute name="font-size">
<xsl:value-of select="$body.font.master * 1.0"/>
<xsl:text>pt</xsl:text>
</xsl:attribute>
<xsl:attribute name="space-after.optimum">0.1em</xsl:attribute>
<xsl:attribute name="space-after.minimum">0.1em</xsl:attribute>
<xsl:attribute name="space-after.maximum">0.1em</xsl:attribute>
</xsl:attribute-set>
<!-- Titles of formal objects (tables, examples, ...) -->
<xsl:attribute-set name="formal.title.properties" use-attribute-sets="normal.para.spacing">
<xsl:attribute name="font-weight">bold</xsl:attribute>
<xsl:attribute name="font-size">
<xsl:value-of select="$body.font.master"/>
<xsl:text>pt</xsl:text>
</xsl:attribute>
<xsl:attribute name="hyphenate">false</xsl:attribute>
<xsl:attribute name="space-after.minimum">0.4em</xsl:attribute>
<xsl:attribute name="space-after.optimum">0.6em</xsl:attribute>
<xsl:attribute name="space-after.maximum">0.8em</xsl:attribute>
</xsl:attribute-set>
<!--###################################################
Programlistings
################################################### -->
<!-- Verbatim text formatting (programlistings) -->
<xsl:attribute-set name="monospace.verbatim.properties">
<xsl:attribute name="font-size">
<xsl:value-of select="$body.font.small * 1.0"/>
<xsl:text>pt</xsl:text>
</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="verbatim.properties">
<xsl:attribute name="space-before.minimum">1em</xsl:attribute>
<xsl:attribute name="space-before.optimum">1em</xsl:attribute>
<xsl:attribute name="space-before.maximum">1em</xsl:attribute>
<xsl:attribute name="border-color">#444444</xsl:attribute>
<xsl:attribute name="border-style">solid</xsl:attribute>
<xsl:attribute name="border-width">0.1pt</xsl:attribute>
<xsl:attribute name="padding-top">0.5em</xsl:attribute>
<xsl:attribute name="padding-left">0.5em</xsl:attribute>
<xsl:attribute name="padding-right">0.5em</xsl:attribute>
<xsl:attribute name="padding-bottom">0.5em</xsl:attribute>
<xsl:attribute name="margin-left">0.5em</xsl:attribute>
<xsl:attribute name="margin-right">0.5em</xsl:attribute>
</xsl:attribute-set>
<!-- Shade (background) programlistings -->
<xsl:param name="shade.verbatim">1</xsl:param>
<xsl:attribute-set name="shade.verbatim.style">
<xsl:attribute name="background-color">#F0F0F0</xsl:attribute>
</xsl:attribute-set>
<!--###################################################
Callouts
################################################### -->
<!-- Use images for callouts instead of (1) (2) (3) -->
<xsl:param name="callout.graphics">0</xsl:param>
<xsl:param name="callout.unicode">1</xsl:param>
<!-- Place callout marks at this column in annotated areas -->
<xsl:param name="callout.defaultcolumn">90</xsl:param>
<!--###################################################
Admonitions
################################################### -->
<!-- Use nice graphics for admonitions -->
<xsl:param name="admon.graphics">'1'</xsl:param>
<xsl:param name="admon.graphics.path">src/docbkx/resources/images/admons/</xsl:param>
<!--###################################################
Misc
################################################### -->
<!-- Placement of titles -->
<xsl:param name="formal.title.placement">
figure after
example before
equation before
table before
procedure before
</xsl:param>
<!-- Format Variable Lists as Blocks (prevents horizontal overflow) -->
<xsl:param name="variablelist.as.blocks">1</xsl:param>
<!-- The horrible list spacing problems -->
<xsl:attribute-set name="list.block.spacing">
<xsl:attribute name="space-before.optimum">0.8em</xsl:attribute>
<xsl:attribute name="space-before.minimum">0.8em</xsl:attribute>
<xsl:attribute name="space-before.maximum">0.8em</xsl:attribute>
<xsl:attribute name="space-after.optimum">0.1em</xsl:attribute>
<xsl:attribute name="space-after.minimum">0.1em</xsl:attribute>
<xsl:attribute name="space-after.maximum">0.1em</xsl:attribute>
</xsl:attribute-set>
<!--###################################################
colored and hyphenated links
################################################### -->
<xsl:template match="ulink">
<fo:basic-link external-destination="{@url}"
xsl:use-attribute-sets="xref.properties"
text-decoration="underline"
color="blue">
<xsl:choose>
<xsl:when test="count(child::node())=0">
<xsl:value-of select="@url"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</fo:basic-link>
</xsl:template>
<xsl:template match="link">
<fo:basic-link internal-destination="{@linkend}"
xsl:use-attribute-sets="xref.properties"
text-decoration="underline"
color="blue">
<xsl:choose>
<xsl:when test="count(child::node())=0">
<xsl:value-of select="@linkend"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</fo:basic-link>
</xsl:template>
<!--
<xsl:template match="xref">
<fo:basic-link internal-destination="{@linkend}"
xsl:use-attribute-sets="xref.properties"
text-decoration="underline"
color="blue">
<xsl:apply-templates/>
</fo:basic-link>
</xsl:template>
-->
</xsl:stylesheet>

View File

@@ -1,44 +0,0 @@
<?xml version='1.0'?>
<!--
Simple highlighter for FO/PDF output. Follows the Eclipse color scheme.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:xslthl="http://xslthl.sf.net"
exclude-result-prefixes="xslthl"
version='1.0'>
<xsl:template match='xslthl:keyword'>
<fo:inline font-weight="bold" color="#7F0055"><xsl:apply-templates/></fo:inline>
</xsl:template>
<xsl:template match='xslthl:comment'>
<fo:inline font-style="italic" color="#3F5F5F"><xsl:apply-templates/></fo:inline>
</xsl:template>
<xsl:template match='xslthl:oneline-comment'>
<fo:inline font-style="italic" color="#3F5F5F"><xsl:apply-templates/></fo:inline>
</xsl:template>
<xsl:template match='xslthl:multiline-comment'>
<fo:inline font-style="italic" color="#3F5FBF"><xsl:apply-templates/></fo:inline>
</xsl:template>
<xsl:template match='xslthl:tag'>
<fo:inline color="#3F7F7F"><xsl:apply-templates/></fo:inline>
</xsl:template>
<xsl:template match='xslthl:attribute'>
<fo:inline olor="#7F007F"><xsl:apply-templates/></fo:inline>
</xsl:template>
<xsl:template match='xslthl:value'>
<fo:inline color="#2A00FF"><xsl:apply-templates/></fo:inline>
</xsl:template>
<xsl:template match='xslthl:string'>
<fo:inline color="#2A00FF"><xsl:apply-templates/></fo:inline>
</xsl:template>
</xsl:stylesheet>

View File

@@ -1,42 +0,0 @@
<?xml version='1.0'?>
<!--
Simple highlighter for HTML output. Follows the Eclipse color scheme.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xslthl="http://xslthl.sf.net"
exclude-result-prefixes="xslthl"
version='1.0'>
<xsl:template match='xslthl:keyword'>
<span class="hl-keyword"><xsl:value-of select='.'/></span>
</xsl:template>
<xsl:template match='xslthl:comment'>
<span class="hl-comment"><xsl:value-of select='.'/></span>
</xsl:template>
<xsl:template match='xslthl:oneline-comment'>
<span class="hl-comment"><xsl:value-of select='.'/></span>
</xsl:template>
<xsl:template match='xslthl:multiline-comment'>
<span class="hl-multiline-comment"><xsl:value-of select='.'/></span>
</xsl:template>
<xsl:template match='xslthl:tag'>
<span class="hl-tag"><xsl:value-of select='.'/></span>
</xsl:template>
<xsl:template match='xslthl:attribute'>
<span class="hl-attribute"><xsl:value-of select='.'/></span>
</xsl:template>
<xsl:template match='xslthl:value'>
<span class="hl-value"><xsl:value-of select='.'/></span>
</xsl:template>
<xsl:template match='xslthl:string'>
<span class="hl-string"><xsl:value-of select='.'/></span>
</xsl:template>
</xsl:stylesheet>

View File

@@ -1,145 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you 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.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xslthl="http://xslthl.sf.net"
exclude-result-prefixes="xslthl"
version='1.0'>
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl"/>
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/highlight.xsl"/>
<xsl:param name="chunk.section.depth">'5'</xsl:param>
<xsl:param name="use.id.as.filename">'1'</xsl:param>
<!-- Only use scaling in FO -->
<xsl:param name="ignore.image.scaling">1</xsl:param>
<!-- Use code syntax highlighting -->
<xsl:param name="highlight.source">1</xsl:param>
<!-- Extensions -->
<xsl:param name="use.extensions">0</xsl:param>
<xsl:param name="tablecolumns.extension">0</xsl:param>
<xsl:param name="callout.extensions">1</xsl:param>
<!-- Activate Graphics -->
<xsl:param name="admon.graphics" select="1"/>
<xsl:param name="admon.graphics.path">images/admon/</xsl:param>
<xsl:param name="admon.graphics.extension">.png</xsl:param>
<xsl:param name="callout.graphics" select="1" />
<xsl:param name="callout.defaultcolumn">120</xsl:param>
<xsl:param name="callout.graphics.path">images/callouts/</xsl:param>
<xsl:param name="callout.graphics.extension">.png</xsl:param>
<xsl:param name="table.borders.with.css" select="1"/>
<xsl:param name="html.stylesheet">css/manual.css</xsl:param>
<xsl:param name="html.stylesheet.type">text/css</xsl:param>
<xsl:param name="generate.toc">book toc,title</xsl:param>
<xsl:param name="admonition.title.properties">text-align: left</xsl:param>
<!-- Leave image paths as relative when navigating XInclude -->
<xsl:param name="keep.relative.image.uris" select="1"/>
<!-- Label Chapters and Sections (numbering) -->
<xsl:param name="chapter.autolabel" select="1"/>
<xsl:param name="section.autolabel" select="1"/>
<xsl:param name="section.autolabel.max.depth" select="2"/>
<xsl:param name="section.label.includes.component.label" select="1"/>
<xsl:param name="table.footnote.number.format" select="'1'"/>
<!-- Show only Sections up to level 3 in the TOCs -->
<xsl:param name="toc.section.depth">3</xsl:param>
<!-- Remove "Chapter" from the Chapter titles... -->
<xsl:param name="local.l10n.xml" select="document('')"/>
<l:i18n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">
<l:l10n language="en">
<l:context name="title-numbered">
<l:template name="chapter" text="%n.&#160;%t"/>
<l:template name="section" text="%n&#160;%t"/>
</l:context>
</l:l10n>
</l:i18n>
<xsl:template match='xslthl:keyword' mode="xslthl">
<span class="hl-keyword"><xsl:apply-templates mode="xslthl"/></span>
</xsl:template>
<xsl:template match='xslthl:comment' mode="xslthl">
<span class="hl-comment"><xsl:apply-templates mode="xslthl"/></span>
</xsl:template>
<xsl:template match='xslthl:oneline-comment' mode="xslthl">
<span class="hl-comment"><xsl:apply-templates mode="xslthl"/></span>
</xsl:template>
<xsl:template match='xslthl:multiline-comment' mode="xslthl">
<span class="hl-multiline-comment"><xsl:apply-templates mode="xslthl"/></span>
</xsl:template>
<xsl:template match='xslthl:tag' mode="xslthl">
<span class="hl-tag"><xsl:apply-templates mode="xslthl"/></span>
</xsl:template>
<xsl:template match='xslthl:attribute' mode="xslthl">
<span class="hl-attribute"><xsl:apply-templates mode="xslthl"/></span>
</xsl:template>
<xsl:template match='xslthl:value' mode="xslthl">
<span class="hl-value"><xsl:apply-templates mode="xslthl"/></span>
</xsl:template>
<xsl:template match='xslthl:string' mode="xslthl">
<span class="hl-string"><xsl:apply-templates mode="xslthl"/></span>
</xsl:template>
<!-- Google Analytics -->
<xsl:template name="user.head.content">
<xsl:comment>Begin Google Analytics code</xsl:comment>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-2728886-3");
pageTracker._setDomainName("none");
pageTracker._setAllowLinker(true);
pageTracker._trackPageview();
</script>
<xsl:comment>End Google Analytics code</xsl:comment>
</xsl:template>
<!-- Loopfuse -->
<xsl:template name="user.footer.content">
<xsl:comment>Begin LoopFuse code</xsl:comment>
<script src="http://loopfuse.net/webrecorder/js/listen.js" type="text/javascript">
</script>
<script type="text/javascript">
_lf_cid = "LF_48be82fa";
_lf_remora();
</script>
<xsl:comment>End LoopFuse code</xsl:comment>
</xsl:template>
</xsl:stylesheet>

View File

@@ -1,142 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you 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.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xslthl="http://xslthl.sf.net"
exclude-result-prefixes="xslthl"
version='1.0'>
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl"/>
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/highlight.xsl"/>
<!-- Only use scaling in FO -->
<xsl:param name="ignore.image.scaling">1</xsl:param>
<!-- Use code syntax highlighting -->
<xsl:param name="highlight.source">1</xsl:param>
<!-- Extensions -->
<xsl:param name="use.extensions">0</xsl:param>
<xsl:param name="tablecolumns.extension">0</xsl:param>
<xsl:param name="callout.extensions">1</xsl:param>
<!-- Activate Graphics -->
<xsl:param name="admon.graphics" select="1"/>
<xsl:param name="admon.graphics.path">images/admon/</xsl:param>
<xsl:param name="admon.graphics.extension">.png</xsl:param>
<xsl:param name="callout.graphics" select="1" />
<xsl:param name="callout.defaultcolumn">120</xsl:param>
<xsl:param name="callout.graphics.path">images/callouts/</xsl:param>
<xsl:param name="callout.graphics.extension">.png</xsl:param>
<xsl:param name="table.borders.with.css" select="1"/>
<xsl:param name="html.stylesheet">css/manual.css</xsl:param>
<xsl:param name="html.stylesheet.type">text/css</xsl:param>
<xsl:param name="generate.toc">book toc,title</xsl:param>
<xsl:param name="admonition.title.properties">text-align: left</xsl:param>
<!-- Leave image paths as relative when navigating XInclude -->
<xsl:param name="keep.relative.image.uris" select="1"/>
<!-- Label Chapters and Sections (numbering) -->
<xsl:param name="chapter.autolabel" select="1"/>
<xsl:param name="section.autolabel" select="1"/>
<xsl:param name="section.autolabel.max.depth" select="2"/>
<xsl:param name="section.label.includes.component.label" select="1"/>
<xsl:param name="table.footnote.number.format" select="'1'"/>
<!-- Show only Sections up to level 2 in the TOCs -->
<xsl:param name="toc.section.depth">2</xsl:param>
<!-- Remove "Chapter" from the Chapter titles... -->
<xsl:param name="local.l10n.xml" select="document('')"/>
<l:i18n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">
<l:l10n language="en">
<l:context name="title-numbered">
<l:template name="chapter" text="%n.&#160;%t"/>
<l:template name="section" text="%n&#160;%t"/>
</l:context>
</l:l10n>
</l:i18n>
<xsl:template match='xslthl:keyword' mode="xslthl">
<span class="hl-keyword"><xsl:apply-templates mode="xslthl"/></span>
</xsl:template>
<xsl:template match='xslthl:comment' mode="xslthl">
<span class="hl-comment"><xsl:apply-templates mode="xslthl"/></span>
</xsl:template>
<xsl:template match='xslthl:oneline-comment' mode="xslthl">
<span class="hl-comment"><xsl:apply-templates mode="xslthl"/></span>
</xsl:template>
<xsl:template match='xslthl:multiline-comment' mode="xslthl">
<span class="hl-multiline-comment"><xsl:apply-templates mode="xslthl"/></span>
</xsl:template>
<xsl:template match='xslthl:tag' mode="xslthl">
<span class="hl-tag"><xsl:apply-templates mode="xslthl"/></span>
</xsl:template>
<xsl:template match='xslthl:attribute' mode="xslthl">
<span class="hl-attribute"><xsl:apply-templates mode="xslthl"/></span>
</xsl:template>
<xsl:template match='xslthl:value' mode="xslthl">
<span class="hl-value"><xsl:apply-templates mode="xslthl"/></span>
</xsl:template>
<xsl:template match='xslthl:string' mode="xslthl">
<span class="hl-string"><xsl:apply-templates mode="xslthl"/></span>
</xsl:template>
<!-- Google Analytics -->
<xsl:template name="user.head.content">
<xsl:comment>Begin Google Analytics code</xsl:comment>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-2728886-3");
pageTracker._setDomainName("none");
pageTracker._setAllowLinker(true);
pageTracker._trackPageview();
</script>
<xsl:comment>End Google Analytics code</xsl:comment>
</xsl:template>
<!-- Loopfuse -->
<xsl:template name="user.footer.content">
<xsl:comment>Begin LoopFuse code</xsl:comment>
<script src="http://loopfuse.net/webrecorder/js/listen.js" type="text/javascript">
</script>
<script type="text/javascript">
_lf_cid = "LF_48be82fa";
_lf_remora();
</script>
<xsl:comment>End LoopFuse code</xsl:comment>
</xsl:template>
</xsl:stylesheet>

View File

@@ -1,107 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This is the XSL HTML configuration file for the Spring
Reference Documentation.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:xslthl="http://xslthl.sf.net"
exclude-result-prefixes="xslthl"
version="1.0">
<xsl:import href="urn:docbkx:stylesheet"/>
<xsl:import href="highlight.xsl"/>
<!--###################################################
HTML Settings
################################################### -->
<!-- These extensions are required for table printing and other stuff -->
<xsl:param name="tablecolumns.extension">0</xsl:param>
<xsl:param name="graphicsize.extension">0</xsl:param>
<xsl:param name="ignore.image.scaling">1</xsl:param>
<!--###################################################
Table Of Contents
################################################### -->
<!-- Generate the TOCs for named components only -->
<xsl:param name="generate.toc">
book toc
</xsl:param>
<!-- Show only Sections up to level 3 in the TOCs -->
<xsl:param name="toc.section.depth">3</xsl:param>
<!--###################################################
Labels
################################################### -->
<!-- Label Chapters and Sections (numbering) -->
<xsl:param name="chapter.autolabel">1</xsl:param>
<xsl:param name="section.autolabel" select="1"/>
<xsl:param name="section.label.includes.component.label" select="1"/>
<!--###################################################
Callouts
################################################### -->
<!-- Use images for callouts instead of (1) (2) (3) -->
<xsl:param name="callout.graphics">1</xsl:param>
<!-- Place callout marks at this column in annotated areas -->
<xsl:param name="callout.defaultcolumn">90</xsl:param>
<!--###################################################
Admonitions
################################################### -->
<!-- Use nice graphics for admonitions -->
<xsl:param name="admon.graphics">1</xsl:param>
<xsl:param name="admon.graphics.path">images/admons/</xsl:param>
<!--###################################################
Misc
################################################### -->
<!-- Placement of titles -->
<xsl:param name="formal.title.placement">
figure after
example before
equation before
table before
procedure before
</xsl:param>
<xsl:template match="author" mode="titlepage.mode">
<xsl:if test="name(preceding-sibling::*[1]) = 'author'">
<xsl:text>, </xsl:text>
</xsl:if>
<span class="{name(.)}">
<xsl:call-template name="person.name"/>
(<xsl:value-of select="affiliation"/>)
<xsl:apply-templates mode="titlepage.mode" select="./contrib"/>
</span>
</xsl:template>
<xsl:template match="authorgroup" mode="titlepage.mode">
<div class="{name(.)}">
<h2>Authors</h2>
<p/>
<xsl:apply-templates mode="titlepage.mode"/>
</div>
</xsl:template>
<!--###################################################
Headers and Footers
################################################### -->
<!-- let's have a Spring and I21 banner across the top of each page -->
<xsl:template name="user.header.navigation">
<div style="background-color:white;border:none;height:73px;border:1px solid black;">
<a style="border:none;" href="http://www.springframework.org/osgi/"
title="The Spring Framework - Spring Data">
<img style="border:none;" src="images/xdev-spring_logo.jpg"/>
</a>
<a style="border:none;" href="http://www.SpringSource.com/" title="SpringSource - Spring from the Source">
<img style="border:none;position:absolute;padding-top:5px;right:42px;" src="images/s2-banner-rhs.png"/>
</a>
</div>
</xsl:template>
</xsl:stylesheet>

View File

@@ -1,221 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This is the XSL HTML configuration file for the Spring Reference Documentation.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
version="1.0">
<xsl:import href="urn:docbkx:stylesheet"/>
<xsl:import href="highlight.xsl"/>
<!--###################################################
HTML Settings
################################################### -->
<xsl:param name="chunk.section.depth">'5'</xsl:param>
<xsl:param name="use.id.as.filename">'1'</xsl:param>
<xsl:param name="tablecolumns.extension">0</xsl:param>
<xsl:param name="graphicsize.extension">0</xsl:param>
<xsl:param name="ignore.image.scaling">1</xsl:param>
<!--###################################################
Table Of Contents
################################################### -->
<!-- Generate the TOCs for named components only -->
<xsl:param name="generate.toc">
book toc
qandaset toc
</xsl:param>
<!-- Show only Sections up to level 3 in the TOCs -->
<xsl:param name="toc.section.depth">3</xsl:param>
<!--###################################################
Labels
################################################### -->
<!-- Label Chapters and Sections (numbering) -->
<xsl:param name="chapter.autolabel">1</xsl:param>
<xsl:param name="section.autolabel" select="1"/>
<xsl:param name="section.label.includes.component.label" select="1"/>
<!--###################################################
Callouts
################################################### -->
<!-- Place callout marks at this column in annotated areas -->
<xsl:param name="callout.graphics">1</xsl:param>
<xsl:param name="callout.defaultcolumn">90</xsl:param>
<!--###################################################
Admonitions
################################################### -->
<!-- Use nice graphics for admonitions -->
<xsl:param name="admon.graphics">1</xsl:param>
<xsl:param name="admon.graphics.path">images/admons/</xsl:param>
<!--###################################################
Misc
################################################### -->
<!-- Placement of titles -->
<xsl:param name="formal.title.placement">
figure after
example before
equation before
table before
procedure before
</xsl:param>
<xsl:template match="author" mode="titlepage.mode">
<xsl:if test="name(preceding-sibling::*[1]) = 'author'">
<xsl:text>, </xsl:text>
</xsl:if>
<span class="{name(.)}">
<xsl:call-template name="person.name"/>
(<xsl:value-of select="affiliation"/>)
<xsl:apply-templates mode="titlepage.mode" select="./contrib"/>
<!--
<xsl:apply-templates mode="titlepage.mode" select="./affiliation"/>
-->
</span>
</xsl:template>
<xsl:template match="authorgroup" mode="titlepage.mode">
<div class="{name(.)}">
<h2>Authors</h2>
<p/>
<xsl:apply-templates mode="titlepage.mode"/>
</div>
</xsl:template>
<!--###################################################
Headers and Footers
################################################### -->
<!-- let's have a Spring and I21 banner across the top of each page -->
<xsl:template name="user.header.navigation">
<div style="background-color:white;border:none;height:73px;border:1px solid black;">
<a style="border:none;" href="http://www.springframework.org/osgi/"
title="The Spring Framework - Spring Data">
<img style="border:none;" src="images/xdev-spring_logo.jpg"/>
</a>
<a style="border:none;" href="http://www.SpringSource.com/" title="SpringSource - Spring from the Source">
<img style="border:none;position:absolute;padding-top:5px;right:42px;" src="images/s2-banner-rhs.png"/>
</a>
</div>
</xsl:template>
<!-- no other header navigation (prev, next, etc.) -->
<xsl:template name="header.navigation"/>
<xsl:param name="navig.showtitles">1</xsl:param>
<!-- let's have a 'Sponsored by SpringSource' strapline (or somesuch) across the bottom of each page -->
<xsl:template name="footer.navigation">
<xsl:param name="prev" select="/foo"/>
<xsl:param name="next" select="/foo"/>
<xsl:param name="nav.context"/>
<xsl:variable name="home" select="/*[1]"/>
<xsl:variable name="up" select="parent::*"/>
<xsl:variable name="row1" select="count($prev) &gt; 0
or count($up) &gt; 0
or count($next) &gt; 0"/>
<xsl:variable name="row2" select="($prev and $navig.showtitles != 0)
or (generate-id($home) != generate-id(.)
or $nav.context = 'toc')
or ($chunk.tocs.and.lots != 0
and $nav.context != 'toc')
or ($next and $navig.showtitles != 0)"/>
<xsl:if test="$suppress.navigation = '0' and $suppress.footer.navigation = '0'">
<div class="navfooter">
<xsl:if test="$footer.rule != 0">
<hr/>
</xsl:if>
<xsl:if test="$row1 or $row2">
<table width="100%" summary="Navigation footer">
<xsl:if test="$row1">
<tr>
<td width="40%" align="left">
<xsl:if test="count($prev)>0">
<a accesskey="p">
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="$prev"/>
</xsl:call-template>
</xsl:attribute>
<xsl:call-template name="navig.content">
<xsl:with-param name="direction" select="'prev'"/>
</xsl:call-template>
</a>
</xsl:if>
<xsl:text>&#160;</xsl:text>
</td>
<td width="20%" align="center">
<xsl:choose>
<xsl:when test="$home != . or $nav.context = 'toc'">
<a accesskey="h">
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="$home"/>
</xsl:call-template>
</xsl:attribute>
<xsl:call-template name="navig.content">
<xsl:with-param name="direction" select="'home'"/>
</xsl:call-template>
</a>
<xsl:if test="$chunk.tocs.and.lots != 0 and $nav.context != 'toc'">
<xsl:text>&#160;|&#160;</xsl:text>
</xsl:if>
</xsl:when>
<xsl:otherwise>&#160;</xsl:otherwise>
</xsl:choose>
<xsl:if test="$chunk.tocs.and.lots != 0 and $nav.context != 'toc'">
<a accesskey="t">
<xsl:attribute name="href">
<xsl:apply-templates select="/*[1]" mode="recursive-chunk-filename">
<xsl:with-param name="recursive" select="true()"/>
</xsl:apply-templates>
<xsl:text>-toc</xsl:text>
<xsl:value-of select="$html.ext"/>
</xsl:attribute>
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'nav-toc'"/>
</xsl:call-template>
</a>
</xsl:if>
</td>
<td width="40%" align="right">
<xsl:text>&#160;</xsl:text>
<xsl:if test="count($next)>0">
<a accesskey="n">
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="$next"/>
</xsl:call-template>
</xsl:attribute>
<xsl:call-template name="navig.content">
<xsl:with-param name="direction" select="'next'"/>
</xsl:call-template>
</a>
</xsl:if>
</td>
</tr>
</xsl:if>
<xsl:if test="$row2">
<tr>
<td width="40%" align="left" valign="top">
<xsl:if test="$navig.showtitles != 0">
<xsl:apply-templates select="$prev" mode="object.title.markup"/>
</xsl:if>
<xsl:text>&#160;</xsl:text>
</td>
<td width="20%" align="center">
<span style="color:white;font-size:90%;">
<a href="http://www.SpringSource.com/"
title="SpringSource - Spring from the Source">Sponsored by SpringSource
</a>
</span>
</td>
<td width="40%" align="right" valign="top">
<xsl:text>&#160;</xsl:text>
<xsl:if test="$navig.showtitles != 0">
<xsl:apply-templates select="$next" mode="object.title.markup"/>
</xsl:if>
</td>
</tr>
</xsl:if>
</table>
</xsl:if>
</div>
</xsl:if>
</xsl:template>
</xsl:stylesheet>

View File

@@ -1,522 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you 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.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:xslthl="http://xslthl.sf.net"
exclude-result-prefixes="xslthl"
version='1.0'>
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl"/>
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/fo/highlight.xsl"/>
<!-- Use nice graphics for admonitions -->
<xsl:param name="admon.graphics">'1'</xsl:param>
<xsl:param name="admon.graphics.path">images/admon/</xsl:param>
<xsl:param name="admon.graphics.extension">.png</xsl:param>
<!-- resize the admon graphics. they're width 36pt by default
even though the graphics that ship with docbook are 24x24 -->
<xsl:template match="*" mode="admon.graphic.width">
<xsl:param name="node" select="."/>
<xsl:text>24pt</xsl:text>
</xsl:template>
<xsl:param name="paper.type" select="'A4'"/>
<xsl:param name="page.margin.top" select="'1cm'"/>
<xsl:param name="region.before.extent" select="'1cm'"/>
<xsl:param name="body.margin.top" select="'1.5cm'"/>
<xsl:param name="body.margin.bottom" select="'1.5cm'"/>
<xsl:param name="region.after.extent" select="'1cm'"/>
<xsl:param name="page.margin.bottom" select="'1cm'"/>
<xsl:param name="title.margin.left" select="'0cm'"/>
<!--###################################################
Header
################################################### -->
<!-- More space in the center header for long text -->
<xsl:attribute-set name="header.content.properties">
<xsl:attribute name="font-family">
<xsl:value-of select="$body.font.family"/>
</xsl:attribute>
<xsl:attribute name="margin-left">-5em</xsl:attribute>
<xsl:attribute name="margin-right">-5em</xsl:attribute>
</xsl:attribute-set>
<!--###################################################
Table of Contents
################################################### -->
<xsl:param name="generate.toc">
book toc,title
</xsl:param>
<!--###################################################
Custom Header
################################################### -->
<xsl:template name="header.content">
<xsl:param name="pageclass" select="''"/>
<xsl:param name="sequence" select="''"/>
<xsl:param name="position" select="''"/>
<xsl:param name="gentext-key" select="''"/>
<xsl:variable name="Version">
<xsl:choose>
<xsl:when test="//productname">
<xsl:value-of select="//productname"/><xsl:text> </xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>Spring GemFire</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="$sequence='blank'">
<xsl:choose>
<xsl:when test="$position='center'">
<xsl:value-of select="$Version"/>
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$pageclass='titlepage'">
</xsl:when>
<xsl:when test="$position='center'">
<xsl:value-of select="$Version"/>
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!--###################################################
Custom Footer
################################################### -->
<xsl:template name="footer.content">
<xsl:param name="pageclass" select="''"/>
<xsl:param name="sequence" select="''"/>
<xsl:param name="position" select="''"/>
<xsl:param name="gentext-key" select="''"/>
<xsl:variable name="Version">
<xsl:choose>
<xsl:when test="//releaseinfo">
<xsl:value-of select="//releaseinfo"/>
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="Title">
<xsl:value-of select="//title"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="$sequence='blank'">
<xsl:choose>
<xsl:when test="$double.sided != 0 and $position = 'left'">
<xsl:value-of select="$Version"/>
</xsl:when>
<xsl:when test="$double.sided = 0 and $position = 'center'">
</xsl:when>
<xsl:otherwise>
<fo:page-number/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$pageclass='titlepage'">
</xsl:when>
<xsl:when test="$double.sided != 0 and $sequence = 'even' and $position='left'">
<fo:page-number/>
</xsl:when>
<xsl:when test="$double.sided != 0 and $sequence = 'odd' and $position='right'">
<fo:page-number/>
</xsl:when>
<xsl:when test="$double.sided = 0 and $position='right'">
<fo:page-number/>
</xsl:when>
<xsl:when test="$double.sided != 0 and $sequence = 'odd' and $position='left'">
<xsl:value-of select="$Version"/>
</xsl:when>
<xsl:when test="$double.sided != 0 and $sequence = 'even' and $position='right'">
<xsl:value-of select="$Version"/>
</xsl:when>
<xsl:when test="$double.sided = 0 and $position='left'">
<xsl:value-of select="$Version"/>
</xsl:when>
<xsl:when test="$position='center'">
<xsl:value-of select="$Title"/>
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="processing-instruction('hard-pagebreak')">
<fo:block break-before='page'/>
</xsl:template>
<!--###################################################
Extensions
################################################### -->
<!-- These extensions are required for table printing and other stuff -->
<xsl:param name="use.extensions">0</xsl:param>
<xsl:param name="tablecolumns.extension">0</xsl:param>
<xsl:param name="callout.extensions">0</xsl:param>
<xsl:param name="callouts.extensions">0</xsl:param>
<xsl:param name="fop1.extensions">1</xsl:param>
<!--###################################################
Paper & Page Size
################################################### -->
<!-- Paper type, no headers on blank pages, no double sided printing -->
<xsl:param name="double.sided">0</xsl:param>
<xsl:param name="headers.on.blank.pages">0</xsl:param>
<xsl:param name="footers.on.blank.pages">0</xsl:param>
<!--###################################################
Fonts & Styles
################################################### -->
<xsl:param name="hyphenate">false</xsl:param>
<!-- Default Font size -->
<xsl:param name="body.font.master">11</xsl:param>
<xsl:param name="body.font.small">8</xsl:param>
<!-- Line height in body text -->
<xsl:param name="line-height">1.4</xsl:param>
<!-- Chapter title size -->
<xsl:attribute-set name="chapter.titlepage.recto.style">
<xsl:attribute name="text-align">left</xsl:attribute>
<xsl:attribute name="font-weight">bold</xsl:attribute>
<xsl:attribute name="font-size">
<xsl:value-of select="$body.font.master * 1.8"/>
<xsl:text>pt</xsl:text>
</xsl:attribute>
</xsl:attribute-set>
<!-- Why is the font-size for chapters hardcoded in the XSL FO templates?
Let's remove it, so this sucker can use our attribute-set only... -->
<xsl:template match="title" mode="chapter.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format"
xsl:use-attribute-sets="chapter.titlepage.recto.style">
<xsl:call-template name="component.title">
<xsl:with-param name="node" select="ancestor-or-self::chapter[1]"/>
</xsl:call-template>
</fo:block>
</xsl:template>
<!-- Sections 1, 2 and 3 titles have a small bump factor and padding -->
<xsl:attribute-set name="section.title.level1.properties">
<xsl:attribute name="space-before.optimum">0.8em</xsl:attribute>
<xsl:attribute name="space-before.minimum">0.8em</xsl:attribute>
<xsl:attribute name="space-before.maximum">0.8em</xsl:attribute>
<xsl:attribute name="font-size">
<xsl:value-of select="$body.font.master * 1.5"/>
<xsl:text>pt</xsl:text>
</xsl:attribute>
<xsl:attribute name="space-after.optimum">0.1em</xsl:attribute>
<xsl:attribute name="space-after.minimum">0.1em</xsl:attribute>
<xsl:attribute name="space-after.maximum">0.1em</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="section.title.level2.properties">
<xsl:attribute name="space-before.optimum">0.6em</xsl:attribute>
<xsl:attribute name="space-before.minimum">0.6em</xsl:attribute>
<xsl:attribute name="space-before.maximum">0.6em</xsl:attribute>
<xsl:attribute name="font-size">
<xsl:value-of select="$body.font.master * 1.25"/>
<xsl:text>pt</xsl:text>
</xsl:attribute>
<xsl:attribute name="space-after.optimum">0.1em</xsl:attribute>
<xsl:attribute name="space-after.minimum">0.1em</xsl:attribute>
<xsl:attribute name="space-after.maximum">0.1em</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="section.title.level3.properties">
<xsl:attribute name="space-before.optimum">0.4em</xsl:attribute>
<xsl:attribute name="space-before.minimum">0.4em</xsl:attribute>
<xsl:attribute name="space-before.maximum">0.4em</xsl:attribute>
<xsl:attribute name="font-size">
<xsl:value-of select="$body.font.master * 1.0"/>
<xsl:text>pt</xsl:text>
</xsl:attribute>
<xsl:attribute name="space-after.optimum">0.1em</xsl:attribute>
<xsl:attribute name="space-after.minimum">0.1em</xsl:attribute>
<xsl:attribute name="space-after.maximum">0.1em</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="section.title.level4.properties">
<xsl:attribute name="space-before.optimum">0.3em</xsl:attribute>
<xsl:attribute name="space-before.minimum">0.3em</xsl:attribute>
<xsl:attribute name="space-before.maximum">0.3em</xsl:attribute>
<xsl:attribute name="font-size">
<xsl:value-of select="$body.font.master * 0.9"/>
<xsl:text>pt</xsl:text>
</xsl:attribute>
<xsl:attribute name="space-after.optimum">0.1em</xsl:attribute>
<xsl:attribute name="space-after.minimum">0.1em</xsl:attribute>
<xsl:attribute name="space-after.maximum">0.1em</xsl:attribute>
</xsl:attribute-set>
<!-- Use code syntax highlighting -->
<xsl:param name="highlight.source" select="1"/>
<xsl:param name="highlight.default.language" select="xml" />
<xsl:template match='xslthl:keyword'>
<fo:inline font-weight="bold" color="#7F0055"><xsl:apply-templates/></fo:inline>
</xsl:template>
<xsl:template match='xslthl:comment'>
<fo:inline font-style="italic" color="#3F5F5F"><xsl:apply-templates/></fo:inline>
</xsl:template>
<xsl:template match='xslthl:oneline-comment'>
<fo:inline font-style="italic" color="#3F5F5F"><xsl:apply-templates/></fo:inline>
</xsl:template>
<xsl:template match='xslthl:multiline-comment'>
<fo:inline font-style="italic" color="#3F5FBF"><xsl:apply-templates/></fo:inline>
</xsl:template>
<xsl:template match='xslthl:tag'>
<fo:inline color="#3F7F7F"><xsl:apply-templates/></fo:inline>
</xsl:template>
<xsl:template match='xslthl:attribute'>
<fo:inline color="#7F007F"><xsl:apply-templates/></fo:inline>
</xsl:template>
<xsl:template match='xslthl:value'>
<fo:inline color="#2A00FF"><xsl:apply-templates/></fo:inline>
</xsl:template>
<xsl:template match='xslthl:string'>
<fo:inline color="#2A00FF"><xsl:apply-templates/></fo:inline>
</xsl:template>
<!--###################################################
Tables
################################################### -->
<!-- Some padding inside tables -->
<xsl:attribute-set name="table.cell.padding">
<xsl:attribute name="padding-left">4pt</xsl:attribute>
<xsl:attribute name="padding-right">4pt</xsl:attribute>
<xsl:attribute name="padding-top">4pt</xsl:attribute>
<xsl:attribute name="padding-bottom">4pt</xsl:attribute>
</xsl:attribute-set>
<!-- Only hairlines as frame and cell borders in tables -->
<xsl:param name="table.frame.border.thickness">0.1pt</xsl:param>
<xsl:param name="table.cell.border.thickness">0.1pt</xsl:param>
<!--###################################################
Labels
################################################### -->
<!-- Label Chapters and Sections (numbering) -->
<xsl:param name="chapter.autolabel" select="1"/>
<xsl:param name="section.autolabel" select="1"/>
<xsl:param name="section.autolabel.max.depth" select="1"/>
<xsl:param name="section.label.includes.component.label" select="1"/>
<xsl:param name="table.footnote.number.format" select="'1'"/>
<!--###################################################
Programlistings
################################################### -->
<!-- Verbatim text formatting (programlistings) -->
<xsl:attribute-set name="monospace.verbatim.properties">
<xsl:attribute name="font-size">
<xsl:value-of select="$body.font.small * 1.0"/>
<xsl:text>pt</xsl:text>
</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="verbatim.properties">
<xsl:attribute name="space-before.minimum">1em</xsl:attribute>
<xsl:attribute name="space-before.optimum">1em</xsl:attribute>
<xsl:attribute name="space-before.maximum">1em</xsl:attribute>
<xsl:attribute name="space-after.minimum">0.1em</xsl:attribute>
<xsl:attribute name="space-after.optimum">0.1em</xsl:attribute>
<xsl:attribute name="space-after.maximum">0.1em</xsl:attribute>
<xsl:attribute name="border-color">#444444</xsl:attribute>
<xsl:attribute name="border-style">solid</xsl:attribute>
<xsl:attribute name="border-width">0.1pt</xsl:attribute>
<xsl:attribute name="padding-top">0.5em</xsl:attribute>
<xsl:attribute name="padding-left">0.5em</xsl:attribute>
<xsl:attribute name="padding-right">0.5em</xsl:attribute>
<xsl:attribute name="padding-bottom">0.5em</xsl:attribute>
<xsl:attribute name="margin-left">0.5em</xsl:attribute>
<xsl:attribute name="margin-right">0.5em</xsl:attribute>
</xsl:attribute-set>
<!-- Shade (background) programlistings -->
<xsl:param name="shade.verbatim">1</xsl:param>
<xsl:attribute-set name="shade.verbatim.style">
<xsl:attribute name="background-color">#F0F0F0</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="list.block.spacing">
<xsl:attribute name="space-before.optimum">0.1em</xsl:attribute>
<xsl:attribute name="space-before.minimum">0.1em</xsl:attribute>
<xsl:attribute name="space-before.maximum">0.1em</xsl:attribute>
<xsl:attribute name="space-after.optimum">0.1em</xsl:attribute>
<xsl:attribute name="space-after.minimum">0.1em</xsl:attribute>
<xsl:attribute name="space-after.maximum">0.1em</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="example.properties">
<xsl:attribute name="space-before.minimum">0.5em</xsl:attribute>
<xsl:attribute name="space-before.optimum">0.5em</xsl:attribute>
<xsl:attribute name="space-before.maximum">0.5em</xsl:attribute>
<xsl:attribute name="space-after.minimum">0.1em</xsl:attribute>
<xsl:attribute name="space-after.optimum">0.1em</xsl:attribute>
<xsl:attribute name="space-after.maximum">0.1em</xsl:attribute>
<xsl:attribute name="keep-together.within-column">always</xsl:attribute>
</xsl:attribute-set>
<!--###################################################
Title information for Figures, Examples etc.
################################################### -->
<xsl:attribute-set name="formal.title.properties" use-attribute-sets="normal.para.spacing">
<xsl:attribute name="font-weight">normal</xsl:attribute>
<xsl:attribute name="font-style">italic</xsl:attribute>
<xsl:attribute name="font-size">
<xsl:value-of select="$body.font.master"/>
<xsl:text>pt</xsl:text>
</xsl:attribute>
<xsl:attribute name="hyphenate">false</xsl:attribute>
<xsl:attribute name="space-before.minimum">0.1em</xsl:attribute>
<xsl:attribute name="space-before.optimum">0.1em</xsl:attribute>
<xsl:attribute name="space-before.maximum">0.1em</xsl:attribute>
</xsl:attribute-set>
<!--###################################################
Callouts
################################################### -->
<!-- don't use images for callouts -->
<xsl:param name="callout.graphics">0</xsl:param>
<xsl:param name="callout.unicode">1</xsl:param>
<!-- Place callout marks at this column in annotated areas -->
<xsl:param name="callout.defaultcolumn">90</xsl:param>
<!--###################################################
Misc
################################################### -->
<!-- Placement of titles -->
<xsl:param name="formal.title.placement">
figure after
example after
equation before
table before
procedure before
</xsl:param>
<!-- Format Variable Lists as Blocks (prevents horizontal overflow) -->
<xsl:param name="variablelist.as.blocks">1</xsl:param>
<xsl:param name="body.start.indent">0pt</xsl:param>
<!-- Show only Sections up to level 3 in the TOCs -->
<xsl:param name="toc.section.depth">3</xsl:param>
<!-- Remove "Chapter" from the Chapter titles... -->
<xsl:param name="local.l10n.xml" select="document('')"/>
<l:i18n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">
<l:l10n language="en">
<l:context name="title-numbered">
<l:template name="chapter" text="%n.&#160;%t"/>
<l:template name="section" text="%n&#160;%t"/>
</l:context>
<l:context name="title">
<l:template name="example" text="Example&#160;%n&#160;%t"/>
</l:context>
</l:l10n>
</l:i18n>
<!--###################################################
colored and hyphenated links
################################################### -->
<xsl:template match="ulink">
<fo:basic-link external-destination="{@url}"
xsl:use-attribute-sets="xref.properties"
text-decoration="underline"
color="blue">
<xsl:choose>
<xsl:when test="count(child::node())=0">
<xsl:value-of select="@url"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</fo:basic-link>
</xsl:template>
<xsl:template match="link">
<fo:basic-link internal-destination="{@linkend}"
xsl:use-attribute-sets="xref.properties"
text-decoration="underline"
color="blue">
<xsl:choose>
<xsl:when test="count(child::node())=0">
<xsl:value-of select="@linkend"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</fo:basic-link>
</xsl:template>
</xsl:stylesheet>

View File

@@ -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

Binary file not shown.

View File

@@ -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

110
gradlew vendored
View File

@@ -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 "$@"

54
gradlew.bat vendored
View File

@@ -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
:omega

View File

@@ -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'
}
}
}
}

View File

@@ -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'

View File

@@ -1,5 +1 @@
rootProject.name = 'spring-data-gemfire'
include 'docs'
docs = findProject(':docs')

View File

@@ -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.
* <p>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.
*
* <p>
* 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<GemFireCache>, 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<String, String> attributes;
private List<ConfigProperty> props;
public Map<String, String> getAttributes() {
return attributes;
}
public void setAttributes(Map<String, String> attributes) {
this.attributes = attributes;
}
public List<ConfigProperty> getProps() {
return props;
}
public void setProps(List<ConfigProperty> 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<TransactionListener> transactionListeners;
protected TransactionWriter transactionWriter;
protected Float evictionHeapPercentage;
protected Float criticalHeapPercentage;
protected DynamicRegionSupport dynamicRegionSupport;
protected List<JndiDataSource> 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<? extends GemFireCache> 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<TransactionListener> transactionListeners) {
this.transactionListeners = transactionListeners;
}
public void setTransactionWriter(TransactionWriter transactionWriter) {
this.transactionWriter = transactionWriter;
}
public void setDynamicRegionSupport(DynamicRegionSupport dynamicRegionSupport) {
this.dynamicRegionSupport = dynamicRegionSupport;
}
public void setJndiDataSources(List<JndiDataSource> jndiDataSources) {
this.jndiDataSources = jndiDataSources;
}
}

View File

@@ -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

View File

@@ -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<DiskStore>, 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<DiskDir> 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<DiskDir> 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;
}
}
}

View File

@@ -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.

View File

@@ -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.

View File

@@ -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.

View File

@@ -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.

View File

@@ -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.

View File

@@ -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.

View File

@@ -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.

View File

@@ -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.

View File

@@ -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.

View File

@@ -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.

View File

@@ -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.
*
* <p>
* 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 <i>not</i> 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 <i>not</i> able
* to provide XA transactions, for example to share transactions with data
* access.
*
* <p>
* To prevent dirty reads, by default, the cache is configured to return copies rather then direct references for
* <code>get</code> 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 <code>get</code> 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.
* <p/>
* 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 <code>false</code>. However, unless there is a measurable
* performance penalty, the recommendation is to keep this setting to <code>true</code>
*
* @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.
* <p/>
* 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 <code>false</code>. However, unless there
* is a measurable performance penalty, the recommendation is to keep this
* setting to <code>true</code>
*
* @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;
}

View File

@@ -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.

View File

@@ -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<K, V> extends RegionFactoryBean<K, V> {
@Override
protected void resolveDataPolicy(RegionFactory<K, V> 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.");
}
}
}
}

View File

@@ -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.

View File

@@ -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<K, V> extends RegionFactoryBean<K, V> {
@Override
protected void resolveDataPolicy(RegionFactory<K, V> 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);
}
}
}

View File

@@ -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<RegionAttributes>,
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;
}
}

View File

@@ -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<K, V> extends RegionLookupFactoryBean<K, V> implements DisposableBean {
public abstract class RegionFactoryBean<K, V> extends RegionLookupFactoryBean<K, V> implements DisposableBean {
protected final Log log = LogFactory.getLog(getClass());
private boolean destroy = false;
private boolean close = true;
private Resource snapshot;
private CacheListener<K, V> cacheListeners[];
private CacheLoader<K, V> cacheLoader;
private CacheWriter<K, V> cacheWriter;
private RegionAttributes<K, V> attributes;
private Scope scope;
private DataPolicy dataPolicy;
private boolean persistent;
private String diskStoreName;
private String dataPolicyName;
private Region<K, V> region;
private List<Region<?, ?>> subRegions;
@Override
public void afterPropertiesSet() throws Exception {
@@ -73,7 +90,6 @@ public class RegionFactoryBean<K, V> extends RegionLookupFactoryBean<K, V> imple
postProcess(region);
}
@Override
protected Region<K, V> 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<K, V> extends RegionLookupFactoryBean<K, V> imple
if (attributes != null)
AttributesFactory.validateAttributes(attributes);
final RegionFactory<K, V> regionFactory = (attributes != null ? c.createRegionFactory(attributes)
: c.<K, V> createRegionFactory());
final RegionFactory<K, V> regionFactory = (attributes != null ? c.createRegionFactory(attributes) : c
.<K, V> createRegionFactory());
if (!ObjectUtils.isEmpty(cacheListeners)) {
for (CacheListener<K, V> listener : cacheListeners) {
@@ -100,14 +116,20 @@ public class RegionFactoryBean<K, V> extends RegionLookupFactoryBean<K, V> 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<K, V> extends RegionLookupFactoryBean<K, V> imple
reg.loadSnapshot(snapshot.getInputStream());
}
if (attributes != null && attributes.isLockGrantor()) {
reg.becomeLockGrantor();
}
return reg;
}
protected abstract void resolveDataPolicy(RegionFactory<K, V> regionFactory, boolean persistent,
String dataPolicyName);
@SuppressWarnings("unchecked")
private AttributesFactory<K, V> findAttrFactory(RegionFactory<K, V> regionFactory) {
Field attrField = ReflectionUtils.findField(RegionFactory.class, "attrsFactory", AttributesFactory.class);
@@ -127,24 +156,24 @@ public class RegionFactoryBean<K, V> extends RegionLookupFactoryBean<K, V> imple
return (AttributesFactory<K, V>) 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<K, V> 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<K, V> extends RegionLookupFactoryBean<K, V> 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<K, V> extends RegionLookupFactoryBean<K, V> 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<K, V> extends RegionLookupFactoryBean<K, V> 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<K, V> extends RegionLookupFactoryBean<K, V> imple
}
/**
* Sets the snapshots used for loading a newly <i>created</i> region.
* That is, the snapshot will be used <i>only</i> when a new region is created - if the region
* already exists, no loading will be performed.
* Sets the snapshots used for loading a newly <i>created</i> region. That
* is, the snapshot will be used <i>only</i> 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<K, V> extends RegionLookupFactoryBean<K, V> 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<K, V> extends RegionLookupFactoryBean<K, V> imple
this.cacheListeners = cacheListeners;
}
public void setSubRegions(List<Region<?, ?>> 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<K, V> extends RegionLookupFactoryBean<K, V> 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<K, V> extends RegionLookupFactoryBean<K, V> 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<K, V> extends RegionLookupFactoryBean<K, V> 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
*/

View File

@@ -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.

View File

@@ -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<K, V> extends RegionFactoryBean<K, V> {
@Override
protected void resolveDataPolicy(RegionFactory<K, V> 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);
}
}

View File

@@ -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 <K> - Region Key Type
* @param <V> - Region Value Type
*/
public class SubRegionFactoryBean<K, V> extends AttributesFactory<K, V> implements FactoryBean<Region<K, V>>,
InitializingBean {
protected final Log log = LogFactory.getLog(getClass());
@SuppressWarnings("unused")
private String name;
private String regionName;
private Region<K, V> 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<K, V> 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
* &lt;lookup-region&gt;
* @param lookupOnly
*/
public void setLookupOnly(boolean lookupOnly) {
this.lookupOnly = lookupOnly;
}
}

View File

@@ -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.

View File

@@ -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.

View File

@@ -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<K, V> extends RegionLookupFactoryBean<K, V> implements BeanFactoryAware,
DisposableBean {
@@ -51,19 +52,28 @@ public class ClientRegionFactoryBean<K, V> extends RegionLookupFactoryBean<K, V>
private static final Log log = LogFactory.getLog(ClientRegionFactoryBean.class);
private boolean destroy = false;
private boolean close = true;
private Resource snapshot;
private CacheListener<K, V> cacheListeners[];
private Interest<K>[] interests;
private String poolName;
private BeanFactory beanFactory;
private ClientRegionShortcut shortcut = null;
private DataPolicy dataPolicy;
private RegionAttributes<K, V> attributes;
private Region<K, V> region;
private String diskStoreName;
@Override
public void afterPropertiesSet() throws Exception {
@@ -76,12 +86,11 @@ public class ClientRegionFactoryBean<K, V> extends RegionLookupFactoryBean<K, V>
protected Region<K, V> 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<K, V> extends RegionLookupFactoryBean<K, V>
else {
s = ClientRegionShortcut.LOCAL;
}
} else {
}
else {
s = shortcut;
}
@@ -154,6 +164,10 @@ public class ClientRegionFactoryBean<K, V> extends RegionLookupFactoryBean<K, V>
factory.setPoolName(poolName);
}
if (diskStoreName != null) {
factory.setDiskStoreName(diskStoreName);
}
Region<K, V> reg = factory.create(regionName);
log.info("Created new cache region [" + regionName + "]");
if (snapshot != null) {
@@ -179,6 +193,7 @@ public class ClientRegionFactoryBean<K, V> extends RegionLookupFactoryBean<K, V>
}
}
@Override
public void destroy() throws Exception {
Region<K, V> region = getObject();
// unregister interests
@@ -193,8 +208,10 @@ public class ClientRegionFactoryBean<K, V> extends RegionLookupFactoryBean<K, V>
}
}
}
// 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<K, V> extends RegionLookupFactoryBean<K, V>
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<K, V> extends RegionLookupFactoryBean<K, V>
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<K, V> extends RegionLookupFactoryBean<K, V>
}
/**
* 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<K, V> extends RegionLookupFactoryBean<K, V>
}
/**
* 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<K, V> extends RegionLookupFactoryBean<K, V>
}
/**
* 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<K, V> extends RegionLookupFactoryBean<K, V>
}
/**
* Sets the snapshots used for loading a newly <i>created</i> region.
* That is, the snapshot will be used <i>only</i> when a new region is created - if the region
* already exists, no loading will be performed.
* Sets the snapshots used for loading a newly <i>created</i> region. That
* is, the snapshot will be used <i>only</i> 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<K, V> extends RegionLookupFactoryBean<K, V>
}
/**
* 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<K, V> extends RegionLookupFactoryBean<K, V>
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
*/

View File

@@ -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.

View File

@@ -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.

View File

@@ -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.

Some files were not shown because too many files have changed in this diff Show More