eu.etaxonomy.taxeditor.remoting/src/main/java/eu/etaxonomy/cdm/api/cache/CdmEntityCacheKey.java -text
eu.etaxonomy.taxeditor.remoting/src/main/java/eu/etaxonomy/cdm/api/cache/CdmEntityCachingUtils.java -text
eu.etaxonomy.taxeditor.remoting/src/main/java/eu/etaxonomy/cdm/api/cache/CdmModelCacher.java -text
-eu.etaxonomy.taxeditor.remoting/src/main/java/eu/etaxonomy/cdm/api/cache/CdmModelGetMethodFromClass.java -text
+eu.etaxonomy.taxeditor.remoting/src/main/java/eu/etaxonomy/cdm/api/cache/CdmModelFieldPropertyFromClass.java -text
eu.etaxonomy.taxeditor.remoting/src/main/java/eu/etaxonomy/cdm/api/cache/CdmRemoteCacheManager.java -text
eu.etaxonomy.taxeditor.remoting/src/main/java/eu/etaxonomy/cdm/api/cache/CdmServiceCacher.java -text
eu.etaxonomy.taxeditor.remoting/src/main/java/eu/etaxonomy/cdm/api/cache/CdmTransientEntityCacher.java -text
eu.etaxonomy.taxeditor.remoting/src/main/java/eu/etaxonomy/cdm/remote/CdmRemoteSourceBase.java -text
eu.etaxonomy.taxeditor.remoting/src/main/java/eu/etaxonomy/cdm/remote/CdmRemoteSourceException.java -text
eu.etaxonomy.taxeditor.remoting/src/main/java/eu/etaxonomy/cdm/remote/ICdmRemoteSource.java -text
+eu.etaxonomy.taxeditor.remoting/src/main/java/eu/etaxonomy/taxeditor/remoting/CdmRemotingException.java -text
eu.etaxonomy.taxeditor.remoting/src/main/java/eu/etaxonomy/taxeditor/remoting/RemotingTestPluginActivator.java -text
eu.etaxonomy.taxeditor.remoting/src/main/java/eu/etaxonomy/taxeditor/remoting/session/CdmClientSessionException.java -text
eu.etaxonomy.taxeditor.remoting/src/main/java/eu/etaxonomy/taxeditor/remoting/session/CdmEntitySession.java -text
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry including="**/*.java" kind="src" path="src/main/java"/>
<classpathentry excluding="**/*.java" kind="src" path="src/main/resources"/>
<classpathentry including="**/*.java" kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry excluding="**/*.java" kind="src" output="target/test-classes" path="src/test/resources"/>
- <classpathentry exported="true" kind="lib" path="lib/opencsv-2.4.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/dbunit-2.4.9.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.3.8-SNAPSHOT.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/org.springframework.aop-3.2.2.RELEASE.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/org.springframework.aspects-3.2.2.RELEASE.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/org.springframework.beans-3.2.2.RELEASE.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/org.springframework.core-3.2.2.RELEASE.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/org.springframework.expression-3.2.2.RELEASE.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/org.springframework.jdbc-3.2.2.RELEASE.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/org.springframework.orm-3.2.2.RELEASE.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/org.springframework.transaction-3.2.2.RELEASE.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/org.springframework.web-3.2.2.RELEASE.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/org.springframework.context-3.2.2.RELEASE.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/hibernate-commons-annotations-4.0.1.Final.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/hibernate-core-4.1.10.Final.jar" sourcepath="/home/cmathew/Temp/hibernate-core-4.1.10.Final-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/hibernate-entitymanager-4.1.10.Final.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/hibernate-envers-4.1.10.Final.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/hibernate-search-engine-4.2.0.Final.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/hibernate-jpa-2.0-api-1.0.1.Final.jar"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry exported="true" kind="lib" path="lib/aspectjrt-1.7.1.jar"/>
<classpathentry exported="true" kind="lib" path="lib/c3p0-0.9.2.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-3.3.8-SNAPSHOT.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.3.8-SNAPSHOT.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.3.8-SNAPSHOT.jar" sourcepath="/home/cmathew/Development/EDIT/taxeditor/eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib-model-3.3.8-SNAPSHOT-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.3.8-SNAPSHOT.jar" sourcepath="/home/cmathew/.m2/repository/eu/etaxonomy/cdmlib-services/3.3.8-SNAPSHOT/cdmlib-services-3.3.8-SNAPSHOT-sources.jar"/>
<classpathentry exported="true" kind="lib" path="lib/ehcache-core-2.4.3.jar"/>
<classpathentry exported="true" kind="lib" path="lib/hamcrest-core-1.3.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jboss-logging-3.1.3.GA.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jboss-transaction-api_1.1_spec-1.0.0.Final.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jdom-1.1.3.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/junit-4.11.jar" sourcepath="/home/cmathew/Downloads/junit-4.11-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/junit-4.11.jar"/>
<classpathentry exported="true" kind="lib" path="lib/log4j-1.2.17.jar"/>
<classpathentry exported="true" kind="lib" path="lib/spring-security-config-3.1.3.RELEASE.jar"/>
<classpathentry exported="true" kind="lib" path="lib/spring-security-core-3.1.3.RELEASE.jar"/>
<classpathentry exported="true" kind="lib" path="lib/unitils-dbmaintainer-3.4.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/h2-1.4.181.jar"/>
<classpathentry exported="true" kind="lib" path="lib/unitils-dbunit-3.4.2.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/hibernate-jpa-2.0-api-1.0.1.Final.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/hibernate-commons-annotations-4.0.1.Final.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/hibernate-core-4.1.10.Final.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/hibernate-entitymanager-4.1.10.Final.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/hibernate-envers-4.1.10.Final.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/hibernate-search-engine-4.2.0.Final.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.springframework.context-3.2.2.RELEASE.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.springframework.aop-3.2.2.RELEASE.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.springframework.aspects-3.2.2.RELEASE.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.springframework.beans-3.2.2.RELEASE.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.springframework.core-3.2.2.RELEASE.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.springframework.expression-3.2.2.RELEASE.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.springframework.jdbc-3.2.2.RELEASE.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.springframework.orm-3.2.2.RELEASE.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.springframework.transaction-3.2.2.RELEASE.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.springframework.web-3.2.2.RELEASE.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/dbunit-2.4.9.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/opencsv-2.4.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/dom4j-1.6.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-3.4.0-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.4.0-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.4.0-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.4.0-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/usertype.jodatime-2.0.1.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/usertype.spi-2.0.1.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.4.0-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/wsdl4j-1.6.3.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/validation-api-1.1.0.Final.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.springframework.context.support-3.2.2.RELEASE.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/org.springframework.test-3.2.2.RELEASE.jar"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Bundle-ManifestVersion: 2
Bundle-Name: UI Test Bundle
Bundle-SymbolicName: eu.etaxonomy.taxeditor.remoting;singleton:=true
-Bundle-Version: 3.3.8.qualifier
+Bundle-Version: 3.4.0.qualifier
Bundle-Activator: eu.etaxonomy.taxeditor.remoting.RemotingTestPluginActivator
Bundle-Vendor: EDIT
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
org.hibernate.proxy
Bundle-ClassPath: lib/aspectjrt-1.7.1.jar,
lib/c3p0-0.9.2.jar,
- lib/cdmlib-commons-3.3.8-SNAPSHOT.jar,
- lib/cdmlib-ext-3.3.8-SNAPSHOT.jar,
- lib/cdmlib-model-3.3.8-SNAPSHOT.jar,
- lib/cdmlib-services-3.3.8-SNAPSHOT.jar,
lib/ehcache-core-2.4.3.jar,
lib/hamcrest-core-1.3.jar,
lib/jboss-logging-3.1.3.GA.jar,
lib/org.springframework.web-3.2.2.RELEASE.jar,
lib/cdmlib-persistence-3.3.8-SNAPSHOT.jar,
lib/dbunit-2.4.9.jar,
- lib/opencsv-2.4.jar
+ lib/opencsv-2.4.jar,
+ lib/dom4j-1.6.jar,
+ lib/cdmlib-commons-3.4.0-SNAPSHOT.jar,
+ lib/cdmlib-ext-3.4.0-SNAPSHOT.jar,
+ lib/cdmlib-model-3.4.0-SNAPSHOT.jar,
+ lib/cdmlib-services-3.4.0-SNAPSHOT.jar,
+ lib/usertype.jodatime-2.0.1.jar,
+ lib/usertype.spi-2.0.1.jar,
+ lib/cdmlib-persistence-3.4.0-SNAPSHOT.jar,
+ lib/wsdl4j-1.6.3.jar,
+ lib/validation-api-1.1.0.Final.jar,
+ lib/org.springframework.context.support-3.2.2.RELEASE.jar,
+ lib/org.springframework.test-3.2.2.RELEASE.jar
Import-Package: org.osgi.framework
Require-Bundle: org.eclipse.osgi
bin.includes = META-INF/,\
lib/aspectjrt-1.7.1.jar,\
lib/c3p0-0.9.2.jar,\
- lib/cdmlib-commons-3.3.8-SNAPSHOT.jar,\
- lib/cdmlib-ext-3.3.8-SNAPSHOT.jar,\
- lib/cdmlib-model-3.3.8-SNAPSHOT.jar,\
- lib/cdmlib-services-3.3.8-SNAPSHOT.jar,\
lib/ehcache-core-2.4.3.jar,\
lib/hamcrest-core-1.3.jar,\
lib/jboss-logging-3.1.3.GA.jar,\
lib/dbunit-2.4.9.jar,\
lib/opencsv-2.4.jar,\
src/test/resources/h2/,\
- src/test/resources/log4j.properties
+ src/test/resources/log4j.properties,\
+ lib/dom4j-1.6.jar,\
+ lib/cdmlib-commons-3.4.0-SNAPSHOT.jar,\
+ lib/cdmlib-ext-3.4.0-SNAPSHOT.jar,\
+ lib/cdmlib-model-3.4.0-SNAPSHOT.jar,\
+ lib/cdmlib-services-3.4.0-SNAPSHOT.jar,\
+ lib/usertype.jodatime-2.0.1.jar,\
+ lib/usertype.spi-2.0.1.jar,\
+ lib/cdmlib-persistence-3.4.0-SNAPSHOT.jar,\
+ lib/wsdl4j-1.6.3.jar,\
+ lib/validation-api-1.1.0.Final.jar,\
+ src/main/resources/eu/etaxonomy/cdmlib/,\
+ lib/org.springframework.context.support-3.2.2.RELEASE.jar,\
+ src/main/resources/cdmlib-ehcache.xml,\
+ src/test/resources/cdmlib-ehcache.xml,\
+ lib/org.springframework.test-3.2.2.RELEASE.jar
bin.excludes = src/test/
<?xml version="1.0" encoding="UTF-8"?>
<project>
- <parent>
- <groupId>eu.etaxonomy</groupId>
- <artifactId>taxeditor-parent</artifactId>
- <version>3.3.8-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>eu.etaxonomy.taxeditor.remoting</artifactId>
- <packaging>eclipse-plugin</packaging>
- <name>Remoting Bundle</name>
- <description>Remoting Plugin Taxonomic Editor</description>
+ <parent>
+ <groupId>eu.etaxonomy</groupId>
+ <artifactId>taxeditor-parent</artifactId>
+ <version>3.4.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>eu.etaxonomy.taxeditor.remoting</artifactId>
+ <packaging>eclipse-plugin</packaging>
+ <name>Remoting Bundle</name>
+ <description>Remoting Plugin Taxonomic Editor</description>
- <build>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.7</version>
- </plugin>
- </plugins>
- </pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <version>2.4</version>
- <executions>
- <execution>
- <id>copy-dependencies</id>
- <phase>validate</phase>
- <goals>
- <goal>copy-dependencies</goal>
- </goals>
- <configuration>
- <excludeArtifactIds>
- cdmlib-remote-webapp
- </excludeArtifactIds>
- <includeArtifactIds>
- cdmlib-services,cdmlib-commons,cdmlib-persistence,cdmlib-ext,cdmlib-model
- </includeArtifactIds>
- <outputDirectory>${basedir}/lib</outputDirectory>
- <overWriteReleases>true</overWriteReleases>
- <overWriteSnapshots>true</overWriteSnapshots>
- <excludeTransitive>true</excludeTransitive>
- </configuration>
- </execution>
- <execution>
- <id>copy-dependency-war</id>
- <phase>validate</phase>
- <goals>
- <goal>copy-dependencies</goal>
- </goals>
- <configuration>
- <includeArtifactIds>
- cdmlib-remote-webapp
- </includeArtifactIds>
- <outputDirectory>
- ${basedir}/src/main/resources/etc/jetty
- </outputDirectory>
- <overWriteReleases>true</overWriteReleases>
- <overWriteSnapshots>true</overWriteSnapshots>
- <excludeTransitive>true</excludeTransitive>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <version>1.7</version>
- <executions>
- <execution>
- <id>update-snapshot-jar-names</id>
- <phase>validate</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <target>
- <echo>Anonymizing war</echo>
- <move todir="./src/main/resources/etc/jetty">
- <fileset dir="./src/main/resources/etc/jetty" />
- <mapper type="regexp"
- from="(^cdmlib\-.*)\-[0-9]\.[0-9]\.[0-9]\-SNAPSHOT(\.war)"
- to="\1\2" />
- </move>
- <move todir="./src/main/resources/etc/jetty">
- <fileset dir="./src/main/resources/etc/jetty" />
- <mapper type="regexp"
- from="(^cdmlib\-.*)\-[0-9]\.[0-9]\.[0-9]\-[0-9.-]+(\.war)"
- to="\1\2" />
- </move>
- <echo>Update cdmlib jars to SNAPSHOT when build with
- timestamp
- </echo>
- <move todir="./lib">
- <fileset dir="./lib" />
- <mapper type="regexp"
- from="(^cdmlib\-.*\-[0-9]\.[0-9]\.[0-9]\-)[0-9.-]+(\.jar)"
- to="\1SNAPSHOT\2" />
- </move>
- <move todir="./lib">
- <fileset dir="./lib" />
- <mapper type="regexp"
- from="(^cdmlib\-.*\-[0-9]\.[0-9]\.[0-9]\-)[0-9.-]+(\-sources\.jar)"
- to="\1SNAPSHOT\2" />
- </move>
- </target>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- <profiles>
- <profile>
- <id>cleanCdmlibJars</id>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-clean-plugin</artifactId>
- <version>2.3</version>
- <configuration>
- <filesets>
- <fileset>
- <directory>${basedir}/lib</directory>
- <includes>
- <include>cdmlib-*</include>
- </includes>
- <followSymlinks>false</followSymlinks>
- </fileset>
- </filesets>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- <profile>
- <id>cleanAllJars</id>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-clean-plugin</artifactId>
- <version>2.3</version>
- <configuration>
- <filesets>
- <fileset>
- <directory>${basedir}/lib</directory>
- <includes>
- <include>*</include>
- </includes>
- <followSymlinks>false</followSymlinks>
- </fileset>
- </filesets>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- <profile>
- <id>copyAllJars</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <version>2.4</version>
- <executions>
- <execution>
- <id>copy-all-dependencies</id>
- <phase>validate</phase>
- <goals>
- <goal>copy-dependencies</goal>
- </goals>
- <configuration>
- <excludeArtifactIds>
- cdmlib-remote-webapp
- </excludeArtifactIds>
- <outputDirectory>${basedir}/lib</outputDirectory>
- <overWriteReleases>true</overWriteReleases>
- <overWriteSnapshots>true</overWriteSnapshots>
- <excludeTransitive>true</excludeTransitive>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
- <repositories>
- <repository>
- <id>SpringSource Enterprise Bundle Repository - External Bundle
- Milestones</id>
- <url>http://repository.springsource.com/maven/bundles/milestone
- </url>
- </repository>
- <repository>
- <id>SpringSource Enterprise Bundle Repository - SpringSource
- Bundle Releases</id>
- <url>http://repository.springsource.com/maven/bundles/release
- </url>
- </repository>
- <repository>
- <id>SpringSource Enterprise Bundle Repository - External Bundle
- Releases</id>
- <url>http://repository.springsource.com/maven/bundles/external
- </url>
- </repository>
- </repositories>
- <dependencies>
- <dependency>
- <groupId>eu.etaxonomy</groupId>
- <artifactId>cdmlib-remote-webapp</artifactId>
- <version>${cdmlib.version}</version>
- <type>war</type>
- </dependency>
- <dependency>
- <groupId>eu.etaxonomy</groupId>
- <artifactId>cdmlib-services</artifactId>
- <version>${cdmlib.version}</version>
- </dependency>
- <dependency>
- <groupId>eu.etaxonomy</groupId>
- <artifactId>cdmlib-commons</artifactId>
- <version>${cdmlib.version}</version>
- </dependency>
- <dependency>
- <groupId>eu.etaxonomy</groupId>
- <artifactId>cdmlib-persistence</artifactId>
- <version>${cdmlib.version}</version>
- </dependency>
- <dependency>
- <groupId>eu.etaxonomy</groupId>
- <artifactId>cdmlib-ext</artifactId>
- <version>${cdmlib.version}</version>
- </dependency>
- <dependency>
- <groupId>eu.etaxonomy</groupId>
- <artifactId>cdmlib-model</artifactId>
- <version>${cdmlib.version}</version>
- </dependency>
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.7</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>2.4</version>
+ <executions>
+ <execution>
+ <id>copy-dependencies</id>
+ <phase>validate</phase>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ <configuration>
+ <excludeArtifactIds>
+ cdmlib-remote-webapp
+ </excludeArtifactIds>
+ <includeArtifactIds>
+ cdmlib-services,cdmlib-commons,cdmlib-persistence,cdmlib-ext,cdmlib-model
+ </includeArtifactIds>
+ <outputDirectory>${basedir}/lib</outputDirectory>
+ <overWriteReleases>true</overWriteReleases>
+ <overWriteSnapshots>true</overWriteSnapshots>
+ <excludeTransitive>true</excludeTransitive>
+ </configuration>
+ </execution>
+ <execution>
+ <id>copy-dependency-war</id>
+ <phase>validate</phase>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ <configuration>
+ <includeArtifactIds>
+ cdmlib-remote-webapp
+ </includeArtifactIds>
+ <outputDirectory>
+ ${basedir}/src/main/resources/etc/jetty
+ </outputDirectory>
+ <overWriteReleases>true</overWriteReleases>
+ <overWriteSnapshots>true</overWriteSnapshots>
+ <excludeTransitive>true</excludeTransitive>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.7</version>
+ <executions>
+ <execution>
+ <id>update-snapshot-jar-names</id>
+ <phase>validate</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <target>
+ <echo>Anonymizing war</echo>
+ <move todir="./src/main/resources/etc/jetty">
+ <fileset dir="./src/main/resources/etc/jetty" />
+ <mapper type="regexp"
+ from="(^cdmlib\-.*)\-[0-9]\.[0-9]\.[0-9]\-SNAPSHOT(\.war)" to="\1\2" />
+ </move>
+ <move todir="./src/main/resources/etc/jetty">
+ <fileset dir="./src/main/resources/etc/jetty" />
+ <mapper type="regexp"
+ from="(^cdmlib\-.*)\-[0-9]\.[0-9]\.[0-9]\-[0-9.-]+(\.war)" to="\1\2" />
+ </move>
+ <echo>Update cdmlib jars to SNAPSHOT when build with
+ timestamp
+ </echo>
+ <move todir="./lib">
+ <fileset dir="./lib" />
+ <mapper type="regexp"
+ from="(^cdmlib\-.*\-[0-9]\.[0-9]\.[0-9]\-)[0-9.-]+(\.jar)" to="\1SNAPSHOT\2" />
+ </move>
+ <move todir="./lib">
+ <fileset dir="./lib" />
+ <mapper type="regexp"
+ from="(^cdmlib\-.*\-[0-9]\.[0-9]\.[0-9]\-)[0-9.-]+(\-sources\.jar)"
+ to="\1SNAPSHOT\2" />
+ </move>
+ </target>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <profiles>
+ <profile>
+ <id>cleanCdmlibJars</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-clean-plugin</artifactId>
+ <version>2.3</version>
+ <configuration>
+ <filesets>
+ <fileset>
+ <directory>${basedir}/lib</directory>
+ <includes>
+ <include>cdmlib-*</include>
+ </includes>
+ <followSymlinks>false</followSymlinks>
+ </fileset>
+ </filesets>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>cleanAllJars</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-clean-plugin</artifactId>
+ <version>2.3</version>
+ <configuration>
+ <filesets>
+ <fileset>
+ <directory>${basedir}/lib</directory>
+ <includes>
+ <include>*</include>
+ </includes>
+ <followSymlinks>false</followSymlinks>
+ </fileset>
+ </filesets>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>copyAllJars</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>2.4</version>
+ <executions>
+ <execution>
+ <id>copy-all-dependencies</id>
+ <phase>validate</phase>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ <configuration>
+ <excludeArtifactIds>
+ cdmlib-remote-webapp
+ </excludeArtifactIds>
+ <outputDirectory>${basedir}/lib</outputDirectory>
+ <overWriteReleases>true</overWriteReleases>
+ <overWriteSnapshots>true</overWriteSnapshots>
+ <excludeTransitive>true</excludeTransitive>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+ <repositories>
+ <repository>
+ <id>SpringSource Enterprise Bundle Repository - External Bundle
+ Milestones
+ </id>
+ <url>http://repository.springsource.com/maven/bundles/milestone
+ </url>
+ </repository>
+ <repository>
+ <id>SpringSource Enterprise Bundle Repository - SpringSource
+ Bundle
+ Releases
+ </id>
+ <url>http://repository.springsource.com/maven/bundles/release
+ </url>
+ </repository>
+ <repository>
+ <id>SpringSource Enterprise Bundle Repository - External Bundle
+ Releases
+ </id>
+ <url>http://repository.springsource.com/maven/bundles/external
+ </url>
+ </repository>
+ </repositories>
+ <dependencies>
+ <dependency>
+ <groupId>eu.etaxonomy</groupId>
+ <artifactId>cdmlib-remote-webapp</artifactId>
+ <version>${cdmlib.version}</version>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>eu.etaxonomy</groupId>
+ <artifactId>cdmlib-services</artifactId>
+ <version>${cdmlib.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>eu.etaxonomy</groupId>
+ <artifactId>cdmlib-commons</artifactId>
+ <version>${cdmlib.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>eu.etaxonomy</groupId>
+ <artifactId>cdmlib-persistence</artifactId>
+ <version>${cdmlib.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>eu.etaxonomy</groupId>
+ <artifactId>cdmlib-ext</artifactId>
+ <version>${cdmlib.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>eu.etaxonomy</groupId>
+ <artifactId>cdmlib-model</artifactId>
+ <version>${cdmlib.version}</version>
+ </dependency>
- <dependency>
- <groupId>org.unitils</groupId>
- <artifactId>unitils-core</artifactId>
- <version>3.4.2</version>
- </dependency>
- <!-- <dependency> -->
- <!-- <groupId>org.eclipse.jetty</groupId> -->
- <!-- <artifactId>jetty-server</artifactId> -->
- <!-- <version>9.1.3.v20140225</version> -->
- <!-- </dependency> -->
- <!-- <dependency> -->
- <!-- <groupId>org.eclipse.jetty</groupId> -->
- <!-- <artifactId>jetty-util</artifactId> -->
- <!-- <version>9.1.3.v20140225</version> -->
- <!-- </dependency> -->
- <!-- <dependency> -->
- <!-- <groupId>org.eclipse.jetty</groupId> -->
- <!-- <artifactId>jetty-xml</artifactId> -->
- <!-- <version>9.1.3.v20140225</version> -->
- <!-- </dependency> -->
- <!-- <dependency> -->
- <!-- <groupId>org.eclipse.jetty</groupId> -->
- <!-- <artifactId>jetty-servlet</artifactId> -->
- <!-- <version>9.1.3.v20140225</version> -->
- <!-- </dependency> -->
- <!-- <dependency> -->
- <!-- <groupId>org.eclipse.jetty</groupId> -->
- <!-- <artifactId>jetty-webapp</artifactId> -->
- <!-- <version>9.1.3.v20140225</version> -->
- <!-- </dependency> -->
- <!-- <dependency> -->
- <!-- <groupId>org.eclipse.jetty</groupId> -->
- <!-- <artifactId>jetty-security</artifactId> -->
- <!-- <version>9.1.3.v20140225</version> -->
- <!-- </dependency> -->
- <!-- <dependency> -->
- <!-- <groupId>org.eclipse.jetty</groupId> -->
- <!-- <artifactId>jetty-http</artifactId> -->
- <!-- <version>${jetty.version}</version> -->
- <!-- </dependency> -->
- <!-- <dependency> -->
- <!-- <groupId>org.eclipse.jetty</groupId> -->
- <!-- <artifactId>jetty-io</artifactId> -->
- <!-- <version>${jetty.version}</version> -->
- <!-- </dependency> -->
- <!-- <dependency> -->
- <!-- <groupId>javax.servlet</groupId> -->
- <!-- <artifactId>javax.servlet-api</artifactId> -->
- <!-- <version>3.1.0</version> -->
- <!-- </dependency> -->
+ <dependency>
+ <groupId>org.unitils</groupId>
+ <artifactId>unitils-core</artifactId>
+ <version>3.4.2</version>
+ </dependency>
+ <!-- <dependency> -->
+ <!-- <groupId>org.eclipse.jetty</groupId> -->
+ <!-- <artifactId>jetty-server</artifactId> -->
+ <!-- <version>9.1.3.v20140225</version> -->
+ <!-- </dependency> -->
+ <!-- <dependency> -->
+ <!-- <groupId>org.eclipse.jetty</groupId> -->
+ <!-- <artifactId>jetty-util</artifactId> -->
+ <!-- <version>9.1.3.v20140225</version> -->
+ <!-- </dependency> -->
+ <!-- <dependency> -->
+ <!-- <groupId>org.eclipse.jetty</groupId> -->
+ <!-- <artifactId>jetty-xml</artifactId> -->
+ <!-- <version>9.1.3.v20140225</version> -->
+ <!-- </dependency> -->
+ <!-- <dependency> -->
+ <!-- <groupId>org.eclipse.jetty</groupId> -->
+ <!-- <artifactId>jetty-servlet</artifactId> -->
+ <!-- <version>9.1.3.v20140225</version> -->
+ <!-- </dependency> -->
+ <!-- <dependency> -->
+ <!-- <groupId>org.eclipse.jetty</groupId> -->
+ <!-- <artifactId>jetty-webapp</artifactId> -->
+ <!-- <version>9.1.3.v20140225</version> -->
+ <!-- </dependency> -->
+ <!-- <dependency> -->
+ <!-- <groupId>org.eclipse.jetty</groupId> -->
+ <!-- <artifactId>jetty-security</artifactId> -->
+ <!-- <version>9.1.3.v20140225</version> -->
+ <!-- </dependency> -->
+ <!-- <dependency> -->
+ <!-- <groupId>org.eclipse.jetty</groupId> -->
+ <!-- <artifactId>jetty-http</artifactId> -->
+ <!-- <version>${jetty.version}</version> -->
+ <!-- </dependency> -->
+ <!-- <dependency> -->
+ <!-- <groupId>org.eclipse.jetty</groupId> -->
+ <!-- <artifactId>jetty-io</artifactId> -->
+ <!-- <version>${jetty.version}</version> -->
+ <!-- </dependency> -->
+ <!-- <dependency> -->
+ <!-- <groupId>javax.servlet</groupId> -->
+ <!-- <artifactId>javax.servlet-api</artifactId> -->
+ <!-- <version>3.1.0</version> -->
+ <!-- </dependency> -->
- <!-- <dependency> -->
- <!-- <groupId>javax.servlet</groupId> -->
- <!-- <artifactId>jsp-api</artifactId> -->
- <!-- <version>2.0</version> -->
- <!-- </dependency> -->
+ <!-- <dependency> -->
+ <!-- <groupId>javax.servlet</groupId> -->
+ <!-- <artifactId>jsp-api</artifactId> -->
+ <!-- <version>2.0</version> -->
+ <!-- </dependency> -->
- <dependency>
- <groupId>net.sf.ehcache</groupId>
- <artifactId>ehcache-core</artifactId>
- <version>2.4.3</version>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-core</artifactId>
- <version>4.1.10.Final</version>
- </dependency>
- <dependency>
- <groupId>org.hibernate.common</groupId>
- <artifactId>hibernate-commons-annotations</artifactId>
- <version>4.0.1.Final</version>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-search-engine</artifactId>
- <version>4.2.0.Final</version>
- </dependency>
- <dependency>
- <groupId>org.hibernate.javax.persistence</groupId>
- <artifactId>hibernate-jpa-2.0-api</artifactId>
- <version>1.0.1.Final</version>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-envers</artifactId>
- <version>4.1.10.Final</version>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-entitymanager</artifactId>
- <version>4.1.10.Final</version>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.11</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.17</version>
- </dependency>
- <dependency>
- <groupId>org.jdom</groupId>
- <artifactId>jdom</artifactId>
- <version>1.1.3</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>org.springframework.context</artifactId>
- <version>3.2.2.RELEASE</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>org.springframework.aspects</artifactId>
- <version>3.2.2.RELEASE</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>org.springframework.beans</artifactId>
- <version>3.2.2.RELEASE</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>org.springframework.transaction</artifactId>
- <version>3.2.2.RELEASE</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>org.springframework.web</artifactId>
- <version>3.2.2.RELEASE</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>org.springframework.core</artifactId>
- <version>3.2.2.RELEASE</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>org.springframework.aop</artifactId>
- <version>3.2.2.RELEASE</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>org.springframework.expression</artifactId>
- <version>3.2.2.RELEASE</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>org.springframework.orm</artifactId>
- <version>3.2.2.RELEASE</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>org.springframework.jdbc</artifactId>
- <version>3.2.2.RELEASE</version>
- </dependency>
- <dependency>
- <groupId>org.springframework.security</groupId>
- <artifactId>spring-security-core</artifactId>
- <version>3.1.3.RELEASE</version>
- </dependency>
- <dependency>
- <groupId>org.springframework.security</groupId>
- <artifactId>spring-security-config</artifactId>
- <version>3.1.3.RELEASE</version>
- </dependency>
- <dependency>
- <groupId>org.springframework.security</groupId>
- <artifactId>spring-security-remoting</artifactId>
- <version>3.1.3.RELEASE</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging</artifactId>
- <version>3.1.3.GA</version>
- </dependency>
- <dependency>
- <groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-core</artifactId>
- <version>1.3</version>
- </dependency>
- <dependency>
- <groupId>com.mchange</groupId>
- <artifactId>c3p0</artifactId>
- <version>0.9.2</version>
- </dependency>
- <dependency>
- <groupId>org.jboss.spec.javax.transaction</groupId>
- <artifactId>jboss-transaction-api_1.1_spec</artifactId>
- <version>1.0.0.Final</version>
- </dependency>
- <dependency>
- <groupId>org.aspectj</groupId>
- <artifactId>aspectjrt</artifactId>
- <version>1.7.1</version>
- </dependency>
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>1.1.1</version>
- </dependency>
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- <version>2.6</version>
- </dependency>
- <dependency>
- <groupId>aopalliance</groupId>
- <artifactId>aopalliance</artifactId>
- <version>1.0</version>
- </dependency>
- <dependency>
- <groupId>joda-time</groupId>
- <artifactId>joda-time</artifactId>
- <version>2.1</version>
- </dependency>
- <dependency>
- <groupId>com.ibm.lsid</groupId>
- <artifactId>lsid-client</artifactId>
- <version>1.1.2</version>
- </dependency>
- <dependency>
- <groupId>com.ibm.lsid</groupId>
- <artifactId>lsid-server</artifactId>
- <version>1.1.2</version>
- </dependency>
- <dependency>
- <groupId>org.apache.lucene</groupId>
- <artifactId>lucene-core</artifactId>
- <version>3.6.2</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>1.7.2</version>
- </dependency>
- <dependency>
- <groupId>org.javassist</groupId>
- <artifactId>javassist</artifactId>
- <version>3.17.1-GA</version>
- </dependency>
- <dependency>
- <groupId>au.com.bytecode</groupId>
- <artifactId>opencsv</artifactId>
- <version>2.4</version>
- </dependency>
+ <dependency>
+ <groupId>net.sf.ehcache</groupId>
+ <artifactId>ehcache-core</artifactId>
+ <version>2.4.3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-core</artifactId>
+ <version>4.1.10.Final</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate.common</groupId>
+ <artifactId>hibernate-commons-annotations</artifactId>
+ <version>4.0.1.Final</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-search-engine</artifactId>
+ <version>4.2.0.Final</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate.javax.persistence</groupId>
+ <artifactId>hibernate-jpa-2.0-api</artifactId>
+ <version>1.0.1.Final</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-envers</artifactId>
+ <version>4.1.10.Final</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-entitymanager</artifactId>
+ <version>4.1.10.Final</version>
+ </dependency>
+ <dependency>
+ <groupId>dom4j</groupId>
+ <artifactId>dom4j</artifactId>
+ <version>1.6</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jadira.usertype</groupId>
+ <artifactId>usertype.jodatime</artifactId>
+ <version>2.0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jadira.usertype</groupId>
+ <artifactId>usertype.spi</artifactId>
+ <version>2.0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.11</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.17</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jdom</groupId>
+ <artifactId>jdom</artifactId>
+ <version>1.1.3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>org.springframework.context</artifactId>
+ <version>3.2.2.RELEASE</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>org.springframework.context.support</artifactId>
+ <version>3.2.2.RELEASE</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>org.springframework.aspects</artifactId>
+ <version>3.2.2.RELEASE</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>org.springframework.test</artifactId>
+ <version>3.2.2.RELEASE</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>org.springframework.beans</artifactId>
+ <version>3.2.2.RELEASE</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>org.springframework.transaction</artifactId>
+ <version>3.2.2.RELEASE</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>org.springframework.web</artifactId>
+ <version>3.2.2.RELEASE</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>org.springframework.core</artifactId>
+ <version>3.2.2.RELEASE</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>org.springframework.aop</artifactId>
+ <version>3.2.2.RELEASE</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>org.springframework.expression</artifactId>
+ <version>3.2.2.RELEASE</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>org.springframework.orm</artifactId>
+ <version>3.2.2.RELEASE</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>org.springframework.jdbc</artifactId>
+ <version>3.2.2.RELEASE</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.security</groupId>
+ <artifactId>spring-security-core</artifactId>
+ <version>3.1.3.RELEASE</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.security</groupId>
+ <artifactId>spring-security-config</artifactId>
+ <version>3.1.3.RELEASE</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.security</groupId>
+ <artifactId>spring-security-remoting</artifactId>
+ <version>3.1.3.RELEASE</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging</artifactId>
+ <version>3.1.3.GA</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest-core</artifactId>
+ <version>1.3</version>
+ </dependency>
+ <dependency>
+ <groupId>com.mchange</groupId>
+ <artifactId>c3p0</artifactId>
+ <version>0.9.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.spec.javax.transaction</groupId>
+ <artifactId>jboss-transaction-api_1.1_spec</artifactId>
+ <version>1.0.0.Final</version>
+ </dependency>
+ <dependency>
+ <groupId>org.aspectj</groupId>
+ <artifactId>aspectjrt</artifactId>
+ <version>1.7.1</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.1.1</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.6</version>
+ </dependency>
+ <dependency>
+ <groupId>aopalliance</groupId>
+ <artifactId>aopalliance</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>joda-time</groupId>
+ <artifactId>joda-time</artifactId>
+ <version>2.1</version>
+ </dependency>
+ <dependency>
+ <groupId>com.ibm.lsid</groupId>
+ <artifactId>lsid-client</artifactId>
+ <version>1.1.2</version>
+ </dependency>
+ <dependency>
+ <groupId>com.ibm.lsid</groupId>
+ <artifactId>lsid-server</artifactId>
+ <version>1.1.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.lucene</groupId>
+ <artifactId>lucene-core</artifactId>
+ <version>3.6.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.7.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.javassist</groupId>
+ <artifactId>javassist</artifactId>
+ <version>3.17.1-GA</version>
+ </dependency>
+ <dependency>
+ <groupId>au.com.bytecode</groupId>
+ <artifactId>opencsv</artifactId>
+ <version>2.4</version>
+ </dependency>
- <!-- For Unit Tests -->
- <dependency>
- <groupId>org.unitils</groupId>
- <artifactId>unitils-spring</artifactId>
- <version>3.4.2</version>
- </dependency>
- <dependency>
- <groupId>org.unitils</groupId>
- <artifactId>unitils-database</artifactId>
- <version>3.4.2</version>
- </dependency>
- <dependency>
- <groupId>commons-dbcp</groupId>
- <artifactId>commons-dbcp</artifactId>
- <version>1.4</version>
- </dependency>
- <dependency>
- <groupId>commons-pool</groupId>
- <artifactId>commons-pool</artifactId>
- <version>1.5.4</version>
- </dependency>
- <dependency>
- <groupId>org.unitils</groupId>
- <artifactId>unitils-dbmaintainer</artifactId>
- <version>3.4.2</version>
- </dependency>
- <dependency>
- <groupId>com.h2database</groupId>
- <artifactId>h2</artifactId>
- <version>1.4.181</version>
- </dependency>
- <dependency>
- <groupId>org.unitils</groupId>
- <artifactId>unitils-dbunit</artifactId>
- <version>3.4.2</version>
- </dependency>
- <dependency>
- <groupId>org.dbunit</groupId>
- <artifactId>dbunit</artifactId>
- <version>2.4.9</version>
- </dependency>
- </dependencies>
+
+ <!-- For Unit Tests Start -->
+ <dependency>
+ <groupId>org.unitils</groupId>
+ <artifactId>unitils-spring</artifactId>
+ <version>3.4.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.unitils</groupId>
+ <artifactId>unitils-database</artifactId>
+ <version>3.4.2</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-dbcp</groupId>
+ <artifactId>commons-dbcp</artifactId>
+ <version>1.4</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-pool</groupId>
+ <artifactId>commons-pool</artifactId>
+ <version>1.5.4</version>
+ </dependency>
+ <dependency>
+ <groupId>org.unitils</groupId>
+ <artifactId>unitils-dbmaintainer</artifactId>
+ <version>3.4.2</version>
+ </dependency>
+ <dependency>
+ <groupId>com.h2database</groupId>
+ <artifactId>h2</artifactId>
+ <version>1.4.181</version>
+ </dependency>
+ <dependency>
+ <groupId>org.unitils</groupId>
+ <artifactId>unitils-dbunit</artifactId>
+ <version>3.4.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.dbunit</groupId>
+ <artifactId>dbunit</artifactId>
+ <version>2.4.9</version>
+ </dependency>
+ <!-- For Unit Tests End -->
+
+ <!-- For Hibernate Mapping Start -->
+ <dependency>
+ <groupId>wsdl4j</groupId>
+ <artifactId>wsdl4j</artifactId>
+ <version>1.6.3</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.validation</groupId>
+ <artifactId>validation-api</artifactId>
+ <version>1.1.0.Final</version>
+ </dependency>
+ <!-- For Hibernate Mapping End -->
+ </dependencies>
</project>
\ No newline at end of file
import eu.etaxonomy.cdm.model.common.CdmBase;
import eu.etaxonomy.cdm.model.common.PersistentMultiLanguageText;
import eu.etaxonomy.taxeditor.remoting.session.CdmEntitySessionManager;
+import eu.etaxonomy.taxeditor.remoting.CdmRemotingException;
/**
* @author cmathew
@Override
public CdmBase find(Class<? extends CdmBase> clazz, int id) {
if(cacheEnabled) {
- CdmBase cdmEntity = cdmEntitySessionManager.getActiveCdmTransientEntityCacher().getFromCache(clazz, id);
- if(cdmEntity != null) {
- return cdmEntity;
- } else {
- cdmEntity = CdmBase.deproxy(commonService.find(clazz, id),clazz);
- cdmEntitySessionManager.getActiveCdmTransientEntityCacher().put(cdmEntity);
- return cdmEntity;
- }
+ CdmBase cdmEntity = CdmBase.deproxy(commonService.find(clazz, id),clazz);
+ return cdmEntitySessionManager.getActiveCdmTransientEntityCacher().load(cdmEntity, true);
} else {
return CdmBase.deproxy(commonService.find(clazz, id),clazz);
}
@Override
public void updatePersistentCollection(CollectionField colf) {
if(cacheEnabled) {
- switch(colf.getType()) {
- case MAP:
- cdmEntityCachingUtils.cachify((Map<Object,Object>)colf.getCollection());
- case SET:
- case LIST:
- default:
- }
+ cdmEntitySessionManager.getActiveCdmTransientEntityCacher().load(colf.getCollection(), true);
}
}
if(pc instanceof PersistentSortedMap) {
return new CollectionField(new TreeMap((Map)pc), CollectionType.MAP);
}
+ throw new CdmRemotingException("Cannot get Collection field for type " + pc.getClass().getName());
}
return null;
}
return true;
}
CdmEntityCacheKey that = (CdmEntityCacheKey) obj;
- if(this.persistenceClass.equals(that.getClass()) && this.persistenceId == that.persistenceId) {
+ if(this.persistenceClass.equals(that.persistenceClass) && this.persistenceId == that.persistenceId) {
return true;
}
package eu.etaxonomy.cdm.api.cache;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
private static final Logger logger = Logger.getLogger(CdmModelCacher.class);
- private List<CdmModelGetMethodFromClass> cmgmfcList = new ArrayList<CdmModelGetMethodFromClass>();
+ private List<CdmModelFieldPropertyFromClass> cmgmfcList = new ArrayList<CdmModelFieldPropertyFromClass>();
public void cacheGetters() {
Class mappedClass = persistentClass.getMappedClass();
String mappedClassName = mappedClass.getName();
- CdmModelGetMethodFromClass cmgmfc = new CdmModelGetMethodFromClass(mappedClassName);
+ CdmModelFieldPropertyFromClass cmgmfc = new CdmModelFieldPropertyFromClass(mappedClassName);
Iterator propertyIt = persistentClass.getPropertyIterator();
logger.info("Adding class : " + mappedClassName + " to cache");
+
while(propertyIt.hasNext())
{
Property property = (Property)propertyIt.next();
Getter getter = property.getGetter(mappedClass);
- if(getter != null && getter.getMember() != null) {
- String getMethod = getMethodNameFromFieldName(getter.getMember().getName());
- logger.info(" - getMethod : " + getMethod);
+ if(getter != null && getter.getMember() != null) {
+ Field field = (Field)getter.getMember();
+ String getMethod = getMethodNameFromFieldName(field.getName(), field.getType().getName());
+ logger.info(" - getMethod : " + getMethod + " for type " + field.getType().getName());
cmgmfc.addGetMethods(getMethod);
}
}
}
cache.flush();
}
+
+ public void cacheGetterFields() {
- public List<CdmModelGetMethodFromClass> getCdmModelGetMethodFromClassList() {
+ Configuration configuration = new Configuration().configure("/eu/etaxonomy/cdm/mappings/hibernate.cfg.xml");
+ configuration.buildMappings();
+ Iterator<PersistentClass> classMappingIterator = configuration.getClassMappings();
+
+ Cache cache = CdmRemoteCacheManager.getInstance().getCdmModelGetMethodsCache();
+ cache.removeAll();
+
+ while(classMappingIterator.hasNext()) {
+ PersistentClass persistentClass = classMappingIterator.next();
+ Class mappedClass = persistentClass.getMappedClass();
+ String mappedClassName = mappedClass.getName();
+
+ CdmModelFieldPropertyFromClass cmgmfc = new CdmModelFieldPropertyFromClass(mappedClassName);
+ Iterator propertyIt = persistentClass.getPropertyIterator();
+
+ logger.info("Adding class : " + mappedClassName + " to cache");
+
+ while(propertyIt.hasNext())
+ {
+ Property property = (Property)propertyIt.next();
+ Getter getter = property.getGetter(mappedClass);
+ if(getter != null && getter.getMember() != null) {
+ Field field = (Field)getter.getMember();
+ //String getMethod = getMethodNameFromFieldName(field.getName(), field.getType().getName());
+ logger.info(" - contains field '" + field.getName() + "' of type '" + field.getType().getName() + "'");
+ cmgmfc.addGetMethods(field.getName());
+ }
+ }
+ cache.put(new Element(mappedClassName, cmgmfc));
+
+ }
+ cache.flush();
+ }
+
+ public void checkGetterMethods() {
+
+ Configuration configuration = new Configuration().configure("/eu/etaxonomy/cdm/mappings/hibernate.cfg.xml");
+ configuration.buildMappings();
+ Iterator<PersistentClass> classMappingIterator = configuration.getClassMappings();
+
+ Cache cache = CdmRemoteCacheManager.getInstance().getCdmModelGetMethodsCache();
+ cache.removeAll();
+
+ while(classMappingIterator.hasNext()) {
+ PersistentClass persistentClass = classMappingIterator.next();
+ Class mappedClass = persistentClass.getMappedClass();
+ String mappedClassName = mappedClass.getName();
+
+ Iterator propertyIt = persistentClass.getPropertyIterator();
+
+ Method[] methods = mappedClass.getMethods();
+
+ while(propertyIt.hasNext())
+ {
+ Property property = (Property)propertyIt.next();
+ Getter getter = property.getGetter(mappedClass);
+ if(getter != null && getter.getMember() != null) {
+ Field field = (Field)getter.getMember();
+ String getMethod = getMethodNameFromFieldName(field.getName(), field.getType().getName());
+
+ boolean foundMethod = false;
+ for(Method method : methods) {
+ if(method.getName().equals(getMethod)) {
+ foundMethod = true;
+ break;
+ }
+ }
+ if(!foundMethod) {
+ logger.info("Inferred method " + getMethod + " does not exist in class " + mappedClassName);
+ //throw new CdmClientCacheException("Inferred method " + getMethod + " does not exist in class " + mappedClassName);
+ }
+ }
+ }
+
+
+ }
+
+ }
+
+ public List<CdmModelFieldPropertyFromClass> getCdmModelGetMethodFromClassList() {
cmgmfcList.clear();
Configuration configuration = new Configuration().configure("/eu/etaxonomy/cdm/mappings/hibernate.cfg.xml");
configuration.buildMappings();
Class mappedClass = persistentClass.getMappedClass();
String mappedClassName = mappedClass.getName();
- CdmModelGetMethodFromClass cmgmfc = new CdmModelGetMethodFromClass(mappedClassName);
+ CdmModelFieldPropertyFromClass cmgmfc = new CdmModelFieldPropertyFromClass(mappedClassName);
Iterator propertyIt = persistentClass.getPropertyIterator();
while(propertyIt.hasNext())
{
Property property = (Property)propertyIt.next();
Getter getter = property.getGetter(mappedClass);
- if(getter != null && getter.getMember() != null) {
- String getMethod = getMethodNameFromFieldName(getter.getMember().getName());
+ if(getter != null && getter.getMember() != null) {
+ Field field = (Field)getter.getMember();
+ String getMethod = getMethodNameFromFieldName(getter.getMember().getName(),field.getType().getName());
cmgmfc.addGetMethods(getMethod);
}
}
}
- public static String getMethodNameFromFieldName(String fieldName) {
- return "get" + fieldName.substring(0, 1).toUpperCase() + fieldName.substring(1);
+ public static String getMethodNameFromFieldName(String fieldName, String type) {
+ String prefix = type != null && type.toLowerCase().endsWith("boolean") ? "is" : "get";
+ String getMethod = prefix + fieldName.substring(0, 1).toUpperCase() + fieldName.substring(1);
+ return getMethod;
}
+
+
import java.util.ArrayList;
import java.util.List;
-public class CdmModelGetMethodFromClass implements Serializable {
+public class CdmModelFieldPropertyFromClass implements Serializable {
+ private static final long serialVersionUID = 5726395976531887526L;
private String className;
private String parentClassName;
- private List<String> getMethods = new ArrayList<String>();
+ private List<String> fields = new ArrayList<String>();
- public CdmModelGetMethodFromClass(String className) {
+ public CdmModelFieldPropertyFromClass(String className) {
this.setClassName(className);
}
this.parentClassName = parentClassName;
}
- public List<String> getGetMethods() {
- return getMethods;
+ public List<String> getFields() {
+ return fields;
}
- public void setGetMethods(List<String> getMethods) {
- this.getMethods = getMethods;
+ public void setFields(List<String> fields) {
+ this.fields = fields;
}
public void addGetMethods(String getMethod) {
- this.getMethods.add(getMethod);
+ this.fields.add(getMethod);
}
public String getClassName() {
// $Id$
/**
-* Copyright (C) 2014 EDIT
-* European Distributed Institute of Taxonomy
-* http://www.e-taxonomy.eu
-*
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
+ * Copyright (C) 2014 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
package eu.etaxonomy.cdm.api.cache;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import java.util.UUID;
+import javassist.util.proxy.ProxyFactory;
+
import net.sf.ehcache.Cache;
import net.sf.ehcache.Element;
import net.sf.ehcache.config.CacheConfiguration;
import net.sf.ehcache.store.MemoryStoreEvictionPolicy;
import org.apache.log4j.Logger;
+import org.hibernate.collection.spi.PersistentCollection;
+import org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.util.ReflectionUtils;
+import eu.etaxonomy.cdm.api.service.ICommonService;
import eu.etaxonomy.cdm.model.common.CdmBase;
/**
+ *
+ * This cache guarantees that
+ * - all objects put will be ancestors of CdmBase
+ * - all CdmBase objects in the cache will be already de-proxied
+ * - after any CdmBase object is put in the cache,
+ * all non-null / non-proxy CdmBase objects in the sub-graph
+ * will also be present in the cache.
+ *
* @author cmathew
* @date 14 Oct 2014
*
public class CdmTransientEntityCacher extends CdmServiceCacher {
private static final Logger logger = Logger.getLogger(CdmTransientEntityCacher.class);
-
+
+ @Autowired
+ private CdmEntityCachingUtils cdmEntityCachingUtils;
+
@Autowired
- private CdmEntityCachingUtils cdmEntityCachingUtils;
+ private ICommonService commonService;
private String cacheId;
-
+
private Cache cache;
-
+
private Cache cdmlibModelCache;
+
+ private static boolean isRecursiveEnabled = true;
+
+
+ public CdmTransientEntityCacher(String cacheId) {
+ this.cacheId = cacheId;
+
+ cache = new Cache(getEntityCacheConfiguration(cacheId));
+ getDefaultCacheManager().addCache(cache);
+
+ cdmlibModelCache = CdmRemoteCacheManager.getInstance().getCdmModelGetMethodsCache();
+
+ }
+
+ public CdmTransientEntityCacher(Object obj) {
+ this(obj.getClass().getName() + String.valueOf(obj.hashCode()));
+ }
+
+ /**
+ * Returns the default cache configuration.
+ *
+ * @return
+ */
+ private CacheConfiguration getEntityCacheConfiguration(String cacheId) {
+ // For a better understanding on how to size caches, refer to
+ // http://ehcache.org/documentation/configuration/cache-size
+ return new CacheConfiguration(cacheId, 500)
+ .memoryStoreEvictionPolicy(MemoryStoreEvictionPolicy.LFU)
+ .eternal(false)
+ // default ttl and tti set to 2 hours
+ .timeToLiveSeconds(60*60*2)
+ .timeToIdleSeconds(60*60*2);
+
+ }
+
+
+ /**
+ * Returns the cache corresponding to the cache id
+ *
+ * @param cacheId
+ * @return
+ */
+ private Cache getCache() {
+ return getDefaultCacheManager().getCache(cacheId);
+ }
+
+ public <T extends Object> T load(T obj, boolean recursive) {
+ if(obj instanceof CdmBase) {
+ return load(obj, recursive);
+ } else if (obj instanceof Map) {
+ return load(obj, recursive);
+ }
+
+ return obj;
+ }
- private static boolean isRecursiveEnabled;
+ @SuppressWarnings("unchecked")
+ private <T extends Object> T loadRecursive(T obj, Set<CdmBase> alreadyVisitedEntities) {
+ if(obj instanceof CdmBase) {
+ return loadRecursive(obj, alreadyVisitedEntities);
+ } else if (obj instanceof Map) {
+ return (T) load((Map<T,T>)obj, alreadyVisitedEntities);
+ }
+ logger.info("No caching yet for type " + obj.getClass().getName());
+
+ return obj;
+ }
- public CdmTransientEntityCacher(String cacheId) {
- this.cacheId = cacheId;
- // Create entity cache
- cache = new Cache(getEntityCacheConfiguration(cacheId));
- getDefaultCacheManager().addCache(cache);
-
- cdmlibModelCache = CdmRemoteCacheManager.getInstance().getCdmModelGetMethodsCache();
-
- }
-
- public CdmTransientEntityCacher(Object obj) {
- this(obj.getClass().getName() + String.valueOf(obj.hashCode()));
- }
-
- /**
- * Returns the default cache configuration.
- *
- * @return
- */
- private CacheConfiguration getEntityCacheConfiguration(String cacheId) {
- // For a better understanding on how to size caches, refer to
- // http://ehcache.org/documentation/configuration/cache-size
- return new CacheConfiguration(cacheId, 500)
- .memoryStoreEvictionPolicy(MemoryStoreEvictionPolicy.LFU)
- .eternal(false)
- // default ttl and tti set to 2 hours
- .timeToLiveSeconds(60*60*2)
- .timeToIdleSeconds(60*60*2);
-
- // This is 2.6.9 API
- //.maxEntriesLocalDisk(1000);
- //.persistence(new PersistenceConfiguration().strategy(Strategy.LOCALTEMPSWAP));
- }
+ public <T extends Object> Map<T,T> load(Map<T,T> map, boolean recursive){
+ if(isRecursiveEnabled && recursive) {
+ logger.info("---- starting recursive load for map");
+ Set<CdmBase> alreadyVisitedEntities = new HashSet<CdmBase>();
+ Map<T,T> cachedMap = load(map, alreadyVisitedEntities);
+ alreadyVisitedEntities.clear();
+ logger.info("---- ending recursive load for cdm entity map \n");
+ return cachedMap;
+ } else {
+ return load(map, null);
+ }
+ }
-
- /**
- * Returns the cache corresponding to the cache id
- *
- * @param cacheId
- * @return
- */
- private Cache getCache() {
- return getDefaultCacheManager().getCache(cacheId);
- }
-
-
- /**
- * Puts the (Key,Value) pair of ({@link java.util.UUID}, {@link eu.etaxonomy.cdm.model.common.CdmBase}),
- * in the cache corresponding to the given cache id
- *
- * @param cacheId
- * @param uuid
- * @param cdmEntity
- */
- public CdmBase load(CdmBase cdmEntity, boolean recursive) {
- CdmEntityCacheKey id = new CdmEntityCacheKey(cdmEntity);
- // first look in 'this' cache
- CdmBase cachedCdmEntity = getFromCache(id);
-
- if(cachedCdmEntity == null) {
- // then try the permanent (uuid-based) cache
- cachedCdmEntity = getFromCache(cdmEntity.getUuid());
- }
- if(isRecursiveEnabled && recursive) {
- String className = cdmEntity.getClass().getName();
- CdmModelGetMethodFromClass cmgmfc = getFromCdmlibModelCache(className);
- if(cmgmfc != null) {
- List<String> getMethods = cmgmfc.getGetMethods();
- }
- }
- if(cachedCdmEntity != null) {
- return cachedCdmEntity;
- } else {
- getCache().put(new Element(id, cdmEntity));
- return cdmEntity;
+ private <T extends Object> Map<T,T> load(Map<T,T> map, Set<CdmBase> alreadyVisitedEntities){
+ if(map == null || map.isEmpty()) {
+ return map;
}
- }
-
- public void put(CdmBase cdmEntity) {
- CdmEntityCacheKey id = new CdmEntityCacheKey(cdmEntity);
- Element cachedCdmEntityElement = getCacheElement(id);
-
- if(cachedCdmEntityElement == null) {
- cachedCdmEntityElement = getCacheElement(cdmEntity.getUuid());
- if(cachedCdmEntityElement != null) {
- logger.info("Cdm Entity with id : " + cdmEntity.getId() + " already exists in permanent cache. Ignoring put.");
- return;
- }
+
+ int originalMapSize = map.size();
+ Object[] result = new Object[ map.size() * 2 ];
+ Iterator<Map.Entry<T,T>> iter = map.entrySet().iterator();
+ int i=0;
+ while ( iter.hasNext() ) {
+ Map.Entry<T,T> e = (Map.Entry<T,T>) iter.next();
+ result[i++] = e.getKey();
+ result[i++] = e.getValue();
}
-
- getCache().put(new Element(id, cdmEntity));
- }
-
- private Element getCacheElement(CdmEntityCacheKey key) {
- return getCache().get(key);
- }
-
- public CdmModelGetMethodFromClass getFromCdmlibModelCache(String className) {
- Element e = cdmlibModelCache.get(className);
- if (e == null) {
- return null;
- } else {
- return (CdmModelGetMethodFromClass) e.getObjectValue();
+ for(i=0; i<result.length;i++) {
+ if(alreadyVisitedEntities == null) {
+ result[i] = load(result[i], false);
+ } else {
+ result[i] = loadRecursive(result[i], alreadyVisitedEntities);
+ }
}
- }
-
- public CdmBase getFromCache(CdmEntityCacheKey id) {
- Element e = getCacheElement(id);
- if (e == null) {
- return null;
- } else {
- return (CdmBase) e.getObjectValue();
+ map.clear();
+ for(i = 0; i < originalMapSize; i+=2 ) {
+ map.put(
+ (T)result[i],
+ (T)result[i+1]
+ );
}
- }
+ return map;
+ }
+ /**
+ * Puts the (Key,Value) pair of ({@link java.util.UUID}, {@link eu.etaxonomy.cdm.model.common.CdmBase}),
+ * in the cache corresponding to the given cache id
+ *
+ * @param cacheId
+ * @param uuid
+ * @param cdmEntity
+ */
+ public CdmBase load(CdmBase cdmEntity, boolean recursive) {
+
+ if(isRecursiveEnabled && recursive) {
+ logger.info("---- starting recursive load for cdm entity " + cdmEntity.getClass().getName() + " with id " + cdmEntity.getId());
+ Set<CdmBase> alreadyVisitedEntities = new HashSet<CdmBase>();
+ CdmBase cb = loadRecursive(cdmEntity, alreadyVisitedEntities);
+ alreadyVisitedEntities.clear();
+ logger.info("---- ending recursive load for cdm entity " + cdmEntity.getClass().getName() + " with id " + cdmEntity.getId() + "\n");
+ return cb;
+ } else {
+ return load(cdmEntity);
+ }
+
+ // split into two methods
+ // - load(CdmBase cdmBase)
+ // - recursiveLoad(CdmBase cdmbase, List<CdmBase> alreadyVisitedEntities)
+ // : the entity to be visted should added before the recursive call
+ // and deleted after the call to end finally with a list
+ // of size zero at the end
+ // : entity to recurse should be the original entity and
+ // not the cached one
+
+ }
- public CdmBase getFromCache(Class<? extends CdmBase> clazz, int id) {
- CdmEntityCacheKey cacheId = generateKey(clazz,id);
- return getFromCache(cacheId);
- }
-
- public CdmBase getFromCache(CdmBase cdmBase) {
- CdmEntityCacheKey cacheId = generateKey(cdmBase);
- return getFromCache(cacheId);
- }
-
- public List<CdmBase> getAllEntities() {
- List<CdmBase> entities = new ArrayList<CdmBase>();
- Map<String, CdmBase> elementsMap = getCache().getAllWithLoader(getCache().getKeys(), null);
- for (Map.Entry<String, CdmBase> entry : elementsMap.entrySet()) {
- entities.add(entry.getValue());
- }
- return entities;
- }
+
+ private CdmBase load(CdmBase cdmEntity) {
+ logger.info("loading object of type " + cdmEntity.getClass().getName() + " with id " + cdmEntity.getId());
+ // start by looking up the cdm entity in the cache
+ CdmBase cachedCdmEntity = getFromCache(cdmEntity);
+
+ if(cachedCdmEntity != null) {
+ // if cdm entity was found in cache then return ...
+ logger.info(" - object of type " + cdmEntity.getClass().getName() + " with id " + cdmEntity.getId() + " already exists");
+ return cachedCdmEntity;
+ } else {
+ // ... else save the entity in the cache
+ getCache().put(new Element(generateKey(cdmEntity), cdmEntity));
+ logger.info(" - object of type " + cdmEntity.getClass().getName() + " with id " + cdmEntity.getId() + " put in cache");
+ return cdmEntity;
+ }
+ }
+
+ private CdmBase loadRecursive(CdmBase cdmEntity, Set<CdmBase> alreadyVisitedEntities) {
+ CdmBase cachedCdmEntity = load(cdmEntity);
+
+ // we want to recursive through the cdmEntity (and not the cachedCdmEntity)
+ // since there could be new initialized object in the cdmEntity sub-graph
+
+ // start by getting the fields from the cdm entity
+ String className = cdmEntity.getClass().getName();
+ CdmModelFieldPropertyFromClass cmgmfc = getFromCdmlibModelCache(className);
+ if(cmgmfc != null) {
+ alreadyVisitedEntities.add(cdmEntity);
+ List<String> fields = cmgmfc.getFields();
+ for(String field : fields) {
+ // retrieve the actual object corresponding to the field.
+ // this object will be either a CdmBase or a Collection / Map
+ // with CdmBase as the generic type
+ // In the case that the returned is either a Collection or a Map
+ // the individual objects inside these also need to be loaded
+ // by calling the corresponding cachify method in the
+ // CdmEntityCachingUtils
+
+ CdmBase cdmEntityInSubGraph = getCdmBaseTypeFieldValue(cdmEntity, cachedCdmEntity, field);
+ if(cdmEntityInSubGraph != null && !alreadyVisitedEntities.contains(cdmEntityInSubGraph)) {
+ logger.info("recursive loading object of type " + cdmEntityInSubGraph.getClass().getName() + " with id " + cdmEntityInSubGraph.getId());
+ loadRecursive(cdmEntityInSubGraph, alreadyVisitedEntities);
+ }
+ }
+ }
+ return cachedCdmEntity;
+ }
- /* (non-Javadoc)
- * @see eu.etaxonomy.cdm.model.ICdmCacher#exists(java.util.UUID)
- */
- @Override
- public boolean exists(UUID uuid) {
- return (getCacheElement(uuid) != null || super.getCacheElement(uuid) != null);
- }
+
+ private CdmBase getCdmBaseTypeFieldValue(CdmBase cdmEntity, CdmBase cachedCdmEntity, String fieldName) {
+
+
+ if(cachedCdmEntity == null) {
+ throw new CdmClientCacheException("When trying to set filed value, the cached cdm entity cannot be null");
+ }
+
+ Class<?> clazz = cdmEntity.getClass();
+ try {
+ // this call will search in the provided class as well as
+ // the super classes until it finds the field
+ Field field = ReflectionUtils.findField(clazz, fieldName);
+ // logger.info("Retrieving field " + field
+ // + " from cdm entity of type " + c.getName()
+ // + " with id " + cdmEntity.getId());
- public boolean exists(CdmEntityCacheKey key) {
- return (getCacheElement(key) != null);
- }
+ if(field == null) {
+ throw new CdmClientCacheException("Field '" + fieldName
+ + "' not found when searching in class '" + clazz.getName() + "' and its supercalsses");
+ }
+ field.setAccessible(true);
+ Object o = field.get(cdmEntity);
+ // if(o == null) {
+ // logger.info(" - resulting object is null");
+ // } else if(ProxyFactory.isProxyClass(o.getClass())) {
+ // logger.info(" - resulting object is a proxy object");
+ // } else if(o instanceof PersistentCollection) {
+ // logger.info(" - resulting object is a persistent collection object");
+ // } else {
+ // logger.info(" - resulting object is of type " + o.getClass().getName());
+ // }
+ CdmBase cdmEntityInSubGraph = null;
+ if(o != null
+ && !ProxyFactory.isProxyClass(o.getClass())
+ && !(o instanceof PersistentCollection)
+ && CdmBase.class.isAssignableFrom(o.getClass())) {
+ // logger.info("retrieving object of type " + o.getClass().getName()
+ // + " with id " + ((CdmBase)o).getId());
+
+ //FIXME:Remoting add case for collection / map
+ //FIXME:Remoting if cached entity != original entity then
+ // replace original with cache using
+ // field.set and return original entity
+ cdmEntityInSubGraph = (CdmBase)o;
+
+ CdmBase cachedCdmEntityInSubGraph = getFromCache(cdmEntityInSubGraph);
- /* (non-Javadoc)
- * @see eu.etaxonomy.cdm.model.ICdmCacher#existsAndIsNotNull(java.util.UUID)
- */
- @Override
- public boolean existsAndIsNotNull(UUID uuid) {
- return getFromCache(uuid) != null;
- }
+ if(cachedCdmEntityInSubGraph != null) {
+ if(cachedCdmEntityInSubGraph != cdmEntityInSubGraph) {
+ field.set(cachedCdmEntity, cachedCdmEntityInSubGraph);
+ }
+ } else {
+ field.set(cachedCdmEntity, cdmEntityInSubGraph);
+ }
+ }
+ // we return the original cdm entity in the sub graph because we
+ // want to continue to recurse on the input cdm entity graph
+ // and not the one in the cache
+ return cdmEntityInSubGraph;
+ } catch (SecurityException e) {
+ throw new CdmClientCacheException(e);
+ } catch (IllegalArgumentException e) {
+ throw new CdmClientCacheException(e);
+ } catch (IllegalAccessException e) {
+ throw new CdmClientCacheException(e);
+ }
+ }
- public boolean existsAndIsNotNull(CdmEntityCacheKey id) {
- return getFromCache(id) != null;
- }
+ public void put(CdmBase cdmEntity) {
+ CdmEntityCacheKey id = new CdmEntityCacheKey(cdmEntity);
+ Element cachedCdmEntityElement = getCacheElement(id);
+ if(cachedCdmEntityElement == null) {
+ cachedCdmEntityElement = getCacheElement(cdmEntity.getUuid());
+ if(cachedCdmEntityElement != null) {
+ logger.info("Cdm Entity with id : " + cdmEntity.getId() + " already exists in permanent cache. Ignoring put.");
+ return;
+ }
+ }
+
+ getCache().put(new Element(id, cdmEntity));
+ }
- public static CdmEntityCacheKey generateKey(Class<? extends CdmBase> clazz, int id) {
- return new CdmEntityCacheKey(clazz, id);
- }
-
-
- public static CdmEntityCacheKey generateKey(CdmBase cdmBase) {
+
+ private Element getCacheElement(CdmEntityCacheKey key) {
+ return getCache().get(key);
+ }
+
+ public CdmModelFieldPropertyFromClass getFromCdmlibModelCache(String className) {
+ Element e = cdmlibModelCache.get(className);
+ if (e == null) {
+ return null;
+ } else {
+ return (CdmModelFieldPropertyFromClass) e.getObjectValue();
+ }
+ }
+
+ public CdmBase getFromCache(CdmEntityCacheKey id) {
+ Element e = getCacheElement(id);
+ if (e == null) {
+ return null;
+ } else {
+ return (CdmBase) e.getObjectValue();
+ }
+ }
+
+ public CdmBase getFromCache(Class<? extends CdmBase> clazz, int id) {
+ CdmEntityCacheKey cacheId = generateKey(clazz,id);
+ return getFromCache(cacheId);
+ }
+
+ public CdmBase getFromCache(CdmBase cdmBase) {
+
+ CdmEntityCacheKey cacheId = generateKey(cdmBase);
+
+ CdmBase cachedCdmEntity = getFromCache(cacheId);
+
+ if(cachedCdmEntity == null) {
+ // ... then try the permanent (uuid-based) cache
+ cachedCdmEntity = getFromCache(cdmBase.getUuid());
+ }
+
+ return cachedCdmEntity;
+ }
+
+ public CdmBase getFromCache(CdmBase cdmBase, Class<? extends CdmBase> clazz) {
+
+ cdmBase = CdmBase.deproxy(cdmBase, clazz);
+
+ CdmEntityCacheKey cacheId = generateKey(cdmBase);
+
+ CdmBase cachedCdmEntity = getFromCache(cacheId);
+
+ if(cachedCdmEntity == null) {
+ // ... then try the permanent (uuid-based) cache
+ cachedCdmEntity = getFromCache(cdmBase.getUuid());
+ }
+
+ return cachedCdmEntity;
+ }
+
+ public List<CdmBase> getAllEntities() {
+ List<CdmBase> entities = new ArrayList<CdmBase>();
+ Map<String, CdmBase> elementsMap = getCache().getAllWithLoader(getCache().getKeys(), null);
+ for (Map.Entry<String, CdmBase> entry : elementsMap.entrySet()) {
+ entities.add(entry.getValue());
+ }
+ return entities;
+ }
+
+
+
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.model.ICdmCacher#exists(java.util.UUID)
+ */
+ @Override
+ public boolean exists(UUID uuid) {
+ return (getCacheElement(uuid) != null || super.getCacheElement(uuid) != null);
+ }
+
+ public boolean exists(CdmEntityCacheKey key) {
+ return (getCacheElement(key) != null);
+ }
+
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.model.ICdmCacher#existsAndIsNotNull(java.util.UUID)
+ */
+ @Override
+ public boolean existsAndIsNotNull(UUID uuid) {
+ return getFromCache(uuid) != null;
+ }
+
+ public boolean existsAndIsNotNull(CdmEntityCacheKey id) {
+ return getFromCache(id) != null;
+ }
+
+
+ public static CdmEntityCacheKey generateKey(Class<? extends CdmBase> clazz, int id) {
+ return new CdmEntityCacheKey(clazz, id);
+ }
+
+
+ public static CdmEntityCacheKey generateKey(CdmBase cdmBase) {
Class<? extends CdmBase> entityClass = cdmBase.getClass();
int id = cdmBase.getId();
return new CdmEntityCacheKey(entityClass, id);
- }
+ }
public static boolean isRecursiveEnabled() {
return isRecursiveEnabled;
--- /dev/null
+package eu.etaxonomy.taxeditor.remoting;
+
+public class CdmRemotingException extends RuntimeException {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -560332689478356360L;
+
+ public CdmRemotingException(String message) {
+ super(message);
+ }
+
+}
activeSession = session;
}
- public void add(ISessionEventListener sessionOwner, CdmBase cdmBase) {
+ @SuppressWarnings("unchecked")
+ public <T extends CdmBase> T add(ISessionEventListener sessionOwner, T cdmBase) {
CdmEntitySession session = newSession(sessionOwner,true);
- session.getCdmTransientEntityCacher().load(cdmBase,true);
+ return (T)session.getCdmTransientEntityCacher().load(cdmBase,true);
}
void addToOwnerSessionMap(ISessionEventListener owner, CdmEntitySession session) {
throw new HibernateException("commonService not initialized (null)");
}
- CdmBase cdmBase = CdmBase.deproxy(cachedCommonService.find(clazz,classid),clazz);
+ CdmBase cdmBase = cachedCommonService.find(clazz,classid);
setImplementation(cdmBase);
}
*/
package eu.etaxonomy.cdm.api.cache;
-import java.io.IOException;
import java.util.Arrays;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import java.util.Set;
import java.util.UUID;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.hibernate.collection.spi.PersistentCollection;
import org.junit.Assert;
+import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.Resource;
import org.unitils.dbunit.annotation.DataSet;
-import eu.etaxonomy.cdm.api.cache.CachedCommonServiceImpl;
import eu.etaxonomy.cdm.api.service.ICommonService;
import eu.etaxonomy.cdm.api.service.IPolytomousKeyService;
import eu.etaxonomy.cdm.api.service.ITaxonService;
-import eu.etaxonomy.cdm.model.agent.AgentBase;
import eu.etaxonomy.cdm.model.common.CdmBase;
-import eu.etaxonomy.cdm.model.common.Credit;
-import eu.etaxonomy.cdm.model.common.Extension;
-import eu.etaxonomy.cdm.model.common.IdentifiableSource;
import eu.etaxonomy.cdm.model.common.Language;
import eu.etaxonomy.cdm.model.common.LanguageString;
import eu.etaxonomy.cdm.model.description.KeyStatement;
import eu.etaxonomy.cdm.model.description.PolytomousKey;
import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
-import eu.etaxonomy.cdm.model.media.Rights;
-import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
-import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.taxeditor.httpinvoker.BaseRemotingTest;
import eu.etaxonomy.taxeditor.httpinvoker.CDMServer;
import eu.etaxonomy.taxeditor.remoting.session.CdmEntitySessionManager;
CdmEntitySessionManager cdmEntitySessionManager = getRemoteApplicationController().getCdmEntitySessionManager();
+ CdmTransientEntityCacher cacher;
+
Language english = Language.getLanguageFromUuid(Language.uuidEnglish);
-
+
+ private static final List<String> PKEY_DEPTH1_INIT_STRATEGY = Arrays.asList(new String[] {
+ });
-
+ private static final List<String> PKEY_DEPTH2_INIT_STRATEGY = Arrays.asList(new String[] {
+ "root"});
+
+ private static final List<String> PKEY_DEPTH3_INIT_STRATEGY = Arrays.asList(new String[] {
+ "root.statement"});
- private static final List<String> PKEY_INIT_STRATEGY = Arrays.asList(new String[] {
- "root"});
+ private ISessionEventListener sessionOwner;
@BeforeClass
public static void initializePolytomousKeyTest() {
CDMServer.getInstance().setKeepServerRunning(true);
CdmModelCacher cmdmc = new CdmModelCacher();
- cmdmc.cacheGetters();
+ cmdmc.cacheGetterFields();
//initializeController("default", "127.0.0.1", 8080, "", NomenclaturalCode.ICNAFP);
}
- @Test
- public void readAllPolytomousKeys() {
- List<PolytomousKey> pKeys = polytomousKeyService.list(PolytomousKey.class, null, null, null, null);
- for(PolytomousKey pKey : pKeys) {
- logger.info("Polytomous Key : " + pKey.getTitleCache());
- }
+ @Before
+ public void initializeSession() {
+ sessionOwner = new MockSessionOwner();
+ cdmEntitySessionManager.bind(sessionOwner);
+ cacher = cdmEntitySessionManager.getCdmTransientEntityCacher(sessionOwner);
}
@Test
- public void testCachifyNonRecursive() {
+ public void whenRecursiveCachingIsDisabledObjectsInSubGraphAreNotLoadedInSessionCache() {
CdmTransientEntityCacher.setRecursiveEnabled(false);
ISessionEventListener sessionOwner = new MockSessionOwner();
cdmEntitySessionManager.bind(sessionOwner);
cdmEntitySessionManager.add(sessionOwner, pkey);
CdmTransientEntityCacher cacher = cdmEntitySessionManager.getCdmTransientEntityCacher(sessionOwner);
Assert.assertNull(cacher.getFromCache(pkey));
-
+ CdmTransientEntityCacher.setRecursiveEnabled(true);
}
+
@Test
- public void testCachifyRecursive() {
- CdmTransientEntityCacher.setRecursiveEnabled(false);
- ISessionEventListener sessionOwner = new MockSessionOwner();
- cdmEntitySessionManager.bind(sessionOwner);
- PolytomousKey pkey = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_INIT_STRATEGY),PolytomousKey.class);
- cdmEntitySessionManager.add(sessionOwner, pkey);
+ public void recursiveLoadSubGraphDepth1Test() {
+
+ // this call will load into the session cache the graph
+ // polytomous key
+ // |- root : polytomous key node
+ // in a recursive call
+ PolytomousKey pkey1 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH1_INIT_STRATEGY),PolytomousKey.class);
+ pkey1 = cdmEntitySessionManager.add(sessionOwner, pkey1);
CdmTransientEntityCacher cacher = cdmEntitySessionManager.getCdmTransientEntityCacher(sessionOwner);
+ // checking to make sure the root object is in the session cache
+ Assert.assertSame(pkey1.getRoot(), cacher.getFromCache(pkey1.getRoot()));
+
+ }
+
+
+ @Test
+ public void recursiveLoadSubGraphDepth2Test() {
+
+ // this call will load into the session cache the graph
+ // polytomous key
+ // |- root : polytomous key node
+ // |- question : KeyStatement
+ // |- statement : KeyStatement
+ // in a recursive call
+ PolytomousKey pkey = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY),PolytomousKey.class);
+ pkey = cdmEntitySessionManager.add(sessionOwner, pkey);
+ CdmTransientEntityCacher cacher = cdmEntitySessionManager.getCdmTransientEntityCacher(sessionOwner);
+ // checking to make sure the root object is in the session cache
Assert.assertSame(pkey.getRoot(), cacher.getFromCache(pkey.getRoot()));
+ Assert.assertSame(pkey.getRoot().getStatement(), cacher.getFromCache(pkey.getRoot().getStatement()));
+ Assert.assertSame(pkey.getRoot().getQuestion(), cacher.getFromCache(pkey.getRoot().getQuestion()));
+
+ }
+
+ /**
+ * when : retrieving objects using recursive caching of object graphs with different depths
+ * then : the objects in the sub-graph having the same persistence id should be the same
+ */
+ @Test
+ public void lazyLoadRecursiveTest() {
+
+ // this call will load into the session cache the graph and update the objects in the sub-graph for a
+ // polytomous key
+ // |- root : polytomous key node
+ // |- question : KeyStatement
+ // |- statement : KeyStatement
+ PolytomousKey pkey1 = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid),PolytomousKey.class);
+ pkey1 = cdmEntitySessionManager.add(sessionOwner, pkey1);
+ CdmTransientEntityCacher cacher = cdmEntitySessionManager.getCdmTransientEntityCacher(sessionOwner);
+
}
+
+
+ /**
+ * when : retrieving objects using recursive caching of object graphs with different depths
+ * then : the objects in the sub-graph having the same persistence id should be the same
+ */
+ @Test
+ public void differentSubGraphDepthTest1() {
+
+ // this call will load into the session cache the graph and update the objects in the sub-graph for a
+ // polytomous key
+ // |- root : polytomous key node
+ // in a recursive call
+ PolytomousKey pkey1 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH1_INIT_STRATEGY),PolytomousKey.class);
+ pkey1 = cdmEntitySessionManager.add(sessionOwner, pkey1);
+ CdmTransientEntityCacher cacher = cdmEntitySessionManager.getCdmTransientEntityCacher(sessionOwner);
+
+ // this call will load into the session cache the graph and update the objects in the sub-graph for a
+ // polytomous key
+ // |- root : polytomous key node
+ // |- question : KeyStatement
+ // |- statement : KeyStatement
+ PolytomousKey pkey2 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY),PolytomousKey.class);
+ pkey2 = cdmEntitySessionManager.add(sessionOwner, pkey2);
+
+ Assert.assertSame(pkey2.getRoot().getStatement(), cacher.getFromCache(pkey2.getRoot().getStatement()));
+ Assert.assertSame(pkey1.getRoot().getStatement(), pkey2.getRoot().getStatement());
+ Assert.assertSame(cacher.getFromCache(pkey1.getRoot().getStatement()), cacher.getFromCache(pkey2.getRoot().getStatement()));
+
+ }
+
+ /**
+ * when : retrieving objects using recursive caching of object graphs with different depths
+ * then : the objects in the sub-graph having the same persistence id should be the same
+ */
+ @Test
+ public void differentSubGraphDepthTest2() {
+
+ // this call will load into the session cache the graph and update the objects in the sub-graph for a
+ // polytomous key
+ // |- root : polytomous key node
+ // |- question : KeyStatement
+ // |- statement : KeyStatement
+ PolytomousKey pkey1 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY),PolytomousKey.class);
+ pkey1 = cdmEntitySessionManager.add(sessionOwner, pkey1);
+ CdmTransientEntityCacher cacher = cdmEntitySessionManager.getCdmTransientEntityCacher(sessionOwner);
+
+ // this call will load into the session cache the graph and update the objects in the sub-graph for a
+ // polytomous key
+ // |- root : polytomous key node
+ PolytomousKey pkey2 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH1_INIT_STRATEGY),PolytomousKey.class);
+ pkey2 = cdmEntitySessionManager.add(sessionOwner, pkey2);
+
+ Assert.assertSame(pkey2.getRoot().getStatement(), cacher.getFromCache(pkey2.getRoot().getStatement()));
+ Assert.assertSame(pkey1.getRoot().getStatement(), pkey2.getRoot().getStatement());
+ Assert.assertSame(cacher.getFromCache(pkey1.getRoot().getStatement()), cacher.getFromCache(pkey2.getRoot().getStatement()));
+ }
+
+ /**
+ * when : retrieving objects using (first) recursive load directly and (second) lazy loading in the same session
+ * then : the objects in the sub-graph having the same persistence id should be the same
+ */
+ @Test
+ public void recursiveLoadAndLazyLoadTest() {
+
+ // this call will load into the session cache the graph and update the objects in the sub-graph for a
+ // polytomous key
+ // |- root : polytomous key node
+ // |- question : KeyStatement
+ // |- statement : KeyStatement
+ PolytomousKey pkey1 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY),PolytomousKey.class);
+ pkey1 = cdmEntitySessionManager.add(sessionOwner, pkey1);
+ CdmTransientEntityCacher cacher = cdmEntitySessionManager.getCdmTransientEntityCacher(sessionOwner);
+
+ // checking that the root is not null and
+ // that it exists in the cache and
+ // that both the original object and the
+ // cached object are the same
+ Assert.assertNotNull(pkey1.getRoot().getStatement());
+ Assert.assertNotNull(cacher.getFromCache(pkey1.getRoot().getStatement()));
+
+ // this call will load into the session cache the graph and update the objects in the sub-graph for a
+ // polytomous key
+ // |- root : polytomous key node
+ PolytomousKey pkey2 = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid),PolytomousKey.class);
+ pkey2 = cdmEntitySessionManager.add(sessionOwner, pkey2);
+
+
+ Assert.assertSame(pkey2.getRoot().getStatement(), cacher.getFromCache(pkey2.getRoot().getStatement()));
+ Assert.assertSame(pkey1.getRoot().getStatement(), pkey2.getRoot().getStatement());
+ Assert.assertSame(cacher.getFromCache(pkey1.getRoot().getStatement()), cacher.getFromCache(pkey2.getRoot().getStatement()));
+ }
+
+ /**
+ * when : retrieving objects using (first) lazy loading and (second) recursive load directly in the same session
+ * then : the objects in the sub-graph having the same persistence id should be the same
+ */
+ @Test
+ public void lazyLoadAndRecursiveLoadTest() {
+
+
+ // this call will load into the session cache the graph and update the objects in the sub-graph for a
+ // polytomous key
+ // |- root : polytomous key node
+
+ PolytomousKey pkey1 = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid),PolytomousKey.class);
+ pkey1 = cdmEntitySessionManager.add(sessionOwner, pkey1);
+
+ // lazy initialising root.statement
+ KeyStatement st = CdmBase.deproxy(pkey1.getRoot().getStatement(), KeyStatement.class);
+ st.getLabel();
+
+ // checking that the root is not null and
+ // that it exists in the cache and
+ // that both the original object and the
+ // cached object are the same
+ Assert.assertNotNull(pkey1.getRoot().getStatement());
+ Assert.assertSame(CdmBase.deproxy(pkey1.getRoot().getStatement(), KeyStatement.class),
+ cacher.getFromCache(pkey1.getRoot().getStatement(), KeyStatement.class));
+
+ // this call will load into the session cache the graph and update the objects in the sub-graph for a
+ // polytomous key
+ // |- root : polytomous key node
+ // |- question : KeyStatement
+ // |- statement : KeyStatement
+
+ PolytomousKey pkey2 = CdmBase.deproxy(polytomousKeyService.load(polytomousKeyUuid, PKEY_DEPTH2_INIT_STRATEGY),PolytomousKey.class);
+ pkey2 = cdmEntitySessionManager.add(sessionOwner, pkey2);
+
+ Assert.assertSame(pkey2.getRoot().getStatement(), cacher.getFromCache(pkey2.getRoot().getStatement(), KeyStatement.class));
+ Assert.assertSame(st, pkey2.getRoot().getStatement());
+ Assert.assertSame(cacher.getFromCache(st), cacher.getFromCache(pkey2.getRoot().getStatement(), KeyStatement.class));
+ }
+
+
@Test
public void savePolytomousKeyNodeDataWithSameSubKey() {
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
+import eu.etaxonomy.cdm.api.cache.CdmRemoteCacheManager.CdmCacheManagerType;
+
public class CdmModelGetMethodCacherTest {
public static final Resource CDMLIB_DISK_STORE_RESOURCE =
new ClassPathResource("/eu/etaxonomy/cache");
+
+
@Test
public void cacheGettersTest() {
throw new CdmClientCacheException(e);
}
CdmModelCacher cmdmc = new CdmModelCacher();
- cmdmc.cacheGetters();
+
+ //cmdmc.checkGetterMethods();
+
+ cmdmc.cacheGetterFields();
Cache cdmlibCache = CdmRemoteCacheManager.getInstance().getCdmModelGetMethodsCache();
- List<CdmModelGetMethodFromClass> cmgmfcList = cmdmc.getCdmModelGetMethodFromClassList();
+ List<CdmModelFieldPropertyFromClass> cmgmfcList = cmdmc.getCdmModelGetMethodFromClassList();
List<Object> keys = cdmlibCache.getKeys();
Assert.assertEquals(cmgmfcList.size(), keys.size());
- for(CdmModelGetMethodFromClass cmgmfc: cmgmfcList) {
+ for(CdmModelFieldPropertyFromClass cmgmfc: cmgmfcList) {
String className = cmgmfc.getClassName();
Assert.assertTrue(keys.contains(className));
logger.info("Class Name : " + className + " has been cached");
}
-
+ cdmlibCache.removeAll();
+ cdmlibCache.flush();
+ CdmRemoteCacheManager.getInstance().shutdown(CdmCacheManagerType.CDMLIB_MODEL);
}
<RightsInfo id="10" created="2014-10-09 15:45:53.0" uuid="bdfb572b-be25-45e7-9349-22a9da43531f" updated="2014-10-09 15:48:01.0" text="Rights Text Test" createdby_id="10" updatedby_id="10" agent_id="4808" type_id="2056"/>
- <PolytomousKeyNode id="2750" created="2014-03-10 10:02:35.0" uuid="75e4c924-ff58-4ee7-a59d-fd9173517d08" updated="2014-03-10 10:02:42.0" nodenumber="1" createdby_id="30" updatedby_id="30" key_id="1550" question_id="2760"/>
+ <PolytomousKeyNode id="2750" created="2014-03-10 10:02:35.0" uuid="75e4c924-ff58-4ee7-a59d-fd9173517d08" updated="2014-03-10 10:02:42.0" nodenumber="1" createdby_id="30" updatedby_id="30" key_id="1550" question_id="2760" statement_id="2460"/>
<PolytomousKeyNode id="2751" created="2014-03-10 10:02:52.0" uuid="23e51ff7-11b1-443b-aff2-3fe8b5ace9fe" sortindex="0" key_id="1550" statement_id="2467" subkey_id="1550" taxon_id="37" parent_id="2750"/>
<PolytomousKeyNode id="2752" created="2014-03-10 10:03:16.0" uuid="dcf326f7-c0ad-4e76-b64e-43aea11f767c" key_id="1550"/>
<PolytomousKeyNode id="2753" created="2014-03-10 10:03:38.0" uuid="b775c027-13c0-4b87-8aa9-712faeaafbdc" updated="2014-03-10 10:06:32.0" nodenumber="2" sortindex="1" createdby_id="30" updatedby_id="30" key_id="1550" question_id="2761" statement_id="2460" subkey_id="1550" parent_id="2750"/>