geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dschnei...@apache.org
Subject [13/20] incubator-geode git commit: GEODE-14: Imported modules from geode-1.0.0-SNAPSHOT-2.src.tar
Date Mon, 06 Jul 2015 21:46:34 GMT
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4b56f5e4/modules/gemfire-modules-assembly/release/tomcat/readme.txt
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-assembly/release/tomcat/readme.txt b/modules/gemfire-modules-assembly/release/tomcat/readme.txt
new file mode 100644
index 0000000..4830780
--- /dev/null
+++ b/modules/gemfire-modules-assembly/release/tomcat/readme.txt
@@ -0,0 +1,14 @@
+Pivotal(TM) GemFire(R) HTTP Session Management Module @VERSION@ for Tomcat
+
+This module provides fast, scalable, and reliable HTTP session replication for Apache Tomcat.
+
+Access all Pivotal GemFire Documentation at:
+http://gemfire.docs.pivotal.io
+
+Pivotal Support Services can be accessed from the Pivotal or VMware website.
+Access varies by license type, support offering (contract or per-incident) and 
+product. Please see the Pivotal page at http://www.pivotal.io/support or to 
+file a VMware Support Request, please see the VMware page at 
+https://www.vmware.com/support/policies/howto.html for information on "How to 
+File a Support Request."
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4b56f5e4/modules/gemfire-modules-assembly/src/main/assembly/distribution_hibernate.xml
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-assembly/src/main/assembly/distribution_hibernate.xml b/modules/gemfire-modules-assembly/src/main/assembly/distribution_hibernate.xml
new file mode 100644
index 0000000..30fe65c
--- /dev/null
+++ b/modules/gemfire-modules-assembly/src/main/assembly/distribution_hibernate.xml
@@ -0,0 +1,62 @@
+<assembly
+    xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
+  <id>Hibernate</id>
+
+  <!--
+  This assembly descriptor produces output like:
+    README.txt
+    lib/
+      gemfire.modules-version.jar
+  -->
+
+  <!-- Format as zip and tar.gz -->
+  <formats>
+    <format>zip</format>
+  </formats>
+
+  <!-- Don't include a base directory -->
+  <includeBaseDirectory>false</includeBaseDirectory>
+
+  <dependencySets>
+    <dependencySet>
+      <outputFileNameMapping>
+        ${artifact.artifactId}-${artifact.version}.${artifact.extension}
+      </outputFileNameMapping>
+      <outputDirectory>lib</outputDirectory>
+      <includes>
+        <include>com.gemstone:gemfire-modules-hibernate</include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </dependencySet>
+  </dependencySets>
+
+  <!-- Include project jar and readme -->
+  <fileSets>
+
+    <!--  Include readme file -->
+    <fileSet>
+      <directory>${project.basedir}/target/release/hibernate</directory>
+      <outputDirectory></outputDirectory>
+      <includes>
+        <include>readme.txt</include>
+      </includes>
+    </fileSet>
+
+    <!--  Don't include in GA releases
+    <fileSet>
+      <directory>${project.basedir}</directory>
+      <includes>
+        <include>
+          GFModules_ReleaseNotes.txt
+        </include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet> -->
+
+  </fileSets>
+
+</assembly>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4b56f5e4/modules/gemfire-modules-assembly/src/main/assembly/distribution_session.xml
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-assembly/src/main/assembly/distribution_session.xml b/modules/gemfire-modules-assembly/src/main/assembly/distribution_session.xml
new file mode 100644
index 0000000..f140a3d
--- /dev/null
+++ b/modules/gemfire-modules-assembly/src/main/assembly/distribution_session.xml
@@ -0,0 +1,134 @@
+<assembly>
+  <id>AppServer</id>
+  <formats>
+    <format>zip</format>
+  </formats>
+  <includeBaseDirectory>false</includeBaseDirectory>
+
+  <dependencySets>
+    <dependencySet>
+      <outputDirectory>lib</outputDirectory>
+      <includes>
+        <include>com.gemstone:gemfire-modules</include>
+        <include>com.gemstone:gemfire-modules-session</include>
+        <include>com.gemstone:gemfire-modules-session-external</include>
+        <include>org.slf4j:slf4j-api</include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </dependencySet>
+
+    <dependencySet>
+      <outputDirectory>lib</outputDirectory>
+      <includes>
+        <include>com.gemstone:gemfire-modules-slf4j-weblogic</include>
+        <include>javax.servlet:servlet-api</include>
+        <include>org.slf4j:slf4j-jdk14</include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+      <scope>provided</scope>
+    </dependencySet>
+  </dependencySets>
+
+  <files>
+    <file>
+      <source>${project.basedir}/release/session/bin/modify_war</source>
+      <outputDirectory>bin</outputDirectory>
+      <filtered>true</filtered>
+      <fileMode>0755</fileMode>
+    </file>
+    <file>
+      <source>${project.basedir}/release/session/bin/cacheserver.sh</source>
+      <outputDirectory>bin</outputDirectory>
+      <filtered>true</filtered>
+      <fileMode>0755</fileMode>
+    </file>
+    <file>
+      <source>${project.basedir}/release/session/bin/cacheserver.bat</source>
+      <outputDirectory>bin</outputDirectory>
+      <filtered>true</filtered>
+      <fileMode>0755</fileMode>
+    </file>
+    <file>
+      <source>${project.basedir}/release/session/bin/gemfire.sh</source>
+      <outputDirectory>bin</outputDirectory>
+      <filtered>true</filtered>
+      <fileMode>0755</fileMode>
+    </file>
+    <file>
+      <source>${project.basedir}/release/session/bin/gemfire.bat</source>
+      <outputDirectory>bin</outputDirectory>
+      <filtered>true</filtered>
+      <fileMode>0755</fileMode>
+    </file>
+    <file>
+      <source>${project.basedir}/release/session/bin/setenv.properties</source>
+      <outputDirectory>bin</outputDirectory>
+      <fileMode>0644</fileMode>
+    </file>
+  </files>
+
+  <fileSets>
+    <fileSet>
+      <directory>${project.build.directory}</directory>
+      <outputDirectory>lib</outputDirectory>
+      <includes>
+        <include>${project.artifactId}-${project.version}.jar</include>
+      </includes>
+      <fileMode>0644</fileMode>
+      <directoryMode>0755</directoryMode>
+    </fileSet>
+
+    <fileSet>
+      <directory>${basedir}/release/session/conf</directory>
+      <outputDirectory>conf</outputDirectory>
+      <fileMode>0644</fileMode>
+      <directoryMode>0755</directoryMode>
+    </fileSet>
+
+    <!-- This exists to get directory permissions right -->
+    <fileSet>
+      <directory>${basedir}/release/bin</directory>
+      <outputDirectory>bin</outputDirectory>
+      <excludes>
+        <exclude>*</exclude>
+      </excludes>
+      <fileMode>0644</fileMode>
+      <directoryMode>0755</directoryMode>
+    </fileSet>
+
+    <!-- Comment out for GA release
+    <fileSet>
+      <directory>${project.basedir}</directory>
+      <includes>
+        <include>
+          GFModules_ReleaseNotes.txt
+        </include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet> -->
+
+    <!-- Include 3rd party OSS/TP file -->
+    <fileSet>
+      <directory>${project.basedir}/release/3rdparty_license</directory>
+      <outputDirectory>lib</outputDirectory>
+      <includes>
+        <include>
+          open_source_licenses-Pivotal_GemFire_Modules_8.1.0.txt
+        </include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet>
+
+    <fileSet>
+      <directory>${project.basedir}/target/release/session</directory>
+      <outputDirectory></outputDirectory>
+      <includes>
+        <include>readme.txt</include>
+      </includes>
+    </fileSet>
+  </fileSets>
+</assembly>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4b56f5e4/modules/gemfire-modules-assembly/src/main/assembly/distribution_tcserver.xml
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-assembly/src/main/assembly/distribution_tcserver.xml b/modules/gemfire-modules-assembly/src/main/assembly/distribution_tcserver.xml
new file mode 100644
index 0000000..0b1dc0d
--- /dev/null
+++ b/modules/gemfire-modules-assembly/src/main/assembly/distribution_tcserver.xml
@@ -0,0 +1,53 @@
+<assembly
+    xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
+  <id>tcServer</id>
+
+  <!--
+  This assembly descriptor produces output like:
+    gemfire-p2p
+      bin
+        gemfire.sh
+        gemfire.bat
+      conf/
+        cache-peer.xml
+        context-fragment.xml
+      configuration-prompts.properties
+      lib/
+        gemfire.modules-version.jar
+        gemfire.jar
+    gemfire-cs
+      bin
+        cacheserver.sh
+        cacheserver.bat
+        gemfire.sh
+        gemfire.bat
+      conf/
+        cache-client.xml
+        cache-server.xml
+        context-fragment.xml
+      configuration-prompts.properties
+      lib/
+        gemfire.modules-version.jar
+        gemfire.jar
+  -->
+
+  <!-- Format as zip and tar.gz -->
+  <formats>
+    <format>zip</format>
+  </formats>
+
+  <!-- Don't include a base directory -->
+  <includeBaseDirectory>false</includeBaseDirectory>
+
+  <componentDescriptors>
+    <componentDescriptor>
+      src/main/assembly/distribution_tcserver_template_cs.xml
+    </componentDescriptor>
+    <componentDescriptor>
+      src/main/assembly/distribution_tcserver_template_p2p.xml
+    </componentDescriptor>
+  </componentDescriptors>
+
+</assembly>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4b56f5e4/modules/gemfire-modules-assembly/src/main/assembly/distribution_tcserver30.xml
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-assembly/src/main/assembly/distribution_tcserver30.xml b/modules/gemfire-modules-assembly/src/main/assembly/distribution_tcserver30.xml
new file mode 100644
index 0000000..b16efd7
--- /dev/null
+++ b/modules/gemfire-modules-assembly/src/main/assembly/distribution_tcserver30.xml
@@ -0,0 +1,53 @@
+<assembly
+    xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
+  <id>tcServer30</id>
+
+  <!--
+  This assembly descriptor produces output like:
+    gemfire-p2p
+      bin
+        gemfire.sh
+        gemfire.bat
+      conf/
+        cache-peer.xml
+        context-fragment.xml
+      configuration-prompts.properties
+      lib/
+        gemfire.modules-version.jar
+        gemfire.jar
+    gemfire-cs
+      bin
+        cacheserver.sh
+        cacheserver.bat
+        gemfire.sh
+        gemfire.bat
+      conf/
+        cache-client.xml
+        cache-server.xml
+        context-fragment.xml
+      configuration-prompts.properties
+      lib/
+        gemfire.modules-version.jar
+        gemfire.jar
+  -->
+
+  <!-- Format as zip and tar.gz -->
+  <formats>
+    <format>zip</format>
+  </formats>
+
+  <!-- Don't include a base directory -->
+  <includeBaseDirectory>false</includeBaseDirectory>
+
+  <componentDescriptors>
+    <componentDescriptor>
+      src/main/assembly/distribution_tcserver30_template_cs.xml
+    </componentDescriptor>
+    <componentDescriptor>
+      src/main/assembly/distribution_tcserver30_template_p2p.xml
+    </componentDescriptor>
+  </componentDescriptors>
+
+</assembly>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4b56f5e4/modules/gemfire-modules-assembly/src/main/assembly/distribution_tcserver30_template_cs.xml
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-assembly/src/main/assembly/distribution_tcserver30_template_cs.xml b/modules/gemfire-modules-assembly/src/main/assembly/distribution_tcserver30_template_cs.xml
new file mode 100644
index 0000000..a9bd894
--- /dev/null
+++ b/modules/gemfire-modules-assembly/src/main/assembly/distribution_tcserver30_template_cs.xml
@@ -0,0 +1,196 @@
+<component>
+
+  <!-- Include gemfire.jar with no version -->
+  <dependencySets>
+    <dependencySet>
+      <outputDirectory>gemfire-cs/lib</outputDirectory>
+      <includes>
+        <include>com.gemstone:gemfire-modules</include>
+        <include>com.gemstone:gemfire-modules-tomcat7</include>
+        <include>org.slf4j:slf4j-api</include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </dependencySet>
+
+    <!-- Need a separate set for artifacts with 'provided' scope -->
+    <dependencySet>
+      <outputDirectory>gemfire-cs/lib</outputDirectory>
+      <includes>
+        <include>org.slf4j:slf4j-jdk14</include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+      <scope>provided</scope>
+    </dependencySet>
+  </dependencySets>
+
+  <files>
+    <file>
+      <source>${project.basedir}/release/scripts/cacheserver.sh</source>
+      <outputDirectory>gemfire-cs/bin</outputDirectory>
+      <filtered>true</filtered>
+      <fileMode>0755</fileMode>
+    </file>
+    <file>
+      <source>${project.basedir}/release/scripts/cacheserver.bat</source>
+      <outputDirectory>gemfire-cs/bin</outputDirectory>
+      <filtered>true</filtered>
+      <fileMode>0755</fileMode>
+    </file>
+  </files>
+
+  <fileSets>
+
+    <!--  Include scripts -->
+    <fileSet>
+      <directory>${project.basedir}/release/scripts</directory>
+      <outputDirectory>gemfire-cs/bin</outputDirectory>
+      <excludes>
+        <exclude>cacheserver.*</exclude>
+      </excludes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet>
+
+    <!--  Include conf directory files -->
+    <fileSet>
+      <directory>${project.basedir}/release/conf</directory>
+      <outputDirectory>gemfire-cs/conf</outputDirectory>
+      <includes>
+        <include>cache-client.xml</include>
+        <include>cache-server.xml</include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet>
+
+    <!--  Include template fragment file -->
+    <fileSet>
+      <directory>${project.basedir}/release/tcserver/gemfire-cs</directory>
+      <outputDirectory>gemfire-cs/conf</outputDirectory>
+      <includes>
+        <include>context-fragment.xml</include>
+        <include>server-fragment.xml</include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet>
+
+    <fileSet>
+      <directory>${project.basedir}/release/tcserver/gemfire-cs</directory>
+      <outputDirectory>gemfire-cs/bin</outputDirectory>
+      <includes>
+        <include>modules.env</include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet>
+
+    <!--  Include configuration prompts file -->
+    <fileSet>
+      <directory>${project.basedir}/release/tcserver/gemfire-cs</directory>
+      <outputDirectory>gemfire-cs</outputDirectory>
+      <includes>
+        <include>configuration-prompts.properties</include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet>
+
+    <fileSet>
+      <directory>${project.basedir}/target/release/tcserver/gemfire-cs
+      </directory>
+      <outputDirectory>gemfire-cs</outputDirectory>
+      <includes>
+        <include>README.txt</include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet>
+
+    <!--  Include template fragment file for Tomcat 7 -->
+    <fileSet>
+      <directory>${project.basedir}/release/tcserver/gemfire-cs-tomcat-7
+      </directory>
+      <outputDirectory>gemfire-cs-tomcat-7/bin</outputDirectory>
+      <includes>
+        <include>modules.env</include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet>
+
+    <fileSet>
+      <directory>${project.basedir}/release/tcserver/gemfire-cs-tomcat-7
+      </directory>
+      <outputDirectory>gemfire-cs-tomcat-7/conf</outputDirectory>
+      <includes>
+        <include>context-fragment.xml</include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet>
+
+    <!--  Include template fragment file for Tomcat 8 -->
+    <fileSet>
+      <directory>${project.basedir}/release/tcserver/gemfire-cs-tomcat-8
+      </directory>
+      <outputDirectory>gemfire-cs-tomcat-8/bin</outputDirectory>
+      <includes>
+        <include>modules.env</include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet>
+
+    <fileSet>
+      <directory>${project.basedir}/release/tcserver/gemfire-cs-tomcat-8
+      </directory>
+      <outputDirectory>gemfire-cs-tomcat-8/conf</outputDirectory>
+      <includes>
+        <include>context-fragment.xml</include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet>
+
+    <!-- Include project jar -->
+    <fileSet>
+      <directory>${project.build.directory}</directory>
+      <outputDirectory>gemfire-cs/lib</outputDirectory>
+      <includes>
+        <include>${project.artifactId}-${project.version}.jar</include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet>
+
+    <!-- Comment out for GA release
+    <fileSet>
+      <directory>${project.basedir}</directory>
+      <includes>
+        <include>
+          GFModules_ReleaseNotes.txt
+        </include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet> -->
+
+    <!-- Include 3rd party OSS/TP file -->
+    <fileSet>
+      <directory>${project.basedir}/release/3rdparty_license</directory>
+      <outputDirectory>gemfire-cs/lib</outputDirectory>
+      <includes>
+        <include> 
+          open_source_licenses-Pivotal_GemFire_Modules_8.1.0.txt
+        </include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet>
+
+  </fileSets>
+
+</component>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4b56f5e4/modules/gemfire-modules-assembly/src/main/assembly/distribution_tcserver30_template_p2p.xml
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-assembly/src/main/assembly/distribution_tcserver30_template_p2p.xml b/modules/gemfire-modules-assembly/src/main/assembly/distribution_tcserver30_template_p2p.xml
new file mode 100644
index 0000000..8f3da24
--- /dev/null
+++ b/modules/gemfire-modules-assembly/src/main/assembly/distribution_tcserver30_template_p2p.xml
@@ -0,0 +1,179 @@
+<component>
+
+  <!-- Include gemfire.jar with no version -->
+  <dependencySets>
+    <dependencySet>
+      <outputDirectory>gemfire-p2p/lib</outputDirectory>
+      <includes>
+        <include>com.gemstone:gemfire-modules</include>
+        <include>com.gemstone:gemfire-modules-tomcat7</include>
+        <include>org.slf4j:slf4j-api</include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </dependencySet>
+
+    <!-- Need a separate set for artifacts with 'provided' scope -->
+    <dependencySet>
+      <outputDirectory>gemfire-p2p/lib</outputDirectory>
+      <includes>
+        <include>org.slf4j:slf4j-jdk14</include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+      <scope>provided</scope>
+    </dependencySet>
+  </dependencySets>
+
+  <fileSets>
+
+    <!--  Include scripts -->
+    <fileSet>
+      <directory>${project.basedir}/release/scripts</directory>
+      <outputDirectory>gemfire-p2p/bin</outputDirectory>
+      <excludes>
+        <exclude>cacheserver.*</exclude>
+      </excludes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet>
+
+    <!--  Include conf directory files -->
+    <fileSet>
+      <directory>${project.basedir}/release/conf</directory>
+      <outputDirectory>gemfire-p2p/conf</outputDirectory>
+      <includes>
+        <include>cache-peer.xml</include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet>
+
+    <!--  Include template fragment file -->
+    <fileSet>
+      <directory>${project.basedir}/release/tcserver/gemfire-p2p</directory>
+      <outputDirectory>gemfire-p2p/conf</outputDirectory>
+      <includes>
+        <include>context-fragment.xml</include>
+        <include>server-fragment.xml</include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet>
+
+    <fileSet>
+      <directory>${project.basedir}/release/tcserver/gemfire-p2p</directory>
+      <outputDirectory>gemfire-p2p/bin</outputDirectory>
+      <includes>
+        <include>modules.env</include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet>
+
+    <!--  Include configuration prompts file -->
+    <fileSet>
+      <directory>${project.basedir}/release/tcserver/gemfire-p2p</directory>
+      <outputDirectory>gemfire-p2p</outputDirectory>
+      <includes>
+        <include>configuration-prompts.properties</include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet>
+
+    <fileSet>
+      <directory>${project.basedir}/target/release/tcserver/gemfire-p2p
+      </directory>
+      <outputDirectory>gemfire-p2p</outputDirectory>
+      <includes>
+        <include>README.txt</include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet>
+
+    <!--  Include template fragment file for Tomcat 7 -->
+    <fileSet>
+      <directory>${project.basedir}/release/tcserver/gemfire-p2p-tomcat-7
+      </directory>
+      <outputDirectory>gemfire-p2p-tomcat-7/bin</outputDirectory>
+      <includes>
+        <include>modules.env</include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet>
+
+    <fileSet>
+      <directory>${project.basedir}/release/tcserver/gemfire-p2p-tomcat-7
+      </directory>
+      <outputDirectory>gemfire-p2p-tomcat-7/conf</outputDirectory>
+      <includes>
+        <include>context-fragment.xml</include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet>
+
+    <!--  Include template fragment file for Tomcat 8 -->
+    <fileSet>
+      <directory>${project.basedir}/release/tcserver/gemfire-p2p-tomcat-8
+      </directory>
+      <outputDirectory>gemfire-p2p-tomcat-8/bin</outputDirectory>
+      <includes>
+        <include>modules.env</include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet>
+
+    <fileSet>
+      <directory>${project.basedir}/release/tcserver/gemfire-p2p-tomcat-8
+      </directory>
+      <outputDirectory>gemfire-p2p-tomcat-8/conf</outputDirectory>
+      <includes>
+        <include>context-fragment.xml</include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet>
+
+    <!-- Comment out for GA release
+    <fileSet>
+      <directory>${project.basedir}</directory>
+      <includes>
+        <include>
+          GFModules_ReleaseNotes.txt
+        </include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet> -->
+
+    <!-- Include 3rd party OSS/TP file -->
+    <fileSet>
+      <directory>${project.basedir}/release/3rdparty_license</directory>
+      <outputDirectory>gemfire-p2p/lib</outputDirectory>
+      <includes>
+        <include>
+          open_source_licenses-Pivotal_GemFire_Modules_8.1.0.txt
+        </include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet>
+
+    <!-- Include project jar -->
+    <fileSet>
+      <directory>${project.build.directory}</directory>
+      <outputDirectory>gemfire-p2p/lib</outputDirectory>
+      <includes>
+        <include>${project.artifactId}-${project.version}.jar</include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet>
+  </fileSets>
+
+</component>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4b56f5e4/modules/gemfire-modules-assembly/src/main/assembly/distribution_tcserver_template_cs.xml
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-assembly/src/main/assembly/distribution_tcserver_template_cs.xml b/modules/gemfire-modules-assembly/src/main/assembly/distribution_tcserver_template_cs.xml
new file mode 100644
index 0000000..c1f6d4f
--- /dev/null
+++ b/modules/gemfire-modules-assembly/src/main/assembly/distribution_tcserver_template_cs.xml
@@ -0,0 +1,172 @@
+<component>
+
+  <!-- Include gemfire.jar with no version -->
+  <dependencySets>
+    <dependencySet>
+      <outputDirectory>gemfire-cs/lib</outputDirectory>
+      <includes>
+        <include>com.gemstone:gemfire-modules</include>
+        <include>com.gemstone:gemfire-modules-tomcat7</include>
+        <include>org.slf4j:slf4j-api</include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </dependencySet>
+
+    <!-- Need a separate set for artifacts with 'provided' scope -->
+    <dependencySet>
+      <outputDirectory>gemfire-cs/lib</outputDirectory>
+      <includes>
+        <include>org.slf4j:slf4j-jdk14</include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+      <scope>provided</scope>
+    </dependencySet>
+  </dependencySets>
+
+  <files>
+    <file>
+      <source>${project.basedir}/release/scripts/cacheserver.sh</source>
+      <outputDirectory>gemfire-cs/bin</outputDirectory>
+      <filtered>true</filtered>
+      <fileMode>0755</fileMode>
+    </file>
+    <file>
+      <source>${project.basedir}/release/scripts/cacheserver.bat</source>
+      <outputDirectory>gemfire-cs/bin</outputDirectory>
+      <filtered>true</filtered>
+      <fileMode>0755</fileMode>
+    </file>
+  </files>
+
+  <fileSets>
+
+    <!--  Include scripts -->
+    <fileSet>
+      <directory>${project.basedir}/release/scripts</directory>
+      <outputDirectory>gemfire-cs/bin</outputDirectory>
+      <excludes>
+        <exclude>cacheserver.*</exclude>
+      </excludes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet>
+
+    <!--  Include conf directory files -->
+    <fileSet>
+      <directory>${project.basedir}/release/conf</directory>
+      <outputDirectory>gemfire-cs/conf</outputDirectory>
+      <includes>
+        <include>cache-client.xml</include>
+        <include>cache-server.xml</include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet>
+
+    <!--  Include template fragment file -->
+    <fileSet>
+      <directory>${project.basedir}/release/tcserver/gemfire-cs</directory>
+      <outputDirectory>gemfire-cs/conf</outputDirectory>
+      <includes>
+        <include>context-fragment.xml</include>
+        <include>server-fragment.xml</include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet>
+
+    <fileSet>
+      <directory>${project.basedir}/release/tcserver/gemfire-cs</directory>
+      <outputDirectory>gemfire-cs/bin</outputDirectory>
+      <includes>
+        <include>modules.env</include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet>
+
+    <!--  Include configuration prompts file -->
+    <fileSet>
+      <directory>${project.basedir}/release/tcserver/gemfire-cs</directory>
+      <outputDirectory>gemfire-cs</outputDirectory>
+      <includes>
+        <include>configuration-prompts.properties</include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet>
+
+    <fileSet>
+      <directory>${project.basedir}/target/release/tcserver/gemfire-cs
+      </directory>
+      <outputDirectory>gemfire-cs</outputDirectory>
+      <includes>
+        <include>README.txt</include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet>
+    <!--  Include template fragment file for Tomcat 7 -->
+    <fileSet>
+      <directory>${project.basedir}/release/tcserver/gemfire-cs-tomcat-7
+      </directory>
+      <outputDirectory>gemfire-cs-tomcat-7/bin</outputDirectory>
+      <includes>
+        <include>modules.env</include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet>
+
+    <fileSet>
+      <directory>${project.basedir}/release/tcserver/gemfire-cs-tomcat-7
+      </directory>
+      <outputDirectory>gemfire-cs-tomcat-7/conf</outputDirectory>
+      <includes>
+        <include>context-fragment.xml</include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet>
+
+    <!-- Include project jar -->
+    <fileSet>
+      <directory>${project.build.directory}</directory>
+      <outputDirectory>gemfire-cs/lib</outputDirectory>
+      <includes>
+        <include>${project.artifactId}-${project.version}.jar</include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet>
+
+    <!-- Comment out for GA release
+    <fileSet>
+      <directory>${project.basedir}</directory>
+      <includes>
+        <include>
+          GFModules_ReleaseNotes.txt
+        </include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet> -->
+
+    <!-- Include 3rd party OSS/TP file -->
+    <fileSet>
+      <directory>${project.basedir}/release/3rdparty_license</directory>
+      <outputDirectory>gemfire-cs/lib</outputDirectory>
+      <includes>
+        <include> 
+          open_source_licenses-Pivotal_GemFire_Modules_8.1.0.txt
+        </include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet>
+
+  </fileSets>
+
+</component>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4b56f5e4/modules/gemfire-modules-assembly/src/main/assembly/distribution_tcserver_template_p2p.xml
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-assembly/src/main/assembly/distribution_tcserver_template_p2p.xml b/modules/gemfire-modules-assembly/src/main/assembly/distribution_tcserver_template_p2p.xml
new file mode 100644
index 0000000..b97aee6
--- /dev/null
+++ b/modules/gemfire-modules-assembly/src/main/assembly/distribution_tcserver_template_p2p.xml
@@ -0,0 +1,156 @@
+<component>
+
+  <!-- Include gemfire.jar with no version -->
+  <dependencySets>
+    <dependencySet>
+      <outputDirectory>gemfire-p2p/lib</outputDirectory>
+      <includes>
+        <include>com.gemstone:gemfire-modules</include>
+        <include>com.gemstone:gemfire-modules-tomcat7</include>
+        <include>org.slf4j:slf4j-api</include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </dependencySet>
+
+    <!-- Need a separate set for artifacts with 'provided' scope -->
+    <dependencySet>
+      <outputDirectory>gemfire-p2p/lib</outputDirectory>
+      <includes>
+        <include>org.slf4j:slf4j-jdk14</include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+      <scope>provided</scope>
+    </dependencySet>
+  </dependencySets>
+
+  <fileSets>
+
+    <!--  Include scripts -->
+    <fileSet>
+      <directory>${project.basedir}/release/scripts</directory>
+      <outputDirectory>gemfire-p2p/bin</outputDirectory>
+      <excludes>
+        <exclude>cacheserver.*</exclude>
+      </excludes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet>
+
+    <!--  Include conf directory files -->
+    <fileSet>
+      <directory>${project.basedir}/release/conf</directory>
+      <outputDirectory>gemfire-p2p/conf</outputDirectory>
+      <includes>
+        <include>cache-peer.xml</include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet>
+
+    <!--  Include template fragment file -->
+    <fileSet>
+      <directory>${project.basedir}/release/tcserver/gemfire-p2p</directory>
+      <outputDirectory>gemfire-p2p/conf</outputDirectory>
+      <includes>
+        <include>context-fragment.xml</include>
+        <include>server-fragment.xml</include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet>
+
+    <fileSet>
+      <directory>${project.basedir}/release/tcserver/gemfire-p2p</directory>
+      <outputDirectory>gemfire-p2p/bin</outputDirectory>
+      <includes>
+        <include>modules.env</include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet>
+
+    <!--  Include configuration prompts file -->
+    <fileSet>
+      <directory>${project.basedir}/release/tcserver/gemfire-p2p</directory>
+      <outputDirectory>gemfire-p2p</outputDirectory>
+      <includes>
+        <include>configuration-prompts.properties</include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet>
+
+    <fileSet>
+      <directory>${project.basedir}/target/release/tcserver/gemfire-p2p
+      </directory>
+      <outputDirectory>gemfire-p2p</outputDirectory>
+      <includes>
+        <include>README.txt</include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet>
+
+    <!--  Include template fragment file for Tomcat 7 -->
+    <fileSet>
+      <directory>${project.basedir}/release/tcserver/gemfire-p2p-tomcat-7
+      </directory>
+      <outputDirectory>gemfire-p2p-tomcat-7/bin</outputDirectory>
+      <includes>
+        <include>modules.env</include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet>
+
+    <fileSet>
+      <directory>${project.basedir}/release/tcserver/gemfire-p2p-tomcat-7
+      </directory>
+      <outputDirectory>gemfire-p2p-tomcat-7/conf</outputDirectory>
+      <includes>
+        <include>context-fragment.xml</include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet>
+
+    <!-- Comment out for GA release
+    <fileSet>
+      <directory>${project.basedir}</directory>
+      <includes>
+        <include>
+          GFModules_ReleaseNotes.txt
+        </include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet> -->
+
+    <!-- Include 3rd party OSS/TP file -->
+    <fileSet>
+      <directory>${project.basedir}/release/3rdparty_license</directory>
+      <outputDirectory>gemfire-p2p/lib</outputDirectory>
+      <includes>
+        <include>
+          open_source_licenses-Pivotal_GemFire_Modules_8.1.0.txt
+        </include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet>
+
+    <!-- Include project jar -->
+    <fileSet>
+      <directory>${project.build.directory}</directory>
+      <outputDirectory>gemfire-p2p/lib</outputDirectory>
+      <includes>
+        <include>${project.artifactId}-${project.version}.jar</include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet>
+  </fileSets>
+
+</component>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4b56f5e4/modules/gemfire-modules-assembly/src/main/assembly/distribution_tomcat.xml
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-assembly/src/main/assembly/distribution_tomcat.xml b/modules/gemfire-modules-assembly/src/main/assembly/distribution_tomcat.xml
new file mode 100644
index 0000000..338a3a3
--- /dev/null
+++ b/modules/gemfire-modules-assembly/src/main/assembly/distribution_tomcat.xml
@@ -0,0 +1,133 @@
+<assembly
+    xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
+  <id>Tomcat</id>
+
+  <!--
+  This assembly descriptor produces output like:
+    bin/
+      cacheserver.sh
+      cacheserver.bat
+      gemfire.sh
+      gemfire.bat
+    conf/
+      cache-client.xml
+      cache-peer.xml
+      cache-server.xml
+      context-gemfire.xml
+    lib/
+      gemfire.modules-version.jar
+      gemfire.jar
+      open_source_licenses-Pivotal_GemFire_Modules_<version>.txt
+  -->
+
+  <!-- Format as zip and tar.gz -->
+  <formats>
+    <format>zip</format>
+  </formats>
+
+  <!-- Don't include a base directory -->
+  <includeBaseDirectory>false</includeBaseDirectory>
+
+  <!-- Include gemfire.jar with no version -->
+  <dependencySets>
+    <dependencySet>
+      <outputFileNameMapping>${artifact.artifactId}.${artifact.extension}
+      </outputFileNameMapping>
+      <outputDirectory>lib</outputDirectory>
+      <includes>
+        <include>com.gemstone:gemfire-modules</include>
+        <include>com.gemstone:gemfire-modules-tomcat7</include>
+        <include>org.slf4j:slf4j-api</include>
+      </includes>
+    </dependencySet>
+
+    <!-- Need a separate set for artifacts with 'provided' scope -->
+    <dependencySet>
+      <outputFileNameMapping>${artifact.artifactId}.${artifact.extension}
+      </outputFileNameMapping>
+      <outputDirectory>lib</outputDirectory>
+      <includes>
+        <include>org.slf4j:slf4j-jdk14</include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+      <scope>provided</scope>
+    </dependencySet>
+  </dependencySets>
+
+  <files>
+    <file>
+      <source>${project.basedir}/release/scripts/cacheserver.sh</source>
+      <outputDirectory>bin</outputDirectory>
+      <filtered>true</filtered>
+      <fileMode>0755</fileMode>
+    </file>
+    <file>
+      <source>${project.basedir}/release/scripts/cacheserver.bat</source>
+      <outputDirectory>bin</outputDirectory>
+      <filtered>true</filtered>
+      <fileMode>0755</fileMode>
+    </file>
+  </files>
+
+  <fileSets>
+
+    <!--  Include scripts -->
+    <fileSet>
+      <directory>${project.basedir}/release/scripts</directory>
+      <outputDirectory>bin</outputDirectory>
+      <excludes>
+        <exclude>setenv.properties</exclude>
+        <exclude>cacheserver.*</exclude>
+      </excludes>
+      <fileMode>0644</fileMode>
+      <directoryMode>0755</directoryMode>
+    </fileSet>
+
+    <!--  Include conf directory files -->
+    <fileSet>
+      <directory>${project.basedir}/release/conf</directory>
+      <outputDirectory>conf</outputDirectory>
+    </fileSet>
+
+    <!-- Comment out for GA release
+    <fileSet>
+      <directory>${project.basedir}</directory>
+      <includes>
+        <include>
+          GFModules_ReleaseNotes.txt
+        </include>
+      </includes>
+      <directoryMode>0755</directoryMode>
+      <fileMode>0644</fileMode>
+    </fileSet> -->
+
+    <!-- Include 3rd party OSS/TP files -->
+    <fileSet>
+      <directory>${project.basedir}/release/3rdparty_license</directory>
+      <outputDirectory>lib</outputDirectory>
+      <includes>
+        <include>
+          open_source_licenses-Pivotal_GemFire_Modules_8.1.0.txt
+        </include>
+      </includes>
+      <fileMode>0644</fileMode>
+      <directoryMode>0755</directoryMode>
+    </fileSet>
+
+    <!--  Include readme file -->
+    <fileSet>
+      <directory>${project.basedir}/target/release/tomcat</directory>
+      <outputDirectory></outputDirectory>
+      <includes>
+        <include>readme.txt</include>
+      </includes>
+      <fileMode>0644</fileMode>
+      <directoryMode>0755</directoryMode>
+    </fileSet>
+
+  </fileSets>
+
+</assembly>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4b56f5e4/modules/gemfire-modules-hibernate/build.gradle
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-hibernate/build.gradle b/modules/gemfire-modules-hibernate/build.gradle
new file mode 100644
index 0000000..6cd120a
--- /dev/null
+++ b/modules/gemfire-modules-hibernate/build.gradle
@@ -0,0 +1,18 @@
+test {
+  include '**/HibernateTestCase.class'
+  include '**/SecondVMTest.class'
+
+  testLogging {
+    exceptionFormat = 'full'
+  }
+}
+
+dependencies {
+  compile project(':gemfire-modules')
+  compile 'org.hibernate:hibernate-core:3.5.0-Final'
+  compile 'org.hibernate:hibernate-annotations:3.5.5-Final'
+
+  testRuntime 'org.slf4j:slf4j-jdk14:1.7.7'
+  testRuntime 'org.hsqldb:hsqldb:2.0.0'
+  testRuntime 'org.javassist:javassist:3.13.0-GA'
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4b56f5e4/modules/gemfire-modules-hibernate/pom.xml
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-hibernate/pom.xml b/modules/gemfire-modules-hibernate/pom.xml
new file mode 100644
index 0000000..19241b7
--- /dev/null
+++ b/modules/gemfire-modules-hibernate/pom.xml
@@ -0,0 +1,109 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>com.gemstone</groupId>
+  <artifactId>gemfire-modules-hibernate</artifactId>
+  <version>${gemfire.modules.version}</version>
+  <packaging>jar</packaging>
+
+  <name>gemfire-modules-hibernate</name>
+  <url>http://maven.apache.org</url>
+
+  <parent>
+    <groupId>com.gemstone</groupId>
+    <artifactId>gemfire-modules-parent</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+    </dependency>
+    <dependency>
+    	<groupId>org.apache.tomcat</groupId>
+    	<artifactId>catalina</artifactId>
+    </dependency>
+    <dependency>
+    	<groupId>org.apache.tomcat</groupId>
+    	<artifactId>catalina-ha</artifactId>
+        <version>${tomcat.version}</version>
+        <scope>provided</scope>
+    </dependency>
+    <dependency>
+    	<groupId>com.gemstone.gemfire</groupId>
+    	<artifactId>gemfire</artifactId>
+    </dependency>
+    <dependency>
+    	<groupId>com.gemstone</groupId>
+    	<artifactId>gemfire-modules</artifactId>
+        <scope>provided</scope>
+    </dependency>
+    <dependency>
+    	<groupId>org.hibernate</groupId>
+    	<artifactId>hibernate-core</artifactId>
+        <version>3.5.0-Final</version>
+        <scope>provided</scope>
+    </dependency>
+    <dependency>
+    	<groupId>org.hsqldb</groupId>
+    	<artifactId>hsqldb</artifactId>
+        <version>2.0.0</version>
+        <scope>test</scope>
+    </dependency>
+    <dependency>
+    	<groupId>org.javassist</groupId>
+    	<artifactId>javassist</artifactId>
+        <version>3.13.0-GA</version>
+        <scope>test</scope>
+    </dependency>
+    <dependency>
+    	<groupId>org.slf4j</groupId>
+    	<artifactId>slf4j-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-jdk14</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.tomcat</groupId>
+      <artifactId>coyote</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.httpunit</groupId>
+      <artifactId>httpunit</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>rhino</groupId>
+      <artifactId>js</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.hibernate</groupId>
+      <artifactId>hibernate-annotations</artifactId>
+      <version>3.5.5-Final</version>
+      <scope>provided</scope>
+    </dependency>
+  </dependencies>
+  
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <version>2.7.2</version>
+        <configuration>
+          <includes>
+            <include>**/HibernateTestCase.java</include>
+            <include>**/SecondVMTest.java</include>
+          </includes>
+          <runOrder>alphabetical</runOrder>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4b56f5e4/modules/gemfire-modules-hibernate/src/main/java/com/gemstone/gemfire/modules/hibernate/EnumType.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-hibernate/src/main/java/com/gemstone/gemfire/modules/hibernate/EnumType.java b/modules/gemfire-modules-hibernate/src/main/java/com/gemstone/gemfire/modules/hibernate/EnumType.java
new file mode 100644
index 0000000..86153ed
--- /dev/null
+++ b/modules/gemfire-modules-hibernate/src/main/java/com/gemstone/gemfire/modules/hibernate/EnumType.java
@@ -0,0 +1,49 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.gemstone.gemfire.modules.hibernate;
+
+import java.io.Serializable;
+
+import org.hibernate.HibernateException;
+
+/**
+ * Extends {@link org.hibernate.type.EnumType} so as to
+ * override methods responsible for cached representation
+ * of enums in hibernate.
+ * This class must be used in place of {@link org.hibernate.type.EnumType}
+ * in client-server topology when the application classes are
+ * not available on the server.
+ * e.g. a typical enum configuration should look like this:
+ * <pre>
+ * &lt;property name="myEnum"&gt;
+ *   &lt;type name="<b>com.gemstone.gemfire.modules.hibernate.EnumType</b>"&gt;
+ *     &lt;param name="enumClass"&gt;com.mycompany.MyEntity$MyEnum&lt;/param&gt;
+ *     &lt;param name="type"&gt;12&lt;/param&gt;
+ *   &lt;/type&gt;
+ * &lt;/property&gt;
+ * </pre>
+ * @author sbawaska
+ */
+public class EnumType extends org.hibernate.type.EnumType {
+
+  private static final long serialVersionUID = 3414902482639744676L;
+  
+  @Override
+  public Object assemble(Serializable cached, Object owner)
+      throws HibernateException {
+    String name = (String) cached;
+    Class<? extends Enum> clazz = returnedClass();
+    return Enum.valueOf(clazz, name);
+  }
+  
+  @Override
+  public Serializable disassemble(Object value) throws HibernateException {
+    return ((Enum)value).name();
+  }
+  
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4b56f5e4/modules/gemfire-modules-hibernate/src/main/java/com/gemstone/gemfire/modules/hibernate/GemFireCache.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-hibernate/src/main/java/com/gemstone/gemfire/modules/hibernate/GemFireCache.java b/modules/gemfire-modules-hibernate/src/main/java/com/gemstone/gemfire/modules/hibernate/GemFireCache.java
new file mode 100644
index 0000000..119e137
--- /dev/null
+++ b/modules/gemfire-modules-hibernate/src/main/java/com/gemstone/gemfire/modules/hibernate/GemFireCache.java
@@ -0,0 +1,229 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.gemstone.gemfire.modules.hibernate;
+
+import java.util.Map;
+
+import org.hibernate.cache.Cache;
+import org.hibernate.cache.CacheException;
+import org.hibernate.cache.Timestamper;
+
+import com.gemstone.gemfire.cache.EntryNotFoundException;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.Scope;
+import com.gemstone.gemfire.distributed.DistributedLockService;
+import com.gemstone.gemfire.internal.cache.LocalRegion;
+
+public class GemFireCache implements Cache {
+  private Region region;
+
+  private boolean clientRegion = false;
+
+  private final DistributedLockService distributedLockService;
+
+  public GemFireCache(Region region, DistributedLockService lockService) {
+    this.region = region;
+    this.distributedLockService = lockService;
+    this.clientRegion = isClient(region);
+  }
+
+  private boolean isClient(Region region) {
+    return region.getAttributes().getPoolName() != null;
+  }
+
+  /**
+   * Clear the cache
+   */
+  public void clear() throws CacheException {
+    GemFireCacheProvider.getLogger().info("GemFireCache: clear called");
+    region.clear();
+  }
+
+  /**
+   * Clean up
+   */
+  public void destroy() throws CacheException {
+    GemFireCacheProvider.getLogger().info("GemFireCache: destroy called");
+    region.localDestroyRegion();
+  }
+
+  /**
+   * Get an item from the cache
+   * 
+   * @param key
+   * @return the cached object or <tt>null</tt>
+   * @throws CacheException
+   */
+  public Object get(Object key) throws CacheException {
+    GemFireCacheProvider.getLogger().debug(
+        "GemFireCache: get called for: " + key);
+    try {
+      Object value = region.get(key);
+      GemFireCacheProvider.getLogger().debug(
+          "GemFireCache: retrieved: " + key + "-->" + value);
+      return value;
+    }
+    catch (com.gemstone.gemfire.cache.CacheException e) {
+      throw new CacheException(e);
+    }
+  }
+
+  /**
+   * The count of entries currently contained in the regions in-memory store.
+   * 
+   * @return The count of entries in memory; -1 if unknown or unsupported.
+   */
+  public long getElementCountInMemory() {
+    return ((LocalRegion)region).entryCount();
+  }
+
+  /**
+   * The count of entries currently contained in the regions disk store.
+   * 
+   * @return The count of entries on disk; -1 if unknown or unsupported.
+   */
+  public long getElementCountOnDisk() {
+    return -1;
+  }
+
+  /**
+   * Get the name of the cache region
+   */
+  public String getRegionName() {
+    return region.getName();
+  }
+
+  /**
+   * The number of bytes is this cache region currently consuming in memory.
+   * 
+   * @return The number of bytes consumed by this region; -1 if unknown or
+   *         unsupported.
+   */
+  public long getSizeInMemory() {
+    return -1;
+  }
+
+  /**
+   * Return the lock timeout for this cache.
+   */
+  public int getTimeout() {
+    GemFireCacheProvider.getLogger().debug("GemFireCache: getTimeout");
+    return Timestamper.ONE_MS * 60000;
+  }
+
+  /**
+   * If this is a clustered cache, lock the item
+   */
+  public void lock(Object key) throws CacheException {
+    GemFireCacheProvider.getLogger().info(
+        "GemFireCache: lock called for: " + key);
+
+    if (!clientRegion) {
+      // If we're using GLOBAL scope, we don't have to worry about
+      // locking.
+      if (!Scope.GLOBAL.equals(region.getAttributes().getScope())) {
+        this.distributedLockService.lock(key, -1, -1);
+      }
+    }
+    else {
+      // We assume the server region is GLOBAL for now. Else, use command
+      // pattern to acquire lock on the server
+      GemFireCacheProvider.getLogger().info(
+          "GemFireCache: client region, ignoring lock : " + key);
+    }
+  }
+
+  /**
+   * Generate the next timestamp
+   */
+  public long nextTimestamp() {
+    GemFireCacheProvider.getLogger().debug("GemFireCache: nextTimestamp called");
+    // TODO : Need a counter, cache-wide
+    return Timestamper.next();
+  }
+
+  /**
+   * Add an item to the cache
+   * 
+   * @param key
+   * @param value
+   * @throws CacheException
+   */
+  public void put(Object key, Object value) throws CacheException {
+    GemFireCacheProvider.getLogger().debug(
+        "GemFireCache: put called for key: " + key + "value: " + value);
+    try {
+      region.put(key, value);
+      GemFireCacheProvider.getLogger().debug(
+          "GemFireCache: put " + key + "-->" + value);
+    }
+    catch (com.gemstone.gemfire.cache.CacheException e) {
+      throw new CacheException(e);
+    }
+  }
+
+  public Object read(Object key) throws CacheException {
+    GemFireCacheProvider.getLogger().info(
+        "GemFireCache: read called for: " + key);
+    return region.get(key);
+  }
+
+  /**
+   * Remove an item from the cache
+   */
+  public void remove(Object key) throws CacheException {
+    GemFireCacheProvider.getLogger().debug(
+        "GemFireCache: remove called for: " + key);
+    try {
+      region.destroy(key);
+      GemFireCacheProvider.getLogger().debug("GemFireCache: removed: " + key);
+    }
+    catch (EntryNotFoundException e) {
+      // We can silently ignore this
+    }
+    catch (com.gemstone.gemfire.cache.CacheException e) {
+      throw new CacheException(e);
+    }
+  }
+
+  public String toString() {
+    StringBuffer buffer = new StringBuffer();
+    buffer.append("Hibernate cache on GemFire region: ");
+    buffer.append(region);
+    return buffer.toString();
+  }
+
+  /**
+   * If this is a clustered cache, unlock the item
+   */
+  public void unlock(Object key) throws CacheException {
+    GemFireCacheProvider.getLogger().info(
+        "GemFireCache: unlock called for: " + key);
+
+    if (!clientRegion) {
+      // If we're using GLOBAL scope, we don't have to worry about locking.
+      if (!Scope.GLOBAL.equals(region.getAttributes().getScope())) {
+        this.distributedLockService.unlock(key);
+      }
+    }
+    else {
+      GemFireCacheProvider.getLogger().info(
+          "GemFireCache: client region, ignoring lock : " + key);
+    }
+  }
+
+  public void update(Object key, Object value) throws CacheException {
+    GemFireCacheProvider.getLogger().info(
+        "GemFireCache: update called for: " + key);
+    this.region.put(key, value);
+  }
+
+  public Map<?, ?> toMap() {
+    return null;
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4b56f5e4/modules/gemfire-modules-hibernate/src/main/java/com/gemstone/gemfire/modules/hibernate/GemFireCacheListener.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-hibernate/src/main/java/com/gemstone/gemfire/modules/hibernate/GemFireCacheListener.java b/modules/gemfire-modules-hibernate/src/main/java/com/gemstone/gemfire/modules/hibernate/GemFireCacheListener.java
new file mode 100644
index 0000000..fb6db2d
--- /dev/null
+++ b/modules/gemfire-modules-hibernate/src/main/java/com/gemstone/gemfire/modules/hibernate/GemFireCacheListener.java
@@ -0,0 +1,45 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.gemstone.gemfire.modules.hibernate;
+
+import java.util.Properties;
+
+import com.gemstone.gemfire.cache.Declarable;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
+
+public class GemFireCacheListener extends CacheListenerAdapter implements
+    Declarable {
+
+  @Override
+  public void afterCreate(EntryEvent event) {
+    System.out.println("Create : " + event.getKey() + " / "
+        + event.getNewValue());
+  }
+
+  @Override
+  public void afterDestroy(EntryEvent event) {
+    System.out.println("Destroy : " + event.getKey());
+  }
+
+  @Override
+  public void afterInvalidate(EntryEvent event) {
+    System.out.println("Invalidate : " + event.getKey());
+  }
+
+  @Override
+  public void afterUpdate(EntryEvent event) {
+    System.out.println("Update : " + event.getKey() + " / "
+        + event.getNewValue());
+  }
+
+  public void init(Properties props) {
+
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4b56f5e4/modules/gemfire-modules-hibernate/src/main/java/com/gemstone/gemfire/modules/hibernate/GemFireCacheProvider.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-hibernate/src/main/java/com/gemstone/gemfire/modules/hibernate/GemFireCacheProvider.java b/modules/gemfire-modules-hibernate/src/main/java/com/gemstone/gemfire/modules/hibernate/GemFireCacheProvider.java
new file mode 100644
index 0000000..9e38d7f
--- /dev/null
+++ b/modules/gemfire-modules-hibernate/src/main/java/com/gemstone/gemfire/modules/hibernate/GemFireCacheProvider.java
@@ -0,0 +1,191 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.gemstone.gemfire.modules.hibernate;
+
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionShortcut;
+import com.gemstone.gemfire.cache.execute.FunctionService;
+import com.gemstone.gemfire.distributed.DistributedLockService;
+import com.gemstone.gemfire.internal.logging.LogService;
+import com.gemstone.gemfire.modules.util.CreateRegionFunction;
+import com.gemstone.gemfire.modules.util.RegionConfiguration;
+import org.apache.logging.log4j.Logger;
+import org.hibernate.cache.Cache;
+import org.hibernate.cache.CacheException;
+import org.hibernate.cache.CacheProvider;
+import org.hibernate.cache.Timestamper;
+
+import java.util.Iterator;
+import java.util.Properties;
+
+@SuppressWarnings("deprecation")
+public class GemFireCacheProvider implements CacheProvider {
+
+  private static final Logger logger = LogService.getLogger();
+
+  protected com.gemstone.gemfire.cache.Cache _cache;
+
+  private DistributedLockService distributedLockService;
+
+  private Properties regionAttributes = new Properties();
+
+  private final String DEFAULT_REGION_TYPE = RegionShortcut.REPLICATE_HEAP_LRU
+      .name();
+
+  private final String HIBERNATE_DLOCK_SERVICE_NAME = "hibernate-cache-lock-service";
+  /**
+   * Configure the cache
+   * 
+   * @param regionName
+   *          the name of the cache region
+   * @param properties
+   *          configuration settings
+   * @throws CacheException
+   */
+  public Cache buildCache(String regionName, Properties properties)
+      throws CacheException {
+    logger.info("GemFireCacheProvider: Creating cache: " + regionName);
+    Region region = retrieveOrCreateRegion(regionName);
+    Cache cache = null;
+    if (region == null) {
+      // Doh, blow up
+      throw new RuntimeException("Couldn't find cache region : " + regionName);
+    }
+    else {
+      cache = new GemFireCache(region, this.distributedLockService);
+    }
+    logger.info("GemFireCacheProvider: Created cache: " + regionName + "->" + cache);
+    return cache;
+  }
+
+  public boolean isMinimalPutsEnabledByDefault() {
+    return false;
+  }
+
+  /**
+   * Generate a timestamp
+   */
+  public long nextTimestamp() {
+    return Timestamper.next();
+  }
+
+  /**
+   * Returns the region if already created, otherwise first tries to create it
+   * from cache.xml, if not specified in cache.xml, create the region from the
+   * properties specified in hibernate.cfg.xml. Two types of properties can be
+   * specified in hibernate.cfg.xml
+   * <ol>
+   * <li>gemfire.default-region-attributes-id: the default region type to
+   * create. (default value for this is REPLICATE)
+   * <li>gemfire.region-attributes-for:fullyQualifiedRegionName when a region
+   * wants to override the default region type
+   * </ol>
+   * 
+   * @param regionName
+   * @return the region
+   */
+  protected Region retrieveOrCreateRegion(String regionName) {
+    // TODO client regions
+    Region r = _cache.getRegion(regionName);
+    if (r == null) {
+      String regionType = getRegionType(regionName);
+      r = _cache.createRegionFactory(RegionShortcut.valueOf(regionType))
+          .create(regionName);
+      RegionConfiguration regionConfig = new RegionConfiguration();
+      regionConfig.setRegionName(regionName);
+      regionConfig.setRegionAttributesId(regionType);
+      FunctionService.onMembers(_cache.getDistributedSystem())
+          .withArgs(regionConfig).execute(CreateRegionFunction.ID).getResult();
+    }
+    return r;
+  }
+
+  /**
+   * returns the type of region to create by consulting the properties specified
+   * in hibernate.cfg.xml
+   * 
+   * @see #retrieveOrCreateRegion(String)
+   * @param regionName
+   * @return string representation of {@link RegionShortcut}
+   */
+  private String getRegionType(String regionName) {
+    String rType = regionAttributes
+        .getProperty("gemfire.default-region-attributes-id");
+    if (rType == null) {
+      rType = DEFAULT_REGION_TYPE;
+    }
+    // iterate to find overridden property for a region
+    Iterator<Object> it = regionAttributes.keySet().iterator();
+    while (it.hasNext()) {
+      String current = (String)it.next();
+      if (current.contains(regionName)) {
+        rType = regionAttributes.getProperty(current);
+        break;
+      }
+    }
+    return rType.toUpperCase();
+  }
+
+  /**
+   * Callback to perform any necessary initialization of the underlying cache
+   * implementation during SessionFactory construction.
+   * 
+   * @param properties
+   *          current configuration settings.
+   */
+  public void start(Properties properties) throws CacheException {
+    logger.info("GemFireCacheProvider: Creating cache provider");
+
+    // We have to strip out any unknown properties, do so here
+    Properties gemfireOnlyProperties = new Properties();
+    for (Object keyObj : properties.keySet()) {
+      String key = (String)keyObj;
+      if (key.contains("region-attributes")) {
+        regionAttributes.put(key, properties.get(key));
+      }
+      else if (key.startsWith("gemfire.")) {
+        gemfireOnlyProperties.setProperty(key.replace("gemfire.", ""),
+            properties.getProperty(key));
+      }
+    }
+
+    // Create cache and d-lock service
+    try {
+      _cache = new CacheFactory(gemfireOnlyProperties).create();
+      DistributedLockService existing = DistributedLockService.getServiceNamed(HIBERNATE_DLOCK_SERVICE_NAME);
+      if (existing == null) {
+        this.distributedLockService = DistributedLockService.create(
+            HIBERNATE_DLOCK_SERVICE_NAME, _cache.getDistributedSystem());
+      } else {
+        this.distributedLockService = existing;
+      }
+    } 
+    catch (com.gemstone.gemfire.cache.CacheException e) {
+      throw new CacheException(e);
+    }
+
+    FunctionService.registerFunction(new CreateRegionFunction());
+
+    logger.info("GemFireCacheProvider: Done creating cache provider");
+  }
+
+  /**
+   * Callback to perform any necessary cleanup of the underlying cache
+   * implementation during SessionFactory.close().
+   */
+  public void stop() {
+    logger.info("GemFireCacheProvider: Stopping");
+    _cache.close();
+    logger.info("GemFireCacheProvider: Stopped");
+  }
+
+  public static Logger getLogger() {
+    return logger;
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4b56f5e4/modules/gemfire-modules-hibernate/src/main/java/com/gemstone/gemfire/modules/hibernate/GemFireQueryCacheFactory.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-hibernate/src/main/java/com/gemstone/gemfire/modules/hibernate/GemFireQueryCacheFactory.java b/modules/gemfire-modules-hibernate/src/main/java/com/gemstone/gemfire/modules/hibernate/GemFireQueryCacheFactory.java
new file mode 100644
index 0000000..35a79ee
--- /dev/null
+++ b/modules/gemfire-modules-hibernate/src/main/java/com/gemstone/gemfire/modules/hibernate/GemFireQueryCacheFactory.java
@@ -0,0 +1,30 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.gemstone.gemfire.modules.hibernate;
+
+import java.util.Properties;
+
+import org.hibernate.HibernateException;
+import org.hibernate.cache.QueryCache;
+import org.hibernate.cache.QueryCacheFactory;
+import org.hibernate.cache.UpdateTimestampsCache;
+import org.hibernate.cfg.Settings;
+
+/**
+ * Defines a factory for query cache instances. These factories are responsible
+ * for creating individual QueryCache instances.
+ * 
+ */
+public class GemFireQueryCacheFactory implements QueryCacheFactory {
+  public QueryCache getQueryCache(String regionName,
+      UpdateTimestampsCache updateTimestampsCache, Settings settings,
+      Properties props) throws HibernateException {
+    return new org.hibernate.cache.StandardQueryCache(settings, props,
+        updateTimestampsCache, regionName);
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4b56f5e4/modules/gemfire-modules-hibernate/src/main/java/com/gemstone/gemfire/modules/hibernate/GemFireRegionFactory.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-hibernate/src/main/java/com/gemstone/gemfire/modules/hibernate/GemFireRegionFactory.java b/modules/gemfire-modules-hibernate/src/main/java/com/gemstone/gemfire/modules/hibernate/GemFireRegionFactory.java
new file mode 100644
index 0000000..f2d1696
--- /dev/null
+++ b/modules/gemfire-modules-hibernate/src/main/java/com/gemstone/gemfire/modules/hibernate/GemFireRegionFactory.java
@@ -0,0 +1,228 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.gemstone.gemfire.modules.hibernate;
+
+import java.util.HashSet;
+import java.util.Properties;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+import org.hibernate.cache.CacheDataDescription;
+import org.hibernate.cache.CacheException;
+import org.hibernate.cache.CollectionRegion;
+import org.hibernate.cache.EntityRegion;
+import org.hibernate.cache.QueryResultsRegion;
+import org.hibernate.cache.RegionFactory;
+import org.hibernate.cache.Timestamper;
+import org.hibernate.cache.TimestampsRegion;
+import org.hibernate.cache.access.AccessType;
+import org.hibernate.cfg.Settings;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.GemFireCache;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionShortcut;
+import com.gemstone.gemfire.cache.client.ClientCache;
+import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
+import com.gemstone.gemfire.distributed.internal.DistributionConfig;
+import com.gemstone.gemfire.distributed.internal.DistributionConfigImpl;
+import com.gemstone.gemfire.modules.hibernate.internal.ClientServerRegionFactoryDelegate;
+import com.gemstone.gemfire.modules.hibernate.internal.EntityWrapper;
+import com.gemstone.gemfire.modules.hibernate.internal.GemFireCollectionRegion;
+import com.gemstone.gemfire.modules.hibernate.internal.GemFireEntityRegion;
+import com.gemstone.gemfire.modules.hibernate.internal.GemFireQueryResultsRegion;
+import com.gemstone.gemfire.modules.hibernate.internal.RegionFactoryDelegate;
+import com.gemstone.gemfire.modules.util.Banner;
+
+public class GemFireRegionFactory implements RegionFactory {
+
+    
+  private static final String GEMFIRE_QUERY_RESULTS_REGION_NAME = "gemfire.hibernateQueryResults";
+
+  private static final String GEMFIRE_TIMESTAMPS_REGION_NAME = "gemfire.hibernateTimestamps";
+
+  private GemFireCache _cache;
+
+  private RegionFactoryDelegate delegate;
+
+  // TODO get rid of this
+  private boolean isClient;
+  
+  private final Logger log = LoggerFactory.getLogger(getClass());
+
+  private final ExecutorService executorService = Executors.newSingleThreadExecutor();
+
+  private Set<String> gemfireAttributes;
+  
+  /**
+   * maps the entity to the region that stores it.
+   */
+  private ConcurrentMap<String, GemFireEntityRegion> entityRegionMap = new ConcurrentHashMap<String, GemFireEntityRegion>();
+  
+  public GemFireRegionFactory(Properties props) {
+    log.debug("props:" + props);
+  }
+
+  public ExecutorService getExecutorService() {
+    return this.executorService;
+  }
+  
+  @Override
+  public void start(Settings settings, Properties properties)
+      throws CacheException {
+    log.info("Initializing " + Banner.getString());
+    extractGemFireProperties(properties);
+    _cache = delegate.startCache();
+  }
+
+  private void extractGemFireProperties(Properties properties) {
+    // We have to strip out any unknown properties, do so here
+    Properties gemfireProperties = new Properties();
+    Properties regionProperties = new Properties();
+    for (Object keyObj : properties.keySet()) {
+      String key = (String)keyObj;
+      if (key.contains("region-attributes")) {
+        regionProperties.put(key, properties.get(key));
+      }
+      else if (key.equals("gemfire.cache-topology")) {
+        if (properties.getProperty(key).trim()
+            .equalsIgnoreCase("client-server")) {
+          isClient = true;
+        }
+      }
+      else if (key.startsWith("gemfire.") && isGemFireAttribute(key)) {
+        gemfireProperties.setProperty(key.replace("gemfire.", ""),
+            properties.getProperty(key));
+      }
+    }
+    if (isClient) {
+      delegate = new ClientServerRegionFactoryDelegate(gemfireProperties, regionProperties);
+    } else {
+      delegate = new RegionFactoryDelegate(gemfireProperties, regionProperties);
+    }
+  }
+
+  private boolean isGemFireAttribute(String key) {
+    String gfKey = key.replace("gemfire.", "");
+    Set<String> gemfireAttributes = getGemFireAttributesNames();
+    return gemfireAttributes.contains(gfKey);
+  }
+
+  private Set<String> getGemFireAttributesNames() {
+    if (this.gemfireAttributes == null) {
+      //used only to get the list of all gemfire properties
+      DistributionConfig dConfig = new DistributionConfigImpl(new Properties());
+      String[] gemfireAttributeNames = dConfig.getAttributeNames();
+      gemfireAttributes = new HashSet<String>();
+      for (String attrName : gemfireAttributeNames) {
+        gemfireAttributes.add(attrName);
+      }
+    }
+    return gemfireAttributes;
+  }
+  
+  @Override
+  public void stop() {
+    // we do not want to close the cache, as there may be other
+    // applications/webapps
+    // using this cache. TODO do we want to close the regions that are created
+    // by this application?
+  }
+
+  @Override
+  public boolean isMinimalPutsEnabledByDefault() {
+    // minimal puts is better for clustered cache
+    return true;
+  }
+
+  @Override
+  public AccessType getDefaultAccessType() {
+    return AccessType.NONSTRICT_READ_WRITE;
+  }
+
+  @Override
+  public long nextTimestamp() {
+    log.debug("nextTimestamp called");
+    // TODO use gemfire cache time here. (which tries to minimize clock skews)
+    return Timestamper.next();
+  }
+
+  @Override
+  public EntityRegion buildEntityRegion(String regionName,
+      Properties properties, CacheDataDescription metadata)
+      throws CacheException {
+    // create the backing region
+    log.debug("creating Entity region {} ", regionName);
+    Region<Object, EntityWrapper> region = delegate.createRegion(regionName);
+    GemFireEntityRegion r = new GemFireEntityRegion(region, isClient, metadata, this);
+    this.entityRegionMap.put(regionName, r);
+    return r;
+  }
+
+  @Override
+  public CollectionRegion buildCollectionRegion(String regionName,
+      Properties properties, CacheDataDescription metadata)
+      throws CacheException {
+    log.debug("creating collection region {}",regionName);
+    Region<Object, EntityWrapper> region = delegate.createRegion(regionName);
+    return new GemFireCollectionRegion(region, isClient, metadata, this);
+  }
+
+  @Override
+  public QueryResultsRegion buildQueryResultsRegion(String regionName,
+      Properties properties) throws CacheException {
+    log.debug("Creating a query results region");
+    Region region = getLocalRegionForQueryCache();
+    return new GemFireQueryResultsRegion(region);
+  }
+
+  private Region getLocalRegionForQueryCache() {
+    return getLocalRegion(GEMFIRE_QUERY_RESULTS_REGION_NAME);
+  }
+  
+  private Region getLocalRegionForTimestampsCache() {
+    return getLocalRegion(GEMFIRE_TIMESTAMPS_REGION_NAME);
+  }
+  
+  private Region getLocalRegion(String regionName) {
+    Region region = _cache.getRegion(regionName);
+    if (region != null) {
+      return region;
+    }
+    if (isClient) {
+      ClientCache cc = (ClientCache)_cache;
+      region = cc.createClientRegionFactory(ClientRegionShortcut.LOCAL_HEAP_LRU).create(regionName);
+    } else {
+      Cache c = (Cache)_cache;
+      region = c.createRegionFactory(RegionShortcut.LOCAL_HEAP_LRU).create(regionName);
+    }
+    return region;
+  }
+  
+  @Override
+  public TimestampsRegion buildTimestampsRegion(String regionName,
+      Properties properties) throws CacheException {
+    Region region = getLocalRegionForTimestampsCache();
+    return new GemFireQueryResultsRegion(region);
+  }
+
+  /**
+   * Given an entity name, gets the region used to store
+   * that entity.
+   * @param name name of the entity
+   * @return the entity region for the given entity name
+   */
+  public GemFireEntityRegion getEntityRegion(String name) {
+    return this.entityRegionMap.get(name);
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/4b56f5e4/modules/gemfire-modules-hibernate/src/main/java/com/gemstone/gemfire/modules/hibernate/internal/Access.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-hibernate/src/main/java/com/gemstone/gemfire/modules/hibernate/internal/Access.java b/modules/gemfire-modules-hibernate/src/main/java/com/gemstone/gemfire/modules/hibernate/internal/Access.java
new file mode 100644
index 0000000..55abb6a
--- /dev/null
+++ b/modules/gemfire-modules-hibernate/src/main/java/com/gemstone/gemfire/modules/hibernate/internal/Access.java
@@ -0,0 +1,248 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.gemstone.gemfire.modules.hibernate.internal;
+
+import com.gemstone.gemfire.cache.CacheWriterException;
+import com.gemstone.gemfire.cache.EntryExistsException;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.client.ServerOperationException;
+import org.hibernate.cache.CacheException;
+import org.hibernate.cache.EntityRegion;
+import org.hibernate.cache.access.EntityRegionAccessStrategy;
+import org.hibernate.cache.access.SoftLock;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public abstract class Access implements EntityRegionAccessStrategy {
+
+  private final GemFireEntityRegion region;
+
+  /**Thread local to remember the status of insert, which can be returned in afterInsert*/
+  private ThreadLocal<Map<Object, Boolean>> createStatus = new ThreadLocal<Map<Object, Boolean>>() {
+    @Override
+    protected Map<Object, Boolean> initialValue() {
+      return new HashMap<Object, Boolean>();
+    }
+  };
+
+  private Logger log = LoggerFactory.getLogger(getClass());
+
+  public Access(GemFireEntityRegion region) {
+    this.region = region;
+  }
+
+  @Override
+  public EntityRegion getRegion() {
+    return this.region;
+  }
+
+  @Override
+  public Object get(Object key, long txTimestamp) throws CacheException {
+    KeyWrapper wKey = getWrappedKey(key);
+    if (this.region.isRegisterInterestRequired()) {
+      this.region.registerInterest(wKey);
+    }
+    // first check to see if we have pre-fetched this entity
+    EntityWrapper wrapper = this.region.get(wKey);
+    if (wrapper == null) {
+      wrapper = this.region.getGemFireRegion().get(wKey);
+    }
+    if (wrapper == null) {
+      this.region.getStats().incCacheMiss();
+      log.debug("Cache miss for {} count: {}",wKey, this.region.getStats().getCacheMiss());
+      return null;
+    } else {
+      this.region.getStats().incCacheHit();
+      log.debug("cache hit {} count: {} ", wKey, this.region.getStats().getCacheHits());
+    }
+    return wrapper.getEntity();
+  }
+
+  @Override
+  public boolean putFromLoad(Object key, Object value, long txTimestamp,
+      Object version) throws CacheException {
+    return putFromLoad(key, value, txTimestamp, version, true);
+  }
+
+  @Override
+  public boolean putFromLoad(Object key, Object value, long txTimestamp,
+      Object version, boolean minimalPutOverride) throws CacheException {
+    return create(key, value);
+  }
+
+  private boolean create(Object key, Object value) {
+    KeyWrapper wKey = getWrappedKey(key);
+    EntityWrapper wrapper = new EntityWrapper(value, 1L);
+    log.debug("putting a new entry from load {} value: {}",wKey, wrapper);
+    boolean remove = false;
+    try {
+      this.region.getGemFireRegion().create(wKey, wrapper);
+    } catch (EntryExistsException ee) {
+      log.debug("key {} exists in the cache already, destroying", wKey);
+      remove = true;
+    } catch (CacheWriterException writerEx) {
+      this.region.getStats().incHibernateDestroyJobsScheduled();
+      log.debug("caught a CacheWriterException {} ",writerEx.getMessage());
+      remove = true;
+    } catch (ServerOperationException serverEx) {
+      if (serverEx.getCause() instanceof CacheWriterException) {
+        this.region.getStats().incHibernateDestroyJobsScheduled();
+        log.debug("caught a ServerOperationException caused by CacheWriterException {} ",serverEx.getMessage());
+      } else {
+        throw serverEx;
+      }
+      remove = true;
+    }
+    if (remove) {
+      this.region.getGemFireRegion().remove(wKey);
+      return false;
+    }
+    return true;
+  }
+
+  @Override
+  public SoftLock lockItem(Object key, Object version) throws CacheException {
+    KeyWrapper wKey = getWrappedKey(key);
+    EntityWrapper wrapper = this.region.getGemFireRegion().get(wKey);
+    Long ver = wrapper == null ? 0L : wrapper.getVersion();
+    log.debug("lockItem:key: {} entityVersion: {}", new Object[] { wKey, ver });
+    return new EntityVersionImpl(ver);
+  }
+
+  @Override
+  public SoftLock lockRegion() throws CacheException {
+    return null;
+  }
+
+  @Override
+  public void unlockItem(Object key, SoftLock lock) throws CacheException {
+    log.debug("unlockItem:key:" + key + " lock:" + lock);
+  }
+
+  @Override
+  public void unlockRegion(SoftLock lock) throws CacheException {
+  }
+
+  @Override
+  public boolean insert(Object key, Object value, Object version)
+      throws CacheException {
+    log.debug("insert:key:{} value:{} version:{}",
+        new Object[]{key, value, version});
+    boolean retVal = create(key, value);
+    createStatus.get().put(key, retVal);
+    return retVal;
+  }
+
+  @Override
+  public boolean afterInsert(Object key, Object value, Object version)
+      throws CacheException {
+    log.info("afterInsert:key:{} value:{} version:{}",
+        new Object[]{key, value, version});
+    return createStatus.get().remove(key);
+  }
+
+  @Override
+  public boolean update(Object key, Object value, Object currentVersion,
+      Object previousVersion) throws CacheException {
+    KeyWrapper wKey = getWrappedKey(key);
+    EntityWrapper oldWrapper = this.region.getGemFireRegion().get(wKey);
+    Long version = oldWrapper == null ? 1L : oldWrapper.getVersion() + 1;
+    EntityWrapper wrapper = new EntityWrapper(value, version);
+    log.debug("put:key:{} value:{} version:{}", new Object[] { wKey, value,
+        version });
+    boolean remove = false;
+    try {
+      if (oldWrapper == null) {
+        remove = this.region.getGemFireRegion().putIfAbsent(wKey, wrapper) != null;
+      } else {
+        remove = !this.region.getGemFireRegion().replace(wKey, oldWrapper, wrapper);
+      }
+    } catch (CacheWriterException writerEx) {
+      this.region.getStats().incHibernateDestroyJobsScheduled();
+      log.debug("caught a CacheWriterException {} ",writerEx.getMessage());
+      remove = true;
+    } catch (ServerOperationException serverEx) {
+      if (serverEx.getCause() instanceof CacheWriterException) {
+        this.region.getStats().incHibernateDestroyJobsScheduled();
+        log.debug("caught a ServerOperationException caused by CacheWriterException {} ",serverEx.getMessage());
+        remove = true;
+      } else {
+        throw serverEx;
+      }
+    }
+    if (remove) {
+      this.region.getGemFireRegion().remove(wKey);
+      return false;
+    }
+    log.debug("put for key {} succeded", wKey);
+    return true;
+  }
+
+  @Override
+  public boolean afterUpdate(Object key, Object value, Object currentVersion,
+      Object previousVersion, SoftLock lock) throws CacheException {
+    log.debug("afterUpdate:key:{} value:{} currVersion:{} previousVersion:{}",
+        new Object[] {key, value, currentVersion, previousVersion});
+    KeyWrapper wKey = getWrappedKey(key);
+    EntityWrapper wrapper = this.region.getGemFireRegion().get(wKey);
+    if (wrapper == null) {
+      // this entry was destroyed during update
+      return false;
+    }
+    Long version = wrapper.getVersion();
+    Long expectedVersion = ((EntityVersion)lock).getVersion() + 1;
+    log.debug("afterPut:key:{} value:{} version:{} expected: {}",
+        new Object[] { wKey, value, version, expectedVersion });
+    if (wrapper.getVersion() != expectedVersion) {
+      log.debug(
+          "for key {} expected version to be {} but was {}, so destroying the key",
+          new Object[] { wKey, expectedVersion, version });
+      this.region.getGemFireRegion().remove(wKey);
+      return false;
+    }
+    return true;
+  }
+
+  @Override
+  public void remove(Object key) throws CacheException {
+    log.debug("removing key {} ",key);
+    this.region.getGemFireRegion().remove(getWrappedKey(key));
+  }
+
+  @Override
+  public void removeAll() throws CacheException {
+    log.debug("removing all keys");
+    this.region.getGemFireRegion().clear();
+  }
+
+  @Override
+  public void evict(Object key) throws CacheException {
+    // TODO we should implement a method on Region to evict
+    // a particular entry, destroying is inefficient
+    log.debug("removing key {} ",key);
+    this.region.getGemFireRegion().remove(getWrappedKey(key));
+  }
+
+  @Override
+  public void evictAll() throws CacheException {
+    log.debug("removing all keys");
+    this.region.getGemFireRegion().clear();
+  }
+
+  protected Region<Object, EntityWrapper> getGemFireRegion() {
+    return this.region.getGemFireRegion();
+  }
+  
+  protected KeyWrapper getWrappedKey(Object key) {
+    return new KeyWrapper(key);
+  }
+}
+


Mime
View raw message