Index: rctags/ehcache-2.10.9.0.411/README.txt =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/README.txt (revision 11412) +++ rctags/ehcache-2.10.9.0.411/README.txt (revision 0) @@ -1,18 +0,0 @@ -1. To compile: - %> mvn install -DskipTests - -Note: the final Ehcache jar is found under ehcache/target - - -2. To build Ehcache distribution kit: - - %> cd distribution - - %> mvn package (build without an embedded Terracotta kit, lean and mean Ehcache kit) - - %> mvn package -Dtc-kit-url=http://url/to/teracotta.tar.gz (built with Terracotta kit, offical distribution kit) - -3. To deploy Maven central repo (via Sonatype) - - %> mvn clean deploy -P sign-artifacts,deploy-sonatype -DskipTests - \ No newline at end of file Index: rctags/ehcache-2.10.9.0.411/ehcache-scheduled-refresh/pom.xml =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-scheduled-refresh/pom.xml (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-scheduled-refresh/pom.xml (revision 0) @@ -1,49 +0,0 @@ - - - 4.0.0 - - - net.sf.ehcache - ehcache-root - 2.10.9.0.411 - .. - - - ehcache-scheduled-refresh - net.sf.ehcache.internal - ehcache-scheduled-refresh - Ehcache functionality for Scheduled Refresh; uses the Quartz Job Scheduler - - - - net.sf.ehcache.internal - ehcache-core - ${project.version} - - - org.quartz-scheduler - quartz - provided - - - org.slf4j - slf4j-jdk14 - provided - - - junit - junit - - - org.hamcrest - hamcrest - - - net.sf.ehcache.internal - ehcache-core - test-jar - ${project.version} - test - - - Index: rctags/ehcache-2.10.9.0.411/distribution/colorcache/pom.xml =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/distribution/colorcache/pom.xml (revision 11412) +++ rctags/ehcache-2.10.9.0.411/distribution/colorcache/pom.xml (revision 0) @@ -1,152 +0,0 @@ - - 4.0.0 - - org.terracotta.forge - forge-parent - 4.16 - - - net.sf.ehcache.examples - colorcache - 2.10.9.0.411 - colorcache - war - Clustered Ehcache sample with Terracotta - - 4.3.9.0.290 - true - 9.4.30.v20200611 - - - ${project.name} - - - maven-assembly-plugin - 2.3 - - ${project.name} - - src/assemble/distribution.xml - - gnu - - - - package - - single - - - - - - jetty-maven-plugin - ${jetty.version} - org.eclipse.jetty - - - ${project.name} - - STOP - - - - org.terracotta.maven.plugins - tc-maven-plugin - - - org.terracotta - terracotta - ${terracotta.version} - - - - - - - - net.sf.ehcache - ehcache - ${project.version} - - - org.terracotta - terracotta-toolkit-runtime - ${terracotta.version} - - - javax.servlet - javax.servlet-api - 3.1.0 - - - org.slf4j - slf4j-jdk14 - 1.7.25 - - - - - 9081 - - - - jetty-maven-plugin - ${jetty.version} - org.eclipse.jetty - - - - jetty.port - 9081 - - - 9981 - - - - - - - 9082 - - - - jetty-maven-plugin - ${jetty.version} - org.eclipse.jetty - - - - jetty.port - 9082 - - - 9982 - - - - - - - - - terracotta-snapshots - http://www.terracotta.org/download/reflector/snapshots - - - terracotta-releases - http://www.terracotta.org/download/reflector/releases - - - - - terracotta-snapshots - http://www.terracotta.org/download/reflector/snapshots - - - terracotta-releases - http://www.terracotta.org/download/reflector/releases - - - Index: rctags/ehcache-2.10.9.0.411/ehcache/pom.xml =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache/pom.xml (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache/pom.xml (revision 0) @@ -1,418 +0,0 @@ - - - 4.0.0 - - - net.sf.ehcache - ehcache-root - 2.10.9.0.411 - .. - - - ehcache - jar - ehcache - Ehcache is an open source, standards-based cache used to boost performance, - offload the database and simplify scalability. Ehcache is robust, proven and full-featured and - this has made it the most widely-used Java-based cache. - - - - The Apache Software License, Version 2.0 - src/assemble/EHCACHE-CORE-LICENSE.txt - - - http://ehcache.org - - - ${project.artifactId}-${project.version}-distribution - ${project.build.directory}/${kit.name} - ${project.build.directory}/tmp/terracotta - 2.1.1 - false - true - - - - - - net.sf.ehcache.internal - ehcache-terracotta-bootstrap - ${project.version} - - - net.sf.ehcache.internal - ehcache-rest-agent - ${project.version} - - - net.sf.ehcache.internal - ehcache-core - ${project.version} - - - net.sf.ehcache.internal - ehcache-scheduled-refresh - ${project.version} - - - net.sf.ehcache.internal - ehcache-search-parser - ${project.version} - - - junit - junit - - - org.terracotta - product-upgradability-testing-utils - 0.9.4 - test - - - org.codehaus.btm - btm - 2.1.3 - test - - - org.quartz-scheduler - quartz - 2.2.3 - test - - - org.slf4j - slf4j-jdk14 - - - - - - - ${basedir}/src/main/resources - true - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - copy-TIMs - - org.terracotta.modules - ${project.build.outputDirectory}/META-INF/terracotta/TIMs - - process-resources - - copy-dependencies - - - - - - org.terracotta - maven-forge-plugin - - - create-manifest - package - - manifest - - - ${basedir}/.. - ${project.build.directory}/MANIFEST.MF - - Apache Software License, Version 2.0 - Supported - ${project.artifactId} - ${project.description} - - - - - enforce-dependencies - - enforceDependencies - - verify - - net.sf.ehcache.internal - ehcache-core - ${project.version} - - - - - - - - - - devmode - - - devmode - true - - true - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - list-dependencies - - ${project.build.outputDirectory}/META-INF/devmode/${project.groupId}/${project.artifactId}/dependencies.txt - - - list - - compile - - - - - - - - - fullmode - - - devmode - false - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.1.1 - - - create-javadoc - prepare-package - - jar - - - - - org.hibernate - hibernate-core - ${hibernate-core.version} - - - none - ${skipJavadoc} - true - 128m - 512 - true -
ehcache]]>
- ${project.name} ${project.version} API - ${project.name} ${project.version} API - Copyright 2001-{currentYear}, Terracotta, Inc. - ${basedir}/src/main/java/net/sf/ehcache/overview.html - true - - net.sf.ehcache.internal:ehcache-core - - 8 -
-
-
-
- - - org.apache.maven.plugins - maven-shade-plugin - - record-shader - true - true - - - net.sf.ehcache.internal:* - org.terracotta.internal:statistics - com.terracotta:clustered-entity-management - - - - - *:* - - META-INF/maven/com.terracotta/** - META-INF/maven/net.sf.ehcache.internal/** - META-INF/maven/org.terracotta.internal/** - **/license.txt - **/thirdpartylicenses.txt - META-INF/*.SF - META-INF/*.DSA - META-INF/*.RSA - **/LICENSE - **/LICENSE.txt - **/NOTICE - **/NOTICE.txt - **/ASL2.0 - **/DEPENDENCIES - - - - true - ${project.build.directory}/dependency-reduced-pom.xml - - - MANIFEST.MF - - - META-INF/MANIFEST.MF - ${project.build.directory}/MANIFEST.MF - - - - - - shade-jar - package - - shade - - - - - - org.apache.maven.plugins - maven-antrun-plugin - 1.7 - - - unpack-jar-for-bundling - package - - run - - - - - - - - - - - org.apache.felix - maven-bundle-plugin - 4.2.1 - - ${project.build.directory} - - bitronix.tm;resolution:=optional, - bitronix.tm.resource.ehcache;resolution:=optional, - com.atomikos.*;resolution:=optional, - com.atomikos.icatch.jta;resolution:=optional, - weblogic.transaction;resolution:=optional, - javax.transaction.*;resolution:=optional, - javax.servlet;resolution:=optional, - javax.net.ssl;resolution:=optional, - javax.activation;resolution:=optional, - javax.xml.stream;resolution:=optional, - javax.xml.transform;resolution:=optional, - javax.xml.transform.sax;resolution:=optional, - javax.xml.transform.dom;resolution:=optional, - javax.xml.transform.stream;resolution:=optional, - org.w3c.dom;resolution:=optional, - org.hibernate.*;resolution:=optional, - org.terracotta.toolkit.*;resolution:=optional, - org.quartz.*;resolution:=optional, - org.terracotta.quartz.*;resolution:=optional, - com.sun.management.*;resolution:="optional", - net.sf.ehcache.terracotta.security;resolution:=optional, - org.jboss.vfs;resolution:=optional, - sun.management.*;resolution:=optional, - !com.google.apphosting.api, - !sun.misc,* - - net.sf.ehcache.* - org.terracotta.* - JavaSE-1.8 - - *;scope=provided|runtime - - - - generate-osgi-headers - package - - manifest - - - - - - org.codehaus.gmaven - groovy-maven-plugin - ${groovy-maven-plugin.version} - - - repackage-jar - package - - execute - - - - def jarFile = new File(project.build.directory, "${project.artifactId}-${project.version}.jar") - ant.copy(file: new File(project.build.directory, "dependency-reduced-pom.xml"), - tofile: new File(project.build.outputDirectory, "META-INF/maven/${project.groupId}/${project.artifactId}/pom.xml")) - ant.jar(destfile: jarFile, basedir: new File(project.build.outputDirectory).getAbsolutePath(), manifest: new File(project.build.directory, "MANIFEST.MF")) - - - - - -
-
-
-
- - - - terracotta-snapshots - http://www.terracotta.org/download/reflector/snapshots - - - - terracotta-releases - http://www.terracotta.org/download/reflector/releases - - - - - - terracotta-snapshots - http://www.terracotta.org/download/reflector/snapshots - - - terracotta-releases - http://www.terracotta.org/download/reflector/releases - - - - - JIRA - https://jira.terracotta.org/jira/browse/EHC - - -
Index: rctags/ehcache-2.10.9.0.411/management-ehcache-v1/pom.xml =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/management-ehcache-v1/pom.xml (revision 11412) +++ rctags/ehcache-2.10.9.0.411/management-ehcache-v1/pom.xml (revision 0) @@ -1,72 +0,0 @@ - - - 4.0.0 - - - net.sf.ehcache - ehcache-root - 2.10.9.0.411 - .. - - - management-ehcache-v1 - management-ehcache-v1 - A library defining the ehcache management resource services and resource entities, version 1 - - - - org.terracotta - management-common-resources-v1 - ${management-core.version} - - - - - junit - junit - test - - - org.easymock - easymock - test - - - net.sf.ehcache.internal - ehcache-core - test-jar - ${project.version} - test - - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - - - - terracotta-snapshots - http://www.terracotta.org/download/reflector/snapshots - - - terracotta-releases - http://www.terracotta.org/download/reflector/releases - - - - - terracotta-snapshots - http://www.terracotta.org/download/reflector/snapshots - - - terracotta-releases - http://www.terracotta.org/download/reflector/releases - - - Index: rctags/ehcache-2.10.9.0.411/ehcache-search-parser/pom.xml =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-search-parser/pom.xml (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-search-parser/pom.xml (revision 0) @@ -1,56 +0,0 @@ - - - 4.0.0 - - net.sf.ehcache - ehcache-root - 2.10.9.0.411 - .. - - - net.sf.ehcache.internal - ehcache-search-parser - ehcache-search-parser - A parser for Big Memory Structured Query Language. - - - - - org.codehaus.mojo - javacc-maven-plugin - 2.6 - - - javacc - - javacc - - - - - - - - - - net.sf.ehcache.internal - ehcache-core - ${project.version} - - - junit - junit - - - org.hamcrest - hamcrest - - - net.sf.ehcache.internal - ehcache-core - test-jar - ${project.version} - test - - - Index: rctags/ehcache-2.10.9.0.411/system-tests/pom.xml =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/system-tests/pom.xml (revision 11412) +++ rctags/ehcache-2.10.9.0.411/system-tests/pom.xml (revision 0) @@ -1,291 +0,0 @@ - - 4.0.0 - - org.terracotta - system-tests-parent - 4.3.9.0.290 - - - net.sf.ehcache.internal - ehcache-terracotta-system-tests - 2.10.9.0.411 - ehcache-terracotta-system-tests - System tests for ehcache-terracotta - - 512m - 1024m - -XX:MaxPermSize=512m - true - 10.10.1.1 - 2.2.3 - 1.7.25 - 1.9 - - - - org.terracotta - terracotta - ${terracotta.core.version} - - - javax.servlet - javax.servlet-api - - - - - net.sf.ehcache - ehcache - ${project.version} - test - - - net.sf.ehcache - management-ehcache-v1 - ${project.version} - test - - - net.sf.ehcache - management-ehcache-v2 - ${project.version} - test - - - org.terracotta - terracotta-toolkit-runtime - ${terracotta.core.version} - test - - - org.ow2.asm - asm - 7.2 - test - - - org.hibernate - hibernate-core - 3.3.2.GA - test - - - javassist - javassist - 3.8.0.GA - test - - - org.apache.derby - derby - ${derby.version} - test - - - org.apache.derby - derbynet - ${derby.version} - test - - - org.apache.derby - derbyclient - ${derby.version} - test - - - javax.transaction - jta - 1.1 - test - - - org.codehaus.btm - btm - 2.1.3 - test - - - org.apache.geronimo.specs - geronimo-jta_1.0.1B_spec - 1.0.1 - test - - - com.atomikos - transactions-jta - 3.8.0 - test - - - org.mockito - mockito-all - - - - - org.ow2.jotm - jotm-core - 2.1.9 - test - - - commons-logging - commons-logging - - - commons-logging - commons-logging-api - - - - - org.terracotta.test - container-test-framework - - - org.quartz-scheduler - quartz - ${quartz.version} - - - io.rest-assured - rest-assured - - - org.codehaus.groovy - groovy - - - org.codehaus.groovy - groovy-json - - - org.codehaus.groovy - groovy-xml - - - net.sf.ehcache.test - hibernate-ehcache-bundle - ${osgi-test-tool.version} - - - org.terracotta.test - osgi-test-utils - ${osgi-test-tool.version} - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - test-jar - - test-jar - - - - - - org.apache.servicemix.tooling - depends-maven-plugin - 1.2 - - - generate-depends-file - - generate-depends-file - - - - - - - - - include-container-tests - - - appserver - - - - - - org.terracotta - maven-forge-plugin - - - **/container/**/*Test.java - - - - - - - - no-appserver-tests - - - appserver - no-appserver - - - - - - org.terracotta - maven-forge-plugin - - -Xmx768m - -XX:MaxPermSize=128m - - **/*Test.java - - - - - - - - deploy-sonatype - - true - - - - - - terracotta-snapshots - http://www.terracotta.org/download/reflector/snapshots - - - terracotta-releases - http://www.terracotta.org/download/reflector/releases - - - jboss - JBoss Repository - https://repository.jboss.org/nexus/content/repositories/public/ - - true - - - false - - - - - - terracotta-snapshots - http://www.terracotta.org/download/reflector/snapshots - - - terracotta-releases - http://www.terracotta.org/download/reflector/releases - - - Index: rctags/ehcache-2.10.9.0.411/terracotta/pom.xml =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/terracotta/pom.xml (revision 11412) +++ rctags/ehcache-2.10.9.0.411/terracotta/pom.xml (revision 0) @@ -1,74 +0,0 @@ - - - 4.0.0 - - - net.sf.ehcache - ehcache-root - 2.10.9.0.411 - - - net.sf.ehcache.internal - ehcache-terracotta-root - ehcache-terracotta-root - pom - - - bootstrap - - - - - terracotta-snapshots - http://www.terracotta.org/download/reflector/snapshots - - false - - - true - - - - terracotta-releases - http://www.terracotta.org/download/reflector/releases - - true - - - false - - - - - - - terracotta-snapshots - http://www.terracotta.org/download/reflector/snapshots - - false - - - true - - - - terracotta-releases - http://www.terracotta.org/download/reflector/releases - - true - - - false - - - - - - - deploy-sonatype - - true - - - - Index: rctags/ehcache-2.10.9.0.411/management-ehcache-impl/management-ehcache-impl-v1/pom.xml =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/management-ehcache-impl/management-ehcache-impl-v1/pom.xml (revision 11412) +++ rctags/ehcache-2.10.9.0.411/management-ehcache-impl/management-ehcache-impl-v1/pom.xml (revision 0) @@ -1,110 +0,0 @@ - - - 4.0.0 - - - net.sf.ehcache - management-ehcache-impl-parent - 2.10.9.0.411 - .. - - - management-ehcache-impl-v1 - management-ehcache-impl-v1 - A product library integrating with ehcache to construct the relevant management resource entities V1 - - - - net.sf.ehcache - management-ehcache-v1 - ${project.version} - - - net.sf.ehcache - management-ehcache-common - ${project.version} - - - org.terracotta - management-core-resources - ${management-core.version} - test-jar - test - - - net.sf.ehcache.internal - ehcache-core - ${project.version} - provided - - - javax.servlet - javax.servlet-api - - - org.easymock - easymock - test - - - org.eclipse.jetty - jetty-servlet - test - - - org.mockito - mockito-core - - - org.powermock - powermock-api-easymock - test - - - org.powermock - powermock-module-junit4 - test - - - org.hamcrest - hamcrest - - - net.sf.ehcache.internal - ehcache-core - test-jar - ${project.version} - test - - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - - - - terracotta-snapshots - http://www.terracotta.org/download/reflector/snapshots - - - terracotta-releases - http://www.terracotta.org/download/reflector/releases - - - - - terracotta-snapshots - http://www.terracotta.org/download/reflector/snapshots - - - terracotta-releases - http://www.terracotta.org/download/reflector/releases - - - Index: rctags/ehcache-2.10.9.0.411/management-ehcache-impl/management-ehcache-impl-v2/pom.xml =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/management-ehcache-impl/management-ehcache-impl-v2/pom.xml (revision 11412) +++ rctags/ehcache-2.10.9.0.411/management-ehcache-impl/management-ehcache-impl-v2/pom.xml (revision 0) @@ -1,137 +0,0 @@ - - - 4.0.0 - - - net.sf.ehcache - management-ehcache-impl-parent - 2.10.9.0.411 - .. - - - management-ehcache-impl-v2 - management-ehcache-impl-v2 - A product library integrating with ehcache to construct the relevant management resource entities V1 - - - - net.sf.ehcache - management-ehcache-v2 - ${project.version} - - - net.sf.ehcache - management-ehcache-common - ${project.version} - - - org.terracotta - management-core-resources - ${management-core.version} - test-jar - test - - - net.sf.ehcache.internal - ehcache-core - ${project.version} - provided - - - net.sf.ehcache.internal - ehcache-terracotta-bootstrap - ${project.version} - provided - - - org.terracotta.toolkit - terracotta-toolkit-api - 2.10 - provided - - - org.terracotta.toolkit - terracotta-toolkit-api-internal - provided - - - javax.servlet - javax.servlet-api - runtime - - - org.easymock - easymock - test - - - org.eclipse.jetty - jetty-servlet - test - - - org.mockito - mockito-core - test - - - org.powermock - powermock-api-easymock - test - - - org.powermock - powermock-module-junit4 - test - - - org.hamcrest - hamcrest - 2.1 - test - - - commons-io - commons-io - 2.6 - test - - - net.sf.ehcache.internal - ehcache-core - test-jar - ${project.version} - test - - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - - - - terracotta-snapshots - http://www.terracotta.org/download/reflector/snapshots - - - terracotta-releases - http://www.terracotta.org/download/reflector/releases - - - - - terracotta-snapshots - http://www.terracotta.org/download/reflector/snapshots - - - terracotta-releases - http://www.terracotta.org/download/reflector/releases - - - Index: rctags/ehcache-2.10.9.0.411/pom.xml =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/pom.xml (revision 11412) +++ rctags/ehcache-2.10.9.0.411/pom.xml (revision 0) @@ -1,486 +0,0 @@ - - - 4.0.0 - - - net.sf.ehcache - ehcache-parent - 2.25 - - - - ehcache-root - net.sf.ehcache - ehcache-root - pom - 2.10.9.0.411 - - - scm:svn:https://svn.terracotta.org/repo/ehcache/trunk/ehcache - - - - 1.7.25 - 1.0.1 - 2.1.1 - 1.19 - 2.1.23 - 0.11.1 - 1.0.5 - 2.2.3 - 9.4.30.v20200611 - 2.3.2 - 3.5.1-Final - 1.2 - false - - - - ehcache-core - terracotta - ehcache - management-ehcache-v1 - management-ehcache-v2 - management-ehcache-impl - ehcache-scheduled-refresh - ehcache-search-parser - - - - - - - org.slf4j - slf4j-api - ${slf4j.version} - - - org.terracotta.internal - statistics - ${statistics.version} - - - org.terracotta - management-core-resources - ${management-core.version} - - - com.terracotta - clustered-entity-management - ${clustered-entity-management.version} - - - org.eclipse.jetty - jetty-servlet - ${jetty.version} - - - javax.servlet - javax.servlet-api - - - - - - - - - org.terracotta.toolkit - terracotta-toolkit-api-internal - ${terracotta-toolkit-api-internal.version} - provided - - - javax.servlet - javax.servlet-api - 3.1.0 - provided - - - org.hibernate - hibernate-core - ${hibernate-core.version} - provided - - - javax.transaction - jta - 1.1 - provided - - - net.sf.ehcache - sizeof-agent - ${sizeof-agent.version} - provided - - - - - org.slf4j - slf4j-jdk14 - ${slf4j.version} - test - - - commons-logging - commons-logging - ${commons-logging.version} - test - - - org.codehaus.btm - btm - 2.1.3 - test - - - net.sf.hibernate - hibernate - 2.1.8 - test - - - org.hamcrest - hamcrest - 2.1 - test - - - junit - junit - 4.12 - test - - - hamcrest-core - org.hamcrest - - - - - dom4j - dom4j - 1.6.1 - test - - - javassist - javassist - 3.4.GA - test - - - org.hibernate - hibernate-ehcache - 3.3.2.GA - test - - - ehcache - net.sf.ehcache - - - - - org.apache.derby - derby - 10.5.3.0_1 - test - - - org.mockito - mockito-core - 3.0.0 - test - - - com.sun.xsom - xsom - 20100725 - test - - - org.beanshell - bsh - 1.3.0 - test - - - org.quartz-scheduler - quartz - ${quartz.version} - - - org.easymock - easymock - 4.0.2 - test - - - org.powermock - powermock-api-easymock - 2.0.2 - test - - - org.powermock - powermock-module-junit4 - 2.0.2 - test - - - - - - - - - org.apache.maven.plugins - maven-jar-plugin - 3.1.2 - - - - true - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.1.1 - - ${skipJavadoc} - 8 - -Xdoclint:all,-Xdoclint:-missing - true - - - - org.apache.maven.plugins - maven-checkstyle-plugin - 3.1.0 - - - org.apache.maven.plugins - maven-dependency-plugin - 3.1.1 - - - org.codehaus.mojo - build-helper-maven-plugin - 1.7 - - - org.apache.maven.plugins - maven-antrun-plugin - 1.3 - - - org.terracotta - maven-forge-plugin - ${maven-forge-plugin.version} - - -Djava.net.preferIPv4Stack=true - - - - org.apache.maven.plugins - maven-shade-plugin - 2.3 - - - org.terracotta.maven.plugins - terracotta-shader - 1.2 - - - - - org.codehaus.gmaven - groovy-maven-plugin - ${groovy-maven-plugin.version} - - - org.codehaus.mojo - rmic-maven-plugin - 1.3 - - - - - - org.terracotta - maven-forge-plugin - - - generateBuildInfoFile - generate-resources - - buildinfo - - - true - ${project.build.outputDirectory} - - - - default-test - test - - test - - - - - - - - - - system-tests - - system-tests - - - - dist - - distribution - - - - - - check-short - - true - true - - - - - org.reflections - reflections-maven - 0.9.9-RC1 - - org.reflections.scanners.TypeAnnotationsScanner - ${project.build.directory}/reflections.xml - true - true - - - - - reflections - - process-test-classes - - - - - org.terracotta - maven-forge-plugin - - true - org.terracotta.test.categories.CheckShorts - - - java.awt.headless - true - - - - - - - - - - deploy-terracotta - - - - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.1 - true - - - http://nexus.terracotta.eur.ad.sag - - terracotta-nexus-staging - ${skipDeploy} - - - - - - - org.sonatype.plugins - nexus-staging-maven-plugin - - - - - - - deploy-sonatype - - - sonatype-nexus-staging - http://oss.sonatype.org/service/local/staging/deploy/maven2 - - - sonatype-nexus-snapshots - https://oss.sonatype.org/content/repositories/snapshots - - - - - - - - terracotta-nexus-staging - Terracotta Nexus Staging Repository - ${terracotta-nexus-staging-url} - - - terracotta-os-snapshots - false - Terracotta OS Snapshots Repository - ${terracotta-os-snapshots-url} - - - - - - terracotta-snapshots - http://www.terracotta.org/download/reflector/snapshots - - - terracotta-releases - http://www.terracotta.org/download/reflector/releases - - - - - - terracotta-snapshots - http://www.terracotta.org/download/reflector/snapshots - - - terracotta-releases - http://www.terracotta.org/download/reflector/releases - - - Index: rctags/ehcache-2.10.9.0.411/management-ehcache-v2/pom.xml =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/management-ehcache-v2/pom.xml (revision 11412) +++ rctags/ehcache-2.10.9.0.411/management-ehcache-v2/pom.xml (revision 0) @@ -1,72 +0,0 @@ - - - 4.0.0 - - - net.sf.ehcache - ehcache-root - 2.10.9.0.411 - .. - - - management-ehcache-v2 - management-ehcache-v2 - A library defining the ehcache management resource services and resource entities, version 2 - - - - org.terracotta - management-common-resources-v2 - ${management-core.version} - - - - - junit - junit - test - - - org.easymock - easymock - test - - - net.sf.ehcache.internal - ehcache-core - test-jar - ${project.version} - test - - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - - - - terracotta-snapshots - http://www.terracotta.org/download/reflector/snapshots - - - terracotta-releases - http://www.terracotta.org/download/reflector/releases - - - - - terracotta-snapshots - http://www.terracotta.org/download/reflector/snapshots - - - terracotta-releases - http://www.terracotta.org/download/reflector/releases - - - Index: rctags/ehcache-2.10.9.0.411/distribution/pom.xml =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/distribution/pom.xml (revision 11412) +++ rctags/ehcache-2.10.9.0.411/distribution/pom.xml (revision 0) @@ -1,298 +0,0 @@ - - - 4.0.0 - - - net.sf.ehcache - ehcache-root - 2.10.9.0.411 - - - ehcache-kit - pom - ehcache-kit - - project to build distribution kit - - - colorcache - events - - - - ehcache - ${productName}-${project.version} - ${kitFolder}-distribution - ${project.build.directory}/${kitFolder} - ${project.build.directory}/tmp/terracotta - - - - - net.sf.ehcache - ehcache - ${project.version} - provided - - - org.slf4j - slf4j-api - provided - - - org.slf4j - slf4j-jdk14 - provided - - - - - - includeJavadoc - - - !skipJavadoc - - - - - net.sf.ehcache - ehcache - ${project.version} - javadoc - provided - - - - - - - - - com.github.goldin - copy-maven-plugin - 0.2.3.8 - - false - - - - {{ new File( project.build.directory, "${kitFolder}" ).isDirectory() }} - ${root.dir} - - **/** - - true - true - - - - ${root.dir} - ${basedir}/src/main/assembly/root - true - true - - - - ${root.dir} - ${basedir}/../ehcache-core/src/main/config - true - - - - ${root.dir}/src - - - net.sf.ehcache - ehcache - sources - - - true - - - - false - ${root.dir}/javadoc - - - net.sf.ehcache - ehcache - javadoc - - - true - - - - {{ new File(project.properties['terracotta.kit.path']).isDirectory() }} - ${root.dir}/samples - - - net.sf.ehcache.examples - events - ${project.version} - distribution - tar.gz - - - net.sf.ehcache.examples - colorcache - ${project.version} - distribution - tar.gz - - - true - - - - {{ new File(project.properties['terracotta.kit.path']).isDirectory() }} - ${root.dir}/terracotta - ${terracotta.kit.path} - - **/ehcache/** - **/quartz/** - **/sessions/** - - true - - - {{ new File(project.properties['terracotta.kit.path']).isDirectory() }} - ${root.dir}/samples - ${terracotta.kit.path}/ehcache/samples - true - - - {{ new File(project.properties['terracotta.kit.path']).isDirectory() }} - ${root.dir}/samples/colorcache/bin - ${basedir}/src/main/assembly - - relative-paths.* - - - - {{ new File(project.properties['terracotta.kit.path']).isDirectory() }} - ${root.dir}/samples/events/bin - ${basedir}/src/main/assembly - - relative-paths.* - - - - - - - package-with-no-tc - package - - copy - - - - - - - org.terracotta - maven-forge-plugin - - - package-lib - package - - copy-dependencies - - - ${root.dir}/lib - false - - net.sf.ehcache:ehcache:${project.version} - org.slf4j:slf4j-api:${slf4j.version} - org.slf4j:slf4j-jdk14:${slf4j.version} - - - - - - - org.codehaus.gmaven - groovy-maven-plugin - - - create-tarball - package - - execute - - - - def srcdir = new File(project.basedir, "target/${kitFolder}") - def destFile = new File(project.basedir, "target/${tarballName}.tar.gz") - ant.tar(destfile: "${destFile}", longfile: "gnu", compression: "gzip") { - tarfileset(dir: "${srcdir}", prefix: "${kitFolder}", excludes: "**/bin/**,**/lib/**,**/*.sh,**/*.bat") - tarfileset(dir: "${srcdir}", prefix: "${kitFolder}", includes: "**/bin/**,**/lib/**,**/*.sh,**/*.bat", filemode: "755") - } - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.5 - - - attach-distribution - package - - attach-artifact - - - - - ${project.build.directory}/${tarballName}.tar.gz - tar.gz - distribution - - - - - - - - - - - - terracotta-snapshots - http://www.terracotta.org/download/reflector/snapshots - - - terracotta-releases - http://www.terracotta.org/download/reflector/releases - - - - - - terracotta-snapshots - http://www.terracotta.org/download/reflector/snapshots - - - terracotta-releases - http://www.terracotta.org/download/reflector/releases - - - evgenyg.artifactoryonline.com - http://evgenyg.artifactoryonline.com/evgenyg/repo/ - - true - - - false - - - - - Index: rctags/ehcache-2.10.9.0.411/terracotta/bootstrap/pom.xml =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/terracotta/bootstrap/pom.xml (revision 11412) +++ rctags/ehcache-2.10.9.0.411/terracotta/bootstrap/pom.xml (revision 0) @@ -1,98 +0,0 @@ - - - 4.0.0 - - - net.sf.ehcache.internal - ehcache-terracotta-root - 2.10.9.0.411 - - - ehcache-terracotta-bootstrap - ehcache-terracotta-bootstrap - jar - - - false - 1.19 - 0.11.1 - - - - - net.sf.ehcache.internal - ehcache-core - ${project.version} - provided - - - org.terracotta.toolkit - terracotta-toolkit-api-internal - ${terracotta-toolkit-api-internal.version} - - - com.terracotta - clustered-entity-management - ${clustered-entity-management.version} - - - org.mockito - mockito-core - 3.0.0 - test - - - junit - junit - 4.12 - test - - - org.hamcrest - hamcrest-core - - - - - org.hamcrest - hamcrest - - - net.sf.ehcache.internal - ehcache-core - test-jar - ${project.version} - test - - - - - - terracotta-snapshots - http://www.terracotta.org/download/reflector/snapshots - - - terracotta-releases - http://www.terracotta.org/download/reflector/releases - - - - - terracotta-snapshots - http://www.terracotta.org/download/reflector/snapshots - - - terracotta-releases - http://www.terracotta.org/download/reflector/releases - - - - - - deploy-sonatype - - true - - - - Index: rctags/ehcache-2.10.9.0.411/TestCategories.properties =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/TestCategories.properties (revision 11412) +++ rctags/ehcache-2.10.9.0.411/TestCategories.properties (revision 0) @@ -1,328 +0,0 @@ -net.sf.ehcache.AutoVersioningElementTest=production -net.sf.ehcache.CacheClassicLruMemoryStoreTest=production -net.sf.ehcache.CacheCopyOnRwPoolTest=production -net.sf.ehcache.CacheCopyOnRwReplaceRemoveTest=production -net.sf.ehcache.CacheExceptionTest=production -net.sf.ehcache.CacheManagerTest=production -net.sf.ehcache.CachePinningTest=production -net.sf.ehcache.CachePoolPinningTest=production -net.sf.ehcache.CacheTest=production -net.sf.ehcache.ChrisCachePerformanceTest=production -net.sf.ehcache.ClockMemoryStoreTest=production -net.sf.ehcache.DiskStoreTest=production -net.sf.ehcache.DynamicCacheConfigurationTest=production -net.sf.ehcache.ElementTest=production -net.sf.ehcache.ExplicitMaxInMemoryTest=production -net.sf.ehcache.InfiniteCapacityCacheTest=production -net.sf.ehcache.MemoryStoreTester=production -net.sf.ehcache.OverflowCacheTest=production -net.sf.ehcache.PoolCacheManagerTest=production -net.sf.ehcache.RecalculateSizeTest=production -net.sf.ehcache.SameCacheManagerNameTest=production -net.sf.ehcache.StatisticsTest=production -net.sf.ehcache.TerracottaIntegrationTest=production -net.sf.ehcache.XACacheTest=production -net.sf.ehcache.concurrent.ConcurrencyUtilTest=production -net.sf.ehcache.concurrent.ConcurrentCacheMethodsTest=production -net.sf.ehcache.config.CacheConfigConflictTest=production -net.sf.ehcache.config.CacheConfigurationListenerTest=production -net.sf.ehcache.config.CacheConfigurationTest=production -net.sf.ehcache.config.CacheWriterConfigurationTest=production -net.sf.ehcache.config.CoherenceModeConfigTest=production -net.sf.ehcache.config.ConfigurationFactoryTest=production -net.sf.ehcache.config.ConfigurationHelperTest=production -net.sf.ehcache.config.DefaultCacheOptionalTest=production -net.sf.ehcache.config.DynamicCacheConfigurationValidityTest=production -net.sf.ehcache.config.InvalidConfigTest=production -net.sf.ehcache.config.MemoryUnitTest=production -net.sf.ehcache.config.SchemaValidationTest=production -net.sf.ehcache.config.StorageStrategyConfigTest=production -net.sf.ehcache.config.generator.AllConfigurationGeneratedTest=production -net.sf.ehcache.config.generator.ConfigurationGeneratedParsesTest=production -net.sf.ehcache.config.generator.DecoratedCacheConfigTest=production -net.sf.ehcache.config.nonstop.NonStopConfigTest=production -net.sf.ehcache.config.nonstop.NonstopInheritsDefaultConfigTest=production -net.sf.ehcache.constructs.CacheDecoratorFactoryTest=production -net.sf.ehcache.constructs.DecoratorNoNameTest=production -net.sf.ehcache.constructs.DefaultCacheDecoratorFactoryTest=production -net.sf.ehcache.constructs.blocking.BlockingCacheTest=production -net.sf.ehcache.constructs.blocking.SelfPopulatingCacheTest=production -net.sf.ehcache.constructs.blocking.UpdatingSelfPopulatingCacheTest=production -net.sf.ehcache.constructs.locking.ExplicitLockApiTest=production -net.sf.ehcache.constructs.nonstop.BasicNonstopTest=production -net.sf.ehcache.constructs.nonstop.ExecutorServiceTest=production -net.sf.ehcache.constructs.nonstop.NonStopThreadDestroyedTest=production -net.sf.ehcache.constructs.nonstop.NonstopTestUtil=production -net.sf.ehcache.constructs.nonstop.TimeoutOnRejoinTest=production -net.sf.ehcache.distribution.EventMessageTest=production -net.sf.ehcache.distribution.ManualRMIPeerProviderTest=production -net.sf.ehcache.distribution.MulticastRMIPeerProviderTest=production -net.sf.ehcache.distribution.PayloadUtilTest=production -net.sf.ehcache.distribution.RMIBootstrapCacheLoaderTest=production -net.sf.ehcache.distribution.RMICacheManagerPeerListenerTest=production -net.sf.ehcache.distribution.RMICacheManagerPeerTest=production -net.sf.ehcache.distribution.RMICacheReplicatorTest=production -net.sf.ehcache.distribution.RMICacheReplicatorWithLargePayloadTest=production -net.sf.ehcache.distribution.RMIDistributedCacheTest=production -net.sf.ehcache.distribution.ShutdownRMICacheManagerPeerListenerTestImpl=production -net.sf.ehcache.event.BulkOpsEventListenerTest=production -net.sf.ehcache.event.CacheEventListenerTest=production -net.sf.ehcache.event.CacheManagerEventListenerTest=production -net.sf.ehcache.event.EvictionListenerTest=production -net.sf.ehcache.event.ProgrammaticallyCreatedCacheEventListenerTest=production -net.sf.ehcache.event.TestCacheManagerEventListenerFactory=production -net.sf.ehcache.exceptionhandler.CacheExceptionHandlerTest=production -net.sf.ehcache.extension.CacheExtensionTest=production -net.sf.ehcache.extension.TestCacheExtension=production -net.sf.ehcache.extension.TestCacheExtensionFactory=production -net.sf.ehcache.hibernate.EhCacheRegionFactoryTest=production -net.sf.ehcache.hibernate.HibernateAPIUsageTest=production -net.sf.ehcache.hibernate.HibernateCacheTest=production -net.sf.ehcache.hibernate.management.impl.EhcacheStatsImplTest=production -net.sf.ehcache.loader.CacheLoaderTest=production -net.sf.ehcache.loader.CompositeLoaderTest=production -net.sf.ehcache.management.ManagementServiceTest=production -net.sf.ehcache.management.ResourceClassLoaderTest=production -net.sf.ehcache.management.sampled.MBeanRegistrationProviderTest=production -net.sf.ehcache.pool.PoolableStoresTest=production -net.sf.ehcache.pool.TwinCachesTest=production -net.sf.ehcache.pool.sizeof.AgentLoaderRaceTest=production -net.sf.ehcache.pool.sizeof.AgentLoaderSystemPropTest=production -net.sf.ehcache.pool.sizeof.AgentLoaderTest=production -net.sf.ehcache.pool.sizeof.FilteredSizeOfTest=production -net.sf.ehcache.pool.sizeof.ObjectGraphWalkerTest=production -net.sf.ehcache.pool.sizeof.SizeOfTest=production -net.sf.ehcache.pool.sizeof.filter.AnnotationProxyFactoryTest=production -net.sf.ehcache.search.BasicSearchTest=production -net.sf.ehcache.search.QueryExamplesTest=production -net.sf.ehcache.search.SearchTestUtil=production -net.sf.ehcache.search.TestAttributeExtractor=production -net.sf.ehcache.search.TransactionalSearchTest=production -net.sf.ehcache.search.attribute.JavaBeanAttributeExtractorTest=production -net.sf.ehcache.search.attribute.ReflectionAttributeExtractorTest=production -net.sf.ehcache.servermaplocalcache.ServerMapLocalCacheTest=production -net.sf.ehcache.statistics.CacheUsageListenerTest=production -net.sf.ehcache.statistics.DisabledCacheStatisticsTest=production -net.sf.ehcache.statistics.LiveCacheStatisticsTest=production -net.sf.ehcache.store.CacheKeySetTest=production -net.sf.ehcache.store.DiskBackedMemoryStoreTest=production -net.sf.ehcache.store.DiskStoreBootstrapCacheLoaderFactoryTest=production -net.sf.ehcache.store.ElementIdAssigningStoreTest=production -net.sf.ehcache.store.FifoMemoryStoreTest=production -net.sf.ehcache.store.InitialCapacityTest=production -net.sf.ehcache.store.LruClassicMemoryStoreTest=production -net.sf.ehcache.store.LruMemoryStoreTest=production -net.sf.ehcache.store.MemoryOnlyStoreTest=production -net.sf.ehcache.store.MemoryStorePinningTest=production -net.sf.ehcache.store.MemoryStorePoolingTest=production -net.sf.ehcache.store.OffheapStoreInOssTest=production -net.sf.ehcache.store.PoolableMemoryStoreTest=production -net.sf.ehcache.store.XATransactionalStoreTest=production -net.sf.ehcache.store.chm.SelectableConcurrentHashMapTest=production -net.sf.ehcache.store.compound.PartialSerializationCopyStrategyTest=production -net.sf.ehcache.store.compound.TCCLReadWriteSerializationCopyStrategyTest=production -net.sf.ehcache.store.disk.DiskBackMemoryStoreTest=production -net.sf.ehcache.store.disk.DiskStorePoolingTest=production -net.sf.ehcache.store.disk.DiskStoreTest=production -net.sf.ehcache.store.disk.ods.FileAllocationTreeTest=production -net.sf.ehcache.terracotta.BasicRejoinTest=production -net.sf.ehcache.terracotta.BootstrapCacheTest=quarantined -net.sf.ehcache.terracotta.EventReplicationTest=production -net.sf.ehcache.terracotta.KeySnapshotterTest=production -net.sf.ehcache.terracotta.RejoinEventSequenceTest=production -net.sf.ehcache.terracotta.RotatingSnapshotFileTest=production -net.sf.ehcache.terracotta.StorageStrategyInvalidConfigurationTest=production -net.sf.ehcache.terracotta.TerracottaBootstrapCacheLoaderTest=production -net.sf.ehcache.terracotta.TerracottaUnitTesting=production -net.sf.ehcache.terracotta.TerracottaWithLocalOffHeapTest=production -net.sf.ehcache.terracotta.TestRejoinStore=production -net.sf.ehcache.transaction.SoftLockPinningTest=production -net.sf.ehcache.transaction.local.LocalTransactionSizeOfTest=production -net.sf.ehcache.transaction.local.LocalTransactionTest=production -net.sf.ehcache.transaction.xa.TwoPCTest=production -net.sf.ehcache.transaction.xa.XAThreadPoolTest=production -net.sf.ehcache.transaction.xa.XATransactionSizeOfTest=production -net.sf.ehcache.transaction.xa.XATransactionTest=production -net.sf.ehcache.util.LargeCollectionTest=production -net.sf.ehcache.util.MemoryEfficientByteArrayOutputStreamTest=production -net.sf.ehcache.util.MemorySizeParserTest=production -net.sf.ehcache.util.ProductInfoTest=production -net.sf.ehcache.util.SlewClockTest=production -net.sf.ehcache.util.SmokeTests=production -net.sf.ehcache.util.TimestamperTest=production -net.sf.ehcache.util.UpdateCheckerTest=production -net.sf.ehcache.util.WeakIdentityConcurrentMapTest=production -net.sf.ehcache.writer.CacheWriterTest=production -net.sf.ehcache.writer.CoalesceKeysFilterTest=production -net.sf.ehcache.writer.TestCacheWriter=production -net.sf.ehcache.writer.TestCacheWriterException=production -net.sf.ehcache.writer.TestCacheWriterFactory=production -net.sf.ehcache.writer.TestCacheWriterRetries=production -net.sf.ehcache.writer.TestCacheWriterSlow=production -org.terracotta.ehcache.tests.BasicAtomikosXATest=quarantined -org.terracotta.ehcache.tests.BasicBTMXATest=quarantined -org.terracotta.ehcache.tests.BasicStandaloneCacheAndServerTopologyTest=production -org.terracotta.ehcache.tests.BasicStandaloneCacheTest=production -org.terracotta.ehcache.tests.BasicWriteBehindTest=quarantined -org.terracotta.ehcache.tests.CacheBlockingQueueTest=quarantined -org.terracotta.ehcache.tests.CacheConsistencyTest=production -org.terracotta.ehcache.tests.CacheLocksTest=quarantined -org.terracotta.ehcache.tests.CacheWriterBTMXATest=quarantined -org.terracotta.ehcache.tests.ClusterCacheEventsRejoinEnabledTest=quarantined -org.terracotta.ehcache.tests.ClusterEventsRejoinEnabledTest=quarantined -org.terracotta.ehcache.tests.ClusterEventsTest=production -org.terracotta.ehcache.tests.ClusteredCacheRemovalTest=quarantined -org.terracotta.ehcache.tests.CoalescingWriteBehindTest=quarantined -org.terracotta.ehcache.tests.CompressedCacheTest=production -org.terracotta.ehcache.tests.ConcurrencyValueTest=quarantined -org.terracotta.ehcache.tests.CopyOnWriteTest=production -org.terracotta.ehcache.tests.DoubleConfigStandaloneCacheTest=production -org.terracotta.ehcache.tests.EmbeddedConfigNamespaceStandaloneCacheTest=production -org.terracotta.ehcache.tests.EmbeddedConfigStandaloneCacheTest=production -org.terracotta.ehcache.tests.EmbeddedEhcacheJarTest=production -org.terracotta.ehcache.tests.EmbeddedEhcacheJarTestClient=production -org.terracotta.ehcache.tests.ExpiryListenerTest=production -org.terracotta.ehcache.tests.ExplicitlyUnclusteredStandaloneCacheTest=production -org.terracotta.ehcache.tests.ExpressShutdownTest=production -org.terracotta.ehcache.tests.GetKeysSerializedCacheTest=production -org.terracotta.ehcache.tests.HibernateExpressShutdownTest=production -org.terracotta.ehcache.tests.LocalTxTest=production -org.terracotta.ehcache.tests.MemoryStoreEvictionPolicyTest=production -org.terracotta.ehcache.tests.MixedCacheTest=production -org.terracotta.ehcache.tests.NamelessCacheManagerStandaloneCacheTest=production -org.terracotta.ehcache.tests.NoTcConfigStandaloneCacheTest=production -org.terracotta.ehcache.tests.OtherClassLoaderEventTest=production -org.terracotta.ehcache.tests.OtherClassloaderCacheTest=production -org.terracotta.ehcache.tests.OverflowToDiskStandaloneCacheTest=production -org.terracotta.ehcache.tests.SerializationWriteBehindTest=production -org.terracotta.ehcache.tests.SerializedArrayCacheTest=production -org.terracotta.ehcache.tests.SuspendResumeAtomikosXATest=production -org.terracotta.ehcache.tests.SuspendResumeBTMXATest=production -org.terracotta.ehcache.tests.SynchronousWriteBehindTest=production -org.terracotta.ehcache.tests.SystemPropTcConfigTest=production -org.terracotta.ehcache.tests.ThreadLocalTest=production -org.terracotta.ehcache.tests.TwoResourceAtomikosXATest=production -org.terracotta.ehcache.tests.TwoResourceBTMXATest=production -org.terracotta.ehcache.tests.TwoResourceSuspendResumeAtomikosXATest=production -org.terracotta.ehcache.tests.TwoResourceSuspendResumeBTMXATest=production -org.terracotta.ehcache.tests.UrlConfigStandaloneCacheTest=production -org.terracotta.ehcache.tests.XAResourceTest=production -org.terracotta.ehcache.tests.coherence.CacheCoherenceExpressTest=quarantined -org.terracotta.ehcache.tests.coherence.IncoherentNodesTest=quarantined -org.terracotta.ehcache.tests.coherence.RestartingL1ExpressTest=quarantined -org.terracotta.ehcache.tests.container.BasicContainerJTATest=production -org.terracotta.ehcache.tests.container.BasicContainerTest=production -org.terracotta.ehcache.tests.container.BasicJTATestServlet=production -org.terracotta.ehcache.tests.container.BasicTestServlet=production -org.terracotta.ehcache.tests.container.EARContainerTest=production -org.terracotta.ehcache.tests.container.TwoResourceContainerJTATest=production -org.terracotta.ehcache.tests.container.TwoResourceJTATestServlet=production -org.terracotta.ehcache.tests.container.hibernate.BaseClusteredRegionFactoryTest=production -org.terracotta.ehcache.tests.container.hibernate.BaseClusteredRegionFactoryTestServlet=production -org.terracotta.ehcache.tests.container.hibernate.nontransactional.EhCacheClusteredHibernateCacheTest=production -org.terracotta.ehcache.tests.container.hibernate.nontransactional.EmptySecondLevelCacheEntryTest=production -org.terracotta.ehcache.tests.container.hibernate.nontransactional.KeyDeserializationSecondLevelCacheEntryTest=production -org.terracotta.ehcache.tests.container.hibernate.nontransactional.KeyDeserializationSecondLevelCacheEntryTestServlet=production -org.terracotta.ehcache.tests.container.hibernate.nontransactional.NonEternalSecondLevelCacheTest=production -org.terracotta.ehcache.tests.container.hibernate.nontransactional.NonEternalSecondLevelCacheTestServlet=production -org.terracotta.ehcache.tests.container.hibernate.nontransactional.NonTransactionalCacheTest=production -org.terracotta.ehcache.tests.container.hibernate.nontransactional.QueryCacheInvalidationTest=production -org.terracotta.ehcache.tests.loader.LoaderTest=production -org.terracotta.ehcache.tests.servermap.BasicServerMapExpressCacheTest=production -org.terracotta.ehcache.tests.servermap.BasicServerMapExpressTestHelper=production -org.terracotta.ehcache.tests.servermap.CacheSizeTest=production -org.terracotta.ehcache.tests.servermap.LockGCNotFlushingEntriesTest=production -org.terracotta.ehcache.tests.servermap.LockGCNotFlushingEntriesTestClient=production -org.terracotta.ehcache.tests.servermap.ServerMapCapacityEvictionExpressTest=production -org.terracotta.ehcache.tests.servermap.ServerMapCapacityEvictionExpressTestClient=production -org.terracotta.ehcache.tests.servermap.ServerMapClearExpressTest=production -org.terracotta.ehcache.tests.servermap.ServerMapClearExpressTestClient1=production -org.terracotta.ehcache.tests.servermap.ServerMapClearExpressTestClient2=production -org.terracotta.ehcache.tests.servermap.ServerMapClearTestHelper=production -org.terracotta.ehcache.tests.servermap.ServerMapElementTTIExpressTest=production -org.terracotta.ehcache.tests.servermap.ServerMapElementTTIExpressTestClient=production -org.terracotta.ehcache.tests.servermap.ServerMapElementTTLExpressTest=production -org.terracotta.ehcache.tests.servermap.ServerMapElementTTLExpressTestClient=production -org.terracotta.ehcache.tests.servermap.ServerMapL1CapacityEvictionExpressTest=production -org.terracotta.ehcache.tests.servermap.ServerMapL1CapacityEvictionExpressTestClient=production -org.terracotta.ehcache.tests.servermap.ServerMapL1CapacityExpirationExpressTest=production -org.terracotta.ehcache.tests.servermap.ServerMapL1CapacityExpirationExpressTestClient=production -org.terracotta.ehcache.tests.servermap.ServerMapL1EvictionOffHeapDestroyExpressTest=production -org.terracotta.ehcache.tests.servermap.ServerMapL1EvictionOffHeapDestroyExpressTestClient=production -org.terracotta.ehcache.tests.servermap.ServerMapL2EvictionReachesL1Test=production -org.terracotta.ehcache.tests.servermap.ServerMapL2EvictionReachesL1TestClient=production -org.terracotta.ehcache.tests.servermap.ServerMapL2EvictionReachesOneL1Test=production -org.terracotta.ehcache.tests.servermap.ServerMapL2EvictionReachesOneL1TestClient=production -org.terracotta.ehcache.tests.servermap.ServerMapLocalSizeTest=production -org.terracotta.ehcache.tests.servermap.ServerMapTTIExpressTest=production -org.terracotta.ehcache.tests.servermap.ServerMapTTIExpressTestClient=production -org.terracotta.ehcache.tests.servermap.ServerMapTTLExpressTest=production -org.terracotta.ehcache.tests.servermap.ServerMapTTLExpressTestClient=production -org.terracotta.modules.ehcache.LocalVMResourcesTestUtil=production -org.terracotta.modules.ehcache.bulkops.BulkOpsBasicSerializationSanityTest=production -org.terracotta.modules.ehcache.bulkops.BulkOpsExplictLockingTest=production -org.terracotta.modules.ehcache.bulkops.BulkOpsGenericSanityTest=production -org.terracotta.modules.ehcache.bulkops.GetAllCustomMapTest=production -org.terracotta.modules.ehcache.bulkops.GetAllNonLiteralTest=production -org.terracotta.modules.ehcache.bulkops.GetAllTest=production -org.terracotta.modules.ehcache.cluster.CacheClusterTest=production -org.terracotta.modules.ehcache.cluster.ClusterTopologyListenerTest=production -org.terracotta.modules.ehcache.cluster.FailoverDuringPassiveSyncTest=production -org.terracotta.modules.ehcache.cluster.FailoverToOutOfSyncPassivesTest=production -org.terracotta.modules.ehcache.coherence.CacheCoherenceTest=production -org.terracotta.modules.ehcache.coherence.CacheCoherenceTestL1Client=production -org.terracotta.modules.ehcache.coherence.GetSizeTest=production -org.terracotta.modules.ehcache.coherence.NoLocksCreatedEventualTest=production -org.terracotta.modules.ehcache.coherence.NoLocksCreatedTest=production -org.terracotta.modules.ehcache.event.ClusterTopologyTest=production -org.terracotta.modules.ehcache.event.ClusteredEventsAllTest=production -org.terracotta.modules.ehcache.event.ClusteredEventsEvictionExpiryTest=production -org.terracotta.modules.ehcache.event.ClusteredEventsLocalTest=production -org.terracotta.modules.ehcache.event.ClusteredEventsRemoteTest=production -org.terracotta.modules.ehcache.event.ClusteredEventsSerializationTest=production -org.terracotta.modules.ehcache.l1bm.L1BMCacheManagerRecreateTest=production -org.terracotta.modules.ehcache.l1bm.L1BMCacheStatisticsTest=production -org.terracotta.modules.ehcache.l1bm.L1BMDynamicConfigurationTest=production -org.terracotta.modules.ehcache.l1bm.L1BMOnHeapActivePassiveSanityTest=production -org.terracotta.modules.ehcache.l1bm.L1BMOnHeapBasicSanityTestApp=production -org.terracotta.modules.ehcache.l1bm.L1BMOnHeapReadWriteTest=production -org.terracotta.modules.ehcache.l1bm.L1BMOnHeapSanityTest=production -org.terracotta.modules.ehcache.l1bm.L1BMOnHeapWithTTISanityTest=production -org.terracotta.modules.ehcache.l1bm.L1BMOnHeapWithTTLSanityTest=production -org.terracotta.modules.ehcache.l1bm.L1BMUpdateInvalidatedEntryTest=production -org.terracotta.modules.ehcache.store.BasicCacheSyncWriteTest=production -org.terracotta.modules.ehcache.store.BasicCacheTest=production -org.terracotta.modules.ehcache.store.BlockingCacheTest=production -org.terracotta.modules.ehcache.store.CachePinningTest=production -org.terracotta.modules.ehcache.store.ClassicIsInvalidTest=production -org.terracotta.modules.ehcache.store.ConcurrentCacheMethodsTest=production -org.terracotta.modules.ehcache.store.CopyOnReadTest=production -org.terracotta.modules.ehcache.store.DCV2ConfigurationChangePropagationTest=production -org.terracotta.modules.ehcache.store.DynamicCacheConfigurationTest=production -org.terracotta.modules.ehcache.store.EvictionListenerTest=production -org.terracotta.modules.ehcache.store.ExpirationListenerTest=production -org.terracotta.modules.ehcache.store.GetKeysSerializedCacheTest=production -org.terracotta.modules.ehcache.store.InlineExpirationTest=production -org.terracotta.modules.ehcache.store.LocalBufferedMapTest=production -org.terracotta.modules.ehcache.store.LocalReadsGetKeysTest=production -org.terracotta.modules.ehcache.store.NoCacheWithMaxBytesLocalDiskTest=production -org.terracotta.modules.ehcache.store.PinnedCacheTest=production -org.terracotta.modules.ehcache.store.PrimitiveClassTest=production -org.terracotta.modules.ehcache.store.ProgrammaticCacheTest=production -org.terracotta.modules.ehcache.store.ProgrammaticConfigTest=production -org.terracotta.modules.ehcache.store.SampledStatisticTimerTest=production -org.terracotta.modules.ehcache.store.SerializedCacheCopyOnReadTest=production -org.terracotta.modules.ehcache.store.SerializedCacheTest=production -org.terracotta.modules.ehcache.store.ServerMapBasicCacheTest=production -org.terracotta.modules.ehcache.store.SimpleVersionTest=production -org.terracotta.modules.ehcache.store.StorageStrategyNotSupportedTest=production -org.terracotta.modules.ehcache.store.TTICacheTest=production -org.terracotta.modules.ehcache.store.TTLCacheTest=production -org.terracotta.modules.ehcache.store.TotalCapacityTest=production -org.terracotta.modules.ehcache.store.backend.BulkLoadInternalKeyRepresentationExposedTest=production -org.terracotta.modules.ehcache.writebehind.AsyncWriteBehindTest=production -org.terracotta.modules.ehcache.writebehind.BasicWriteBehindTest=production -org.terracotta.modules.ehcache.writebehind.CacheSeparationWriteBehindTest=production -org.terracotta.modules.ehcache.writebehind.CoalescingWriteBehindTest=production -org.terracotta.modules.ehcache.writebehind.RemovingCacheWriteBehindTest=production -org.terracotta.modules.ehcache.writebehind.SerializationWriteBehindTest=production Index: rctags/ehcache-2.10.9.0.411/management-ehcache-impl/pom.xml =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/management-ehcache-impl/pom.xml (revision 11412) +++ rctags/ehcache-2.10.9.0.411/management-ehcache-impl/pom.xml (revision 0) @@ -1,43 +0,0 @@ - - - 4.0.0 - - - net.sf.ehcache - ehcache-root - 2.10.9.0.411 - .. - - - management-ehcache-impl-parent - management-ehcache-impl-parent - pom - - - management-ehcache-impl-v1 - management-ehcache-impl-v2 - management-ehcache-common - ehcache-rest-agent - - - - - terracotta-snapshots - http://www.terracotta.org/download/reflector/snapshots - - - terracotta-releases - http://www.terracotta.org/download/reflector/releases - - - - - terracotta-snapshots - http://www.terracotta.org/download/reflector/snapshots - - - terracotta-releases - http://www.terracotta.org/download/reflector/releases - - - Index: rctags/ehcache-2.10.9.0.411/distribution/events/pom.xml =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/distribution/events/pom.xml (revision 11412) +++ rctags/ehcache-2.10.9.0.411/distribution/events/pom.xml (revision 0) @@ -1,248 +0,0 @@ - - 4.0.0 - - org.terracotta.forge - forge-parent - 4.16 - - - net.sf.ehcache.examples - events - 2.10.9.0.411 - events - war - Clustered Ehcache Terracotta as second level cache for Hibernate - - 4.3.9.0.290 - 1.1.116 - 1.1 - true - 9.4.30.v20200611 - - - - org.slf4j - slf4j-api - 1.7.25 - - - ch.qos.logback - logback-classic - 1.2.3 - - - javassist - javassist - 3.8.0.GA - - - h2 - ${h2.version} - com.h2database - - - net.sf.ehcache - ehcache - ${project.version} - - - org.terracotta - terracotta-toolkit-runtime - ${terracotta.version} - - - javax.servlet - javax.servlet-api - 3.1.0 - - - org.hibernate - hibernate-core - 3.3.1.GA - - - org.slf4j - slf4j-api - - - javax.transaction - jta - - - - - gf-3122 - gf.javax.transaction - 1.1 - - - - ${project.name} - - - maven-assembly-plugin - 2.3 - - ${project.name} - - src/assemble/distribution.xml - - gnu - - - - package - - single - - - - - - jetty-maven-plugin - ${jetty.version} - org.eclipse.jetty - - - ${project.name} - - STOP - - - - hibernate3-maven-plugin - 2.1 - org.codehaus.mojo - - - target/classes/hibernate3hbm2ddl.properties - target/classes/hibernate.cfg.xml - true - true - schema.sql - - - - - com.h2database - h2 - ${h2.version} - - - - - org.terracotta.maven.plugins - tc-maven-plugin - - - org.terracotta - terracotta - ${terracotta.version} - - - - - - - - start-h2 - - - - org.codehaus.mojo - exec-maven-plugin - ${exec-maven-plugin.version} - - org.h2.tools.Server - - -tcp - -tcpAllowOthers - - - - - - - - stop-h2 - - - - org.codehaus.mojo - exec-maven-plugin - ${exec-maven-plugin.version} - - org.h2.tools.Server - - -tcpShutdown - tcp://localhost:9092 - - - - - - - - 9081 - - - - jetty-maven-plugin - ${jetty.version} - org.eclipse.jetty - - - - jetty.port - 9081 - - - 9981 - - - - - - - 9082 - - - - jetty-maven-plugin - ${jetty.version} - org.eclipse.jetty - - - - jetty.port - 9082 - - - 9982 - - - - - - - - - terracotta-snapshots - http://www.terracotta.org/download/reflector/snapshots - - - terracotta-releases - http://www.terracotta.org/download/reflector/releases - - - - - terracotta-snapshots - http://www.terracotta.org/download/reflector/snapshots - - - terracotta-releases - http://www.terracotta.org/download/reflector/releases - - - Index: rctags/ehcache-2.10.9.0.411/management-ehcache-impl/management-ehcache-common/pom.xml =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/management-ehcache-impl/management-ehcache-common/pom.xml (revision 11412) +++ rctags/ehcache-2.10.9.0.411/management-ehcache-impl/management-ehcache-common/pom.xml (revision 0) @@ -1,87 +0,0 @@ - - - 4.0.0 - - - net.sf.ehcache - management-ehcache-impl-parent - 2.10.9.0.411 - .. - - - management-ehcache-common - management-ehcache-common - A common library shared between different management-ehcache implementation versions - - - - org.terracotta - management-core-resources - - - net.sf.ehcache.internal - ehcache-core - ${project.version} - provided - - - javax.servlet - javax.servlet-api - - - org.eclipse.jetty - jetty-servlet - - - commons-io - commons-io - 2.6 - test - - - org.easymock - easymock - test - - - org.powermock - powermock-api-easymock - test - - - org.powermock - powermock-module-junit4 - test - - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - - - - terracotta-snapshots - http://www.terracotta.org/download/reflector/snapshots - - - terracotta-releases - http://www.terracotta.org/download/reflector/releases - - - - - terracotta-snapshots - http://www.terracotta.org/download/reflector/snapshots - - - terracotta-releases - http://www.terracotta.org/download/reflector/releases - - - Index: rctags/ehcache-2.10.9.0.411/ehcache-core/pom.xml =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-core/pom.xml (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-core/pom.xml (revision 0) @@ -1,537 +0,0 @@ - - - 4.0.0 - - - net.sf.ehcache - ehcache-root - 2.10.9.0.411 - - - net.sf.ehcache.internal - ehcache-core - jar - - ehcache-core - Internal ehcache-core module. This artifact is not meant to be used directly - - - Ehcache - UTF-8 - UTF-8 - 5 - src/test/java - src/test/resources - ehcache - false - - -Xmx64m - - - - - - org.slf4j - slf4j-api - - - org.terracotta.internal - statistics - - - - - javax.servlet - javax.servlet-api - - - org.hibernate - hibernate-core - - - javax.transaction - jta - - - net.sf.ehcache - sizeof-agent - - - - - org.slf4j - slf4j-jdk14 - - - commons-logging - commons-logging - - - org.codehaus.btm - btm - - - net.sf.hibernate - hibernate - - - org.hamcrest - hamcrest - - - junit - junit - - - hamcrest-core - org.hamcrest - - - - - dom4j - dom4j - - - javassist - javassist - - - org.hibernate - hibernate-ehcache - - - org.apache.derby - derby - - - org.mockito - mockito-core - - - com.sun.xsom - xsom - - - org.beanshell - bsh - - - - - - - src/main/resources - true - - - ${project.build.directory}/generated-resources - false - - - ${basedir}/${testDir} - - - ${basedir}/src/main/config/jcache - - - ${basedir}/${testResources} - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - test-jar - - test-jar - - - - - - - org.terracotta - maven-forge-plugin - - 1 - false - ${tests.supplemental.args} ${tests.max.heap.size} - false - false - true - plain - false - - true - ${net.sf.ehcache.speedAdjustmentFactor} - ${project.build.directory} - true - - - net.sf.ehcache:sizeof-agent - - - - - build-info - generate-resources - - buildinfo - - - ${basedir}/.. - - - - - default-test - - - **/*$* - **/*PerfTest.java - **/*PerfTest*.java - **/Abstract*Test.java - - - - - integration-test-execution - integration-test - - test - - - ${checkshort} - false - - **/*$* - - - **/IT*.java - **/*IT.java - **/*ITCase.java - - ${tests.supplemental.args} -Xms512m -Xmx512m - - - - - - - org.apache.maven.plugins - maven-checkstyle-plugin - - - verify - - checkstyle - - - - - ${basedir}/checkstyle/checkstyle.xml - ${basedir}/checkstyle/suppressions.xml - ${basedir}/checkstyle/ClassHeader.txt - ${skipCheckstyle} - false - false - false - false - false - false - true - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - generate-resources - copy-agent-jar-to-resources - - copy-dependencies - - - * - sizeof-agent - ${project.build.directory}/generated-resources/net/sf/ehcache/pool/sizeof/ - true - true - - - - - - org.codehaus.mojo - rmic-maven-plugin - - - rmi-compilation - compile - - rmic - - - - **/RMICachePeer.class - - ${project.build.outputDirectory} - - - - - - org.glassfish.corba - rmic - 4.2.1 - - - - - - - - - skip-ehcache-core-deploy - - true - - - - staging - - - - org.apache.maven.plugins - maven-gpg-plugin - - - sign-artifacts - deploy - - sign - - - - - - - - - perfTests - - - - org.terracotta - maven-forge-plugin - - - - default-test - - ${tests.supplemental.args} -Xmx512m - - **/*PerfTest.java - **/*PerfTest*.java - - - **/*$* - **/Abstract*Test.java - - - - - - - - - - - buildnumber-git - - - - org.codehaus.mojo - buildnumber-maven-plugin - 1.0-beta-3 - - - generate-resources - - create - - - - - false - false - {0,date,yyyy-MM-dd_HH-mm}_{1} - - timestamp - ${user.name} - - - - - - - - - - no-interruptible-io-solaris - - - java.vendor - Sun Microsystems Inc. - - - - -XX:-UseVMInterruptibleIO - - - - enable-system-gc-jrockit - - - java.vm.name - Oracle JRockit(R) - - - - -XXfullSystemGC -Xverbose:systemgc - - - - ibmj9 - - - java.vm.name - IBM J9 VM - - - - -Xenableexplicitgc - -Xmx256m - - - - - - test-nonstopcache - - - - org.terracotta - maven-forge-plugin - - - **/nonstop/*Test.java - - - **/*$* - - - - java.awt.headless - true - - - - - - - - - - - fast - - true - - - - - - - - terracotta-snapshots - http://www.terracotta.org/download/reflector/snapshots - - false - - - true - - - - - terracotta-releases - http://www.terracotta.org/download/reflector/releases - - true - - - false - - - - - - jboss-releases - http://repository.jboss.org/nexus/content/groups/public-jboss - - true - - - false - - - - - - Java.net Maven 2 - http://download.java.net/maven/2 - - true - - - false - - - - - - - terracotta-snapshots - http://www.terracotta.org/download/reflector/snapshots - - false - - - true - - - - terracotta-releases - http://www.terracotta.org/download/reflector/releases - - true - - - false - - - - - - Index: rctags/ehcache-2.10.9.0.411/third-party.txt =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/third-party.txt (revision 11412) +++ rctags/ehcache-2.10.9.0.411/third-party.txt (revision 0) @@ -1,5 +0,0 @@ -This project depends on repackaged GlassFish libraries. -They can be identified by their groupId starting with gf-*. - -The source code for these libraries can be found at https://svn.java.net/svn/glassfish~svn/. -Otherwise contact to get the source code for these libraries. \ No newline at end of file Index: rctags/ehcache-2.10.9.0.411/management-ehcache-impl/ehcache-rest-agent/pom.xml =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/management-ehcache-impl/ehcache-rest-agent/pom.xml (revision 11412) +++ rctags/ehcache-2.10.9.0.411/management-ehcache-impl/ehcache-rest-agent/pom.xml (revision 0) @@ -1,223 +0,0 @@ - - - 4.0.0 - - - net.sf.ehcache - management-ehcache-impl-parent - 2.10.9.0.411 - .. - - - net.sf.ehcache.internal - ehcache-rest-agent - ehcache-rest-agent - - Ehcache REST implementation - - - rest-management-private-classpath - .class_terracotta - true - false - 2.3.2 - - - - - net.sf.ehcache - management-ehcache-impl-v1 - ${project.version} - - - net.sf.ehcache - management-ehcache-impl-v2 - ${project.version} - - - javax.servlet - javax.servlet-api - 3.1.0 - runtime - - - org.eclipse.jetty - jetty-servlet - - - org.glassfish.jaxb - jaxb-runtime - ${jaxb-runtime.version} - runtime - - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - - - - devmode - - - devmode - true - - true - - - - .class - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - list-dependencies - - ${project.build.outputDirectory}/META-INF/devmode/${project.groupId}/${project.artifactId}/dependencies.txt - - - list - - compile - - - - - - org.apache.maven.plugins - maven-shade-plugin - - reduced-pom-only-shader - ${project.build.directory}/dependency-reduced-pom.xml - true - true - false - false - - - - org.slf4j:* - - - - - - package - - shade - - - - - - - - - - fullmode - - - devmode - false - - - - - - org.apache.maven.plugins - maven-shade-plugin - - record-shader - ${project.build.directory}/dependency-reduced-pom.xml - true - true - false - true - - - - org.slf4j:* - - - - - *:* - - META-INF/*.SF - META-INF/*.DSA - META-INF/*.RSA - - - - - - - - - - package - - shade - - - - - - org.codehaus.gmaven - groovy-maven-plugin - - - fix-content - package - - execute - - - - ${basedir}/src/scripts - - - import Util - Util.packageAgentJar(project) - - - - - - - - - - - - - terracotta-snapshots - http://www.terracotta.org/download/reflector/snapshots - - - terracotta-releases - http://www.terracotta.org/download/reflector/releases - - - - - terracotta-snapshots - http://www.terracotta.org/download/reflector/snapshots - - - terracotta-releases - http://www.terracotta.org/download/reflector/releases - - - Index: rctags/ehcache-2.10.9.0.411/management-ehcache-impl/management-ehcache-impl-v2/src/main/java/net/sf/ehcache/management/service/impl/CacheManagerEntityBuilderV2.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/management-ehcache-impl/management-ehcache-impl-v2/src/main/java/net/sf/ehcache/management/service/impl/CacheManagerEntityBuilderV2.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/management-ehcache-impl/management-ehcache-impl-v2/src/main/java/net/sf/ehcache/management/service/impl/CacheManagerEntityBuilderV2.java (revision 0) @@ -1,89 +0,0 @@ -/* - * All content copyright (c) 2003-2012 Terracotta, Inc., except as may otherwise be noted in a separate copyright - * notice. All rights reserved. - */ -package net.sf.ehcache.management.service.impl; - -import net.sf.ehcache.management.resource.CacheManagerEntityV2; -import net.sf.ehcache.management.sampled.CacheManagerSampler; -import net.sf.ehcache.management.service.AccessorPrefix; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.terracotta.management.resource.AgentEntityV2; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.Set; - -/** - * @author brandony - */ -final class CacheManagerEntityBuilderV2 extends ConstrainableEntityBuilderSupportV2 { - private static final Logger LOG = LoggerFactory.getLogger(CacheManagerEntityBuilderV2.class); - - private static final String CM_NAME_ACCESSOR = AccessorPrefix.get + "Name"; - - private final List cmSamplers = new ArrayList(); - - static CacheManagerEntityBuilderV2 createWith(CacheManagerSampler sampler) { - return new CacheManagerEntityBuilderV2(sampler); - } - - CacheManagerEntityBuilderV2(CacheManagerSampler sampler) { - addSampler(sampler); - } - - CacheManagerEntityBuilderV2 add(CacheManagerSampler sampler) { - addSampler(sampler); - return this; - } - - CacheManagerEntityBuilderV2 add(Set constraintAttributes) { - addConstraints(constraintAttributes); - return this; - } - - Collection build() { - Collection cmes = new ArrayList(cmSamplers.size()); - - for (CacheManagerSampler cms : cmSamplers) { - CacheManagerEntityV2 cme = new CacheManagerEntityV2(); - cme.setName(cms.getName()); - cme.setAgentId(AgentEntityV2.EMBEDDED_AGENT_ID); - // cme.setVersion(this.getClass().getPackage().getImplementationVersion()); - - if (getAttributeConstraints() != null && !getAttributeConstraints().isEmpty() && getAttributeConstraints() - .size() < CacheManagerSampler.class.getMethods().length) { - buildAttributeMapByAttribute(CacheManagerSampler.class, cms, cme.getAttributes(), getAttributeConstraints(), - CM_NAME_ACCESSOR); - } else { - buildAttributeMapByApi(CacheManagerSampler.class, cms, cme.getAttributes(), getAttributeConstraints(), - CM_NAME_ACCESSOR); - } - - cmes.add(cme); - } - - return cmes; - } - - @Override - Logger getLog() { - return LOG; - } - - @Override - protected Set getExcludedAttributeNames(CacheManagerSampler cacheManagerSampler) { - return Collections.emptySet(); - } - - private void addSampler(CacheManagerSampler sampler) { - if (sampler == null) { - throw new IllegalArgumentException("sampler == null"); - } - cmSamplers.add(sampler); - } -} Index: rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/distribution/RMICacheManagerPeerListenerFactory.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/distribution/RMICacheManagerPeerListenerFactory.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/distribution/RMICacheManagerPeerListenerFactory.java (revision 0) @@ -1,107 +0,0 @@ -/** - * Copyright Terracotta, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package net.sf.ehcache.distribution; - -import net.sf.ehcache.CacheException; -import net.sf.ehcache.CacheManager; -import net.sf.ehcache.util.PropertyUtil; - -import java.net.UnknownHostException; -import java.util.Properties; - -/** - * Builds a listener based on RMI. - *

- * Expected configuration line: - *

- * - * <cachePeerListenerFactory class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory" - * properties="hostName=localhost, port=5000" /> - * - * - * @author Greg Luck - * @version $Id: RMICacheManagerPeerListenerFactory.java 10789 2018-04-26 02:08:13Z adahanne $ - */ -public class RMICacheManagerPeerListenerFactory extends CacheManagerPeerListenerFactory { - - /** - * The default timeout for cache replication for a single replication action. - * This may need to be increased for large data transfers. - */ - public static final Integer DEFAULT_SOCKET_TIMEOUT_MILLIS = Integer.valueOf(120000); - - private static final String HOSTNAME = "hostName"; - private static final String PORT = "port"; - private static final String REMOTE_OBJECT_PORT = "remoteObjectPort"; - private static final String SOCKET_TIMEOUT_MILLIS = "socketTimeoutMillis"; - - /** - * @param properties implementation specific properties. These are configured as comma - * separated name value pairs in ehcache.xml - */ - public final CacheManagerPeerListener createCachePeerListener(CacheManager cacheManager, Properties properties) - throws CacheException { - String hostName = PropertyUtil.extractAndLogProperty(HOSTNAME, properties); - - String portString = PropertyUtil.extractAndLogProperty(PORT, properties); - Integer port = null; - if (portString != null && portString.length() != 0) { - port = Integer.valueOf(portString); - } else { - port = Integer.valueOf(0); - } - - //0 means any port in UnicastRemoteObject, so it is ok if not specified to make it 0 - String remoteObjectPortString = PropertyUtil.extractAndLogProperty(REMOTE_OBJECT_PORT, properties); - Integer remoteObjectPort = null; - if (remoteObjectPortString != null && remoteObjectPortString.length() != 0) { - remoteObjectPort = Integer.valueOf(remoteObjectPortString); - } else { - remoteObjectPort = Integer.valueOf(0); - } - - String socketTimeoutMillisString = PropertyUtil.extractAndLogProperty(SOCKET_TIMEOUT_MILLIS, properties); - Integer socketTimeoutMillis; - if (socketTimeoutMillisString == null || socketTimeoutMillisString.length() == 0) { - socketTimeoutMillis = DEFAULT_SOCKET_TIMEOUT_MILLIS; - } else { - socketTimeoutMillis = Integer.valueOf(socketTimeoutMillisString); - } - return doCreateCachePeerListener(hostName, port, remoteObjectPort, cacheManager, socketTimeoutMillis); - } - - /** - * A template method to actually create the factory - * - * @param hostName - * @param port - * @param remoteObjectPort - * @param cacheManager - * @param socketTimeoutMillis @return a crate CacheManagerPeerListener - */ - protected CacheManagerPeerListener doCreateCachePeerListener(String hostName, - Integer port, - Integer remoteObjectPort, - CacheManager cacheManager, - Integer socketTimeoutMillis) { - try { - return new RMICacheManagerPeerListener(hostName, port, remoteObjectPort, cacheManager, socketTimeoutMillis); - } catch (UnknownHostException e) { - throw new CacheException("Unable to create CacheManagerPeerListener. Initial cause was " + e.getMessage(), e); - } - } -} Index: rctags/ehcache-2.10.9.0.411/ehcache-core/src/test/java/net/sf/ehcache/CachePerfTest.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-core/src/test/java/net/sf/ehcache/CachePerfTest.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-core/src/test/java/net/sf/ehcache/CachePerfTest.java (revision 0) @@ -1,766 +0,0 @@ -package net.sf.ehcache; - -import net.sf.ehcache.config.CacheConfiguration; -import net.sf.ehcache.exceptionhandler.ExceptionHandlingDynamicCacheProxy; -import net.sf.ehcache.store.MemoryStoreEvictionPolicy; -import net.sf.ehcache.store.disk.DiskStoreHelper; - -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Random; -import java.util.Vector; -import java.util.concurrent.atomic.AtomicLong; - -import net.sf.ehcache.config.Configuration; -import net.sf.ehcache.config.DiskStoreConfiguration; - -import org.junit.Rule; -import org.junit.rules.TemporaryFolder; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -//import net.sf.ehcache.loader.CountingCacheLoader; - -/** - * @author Alex Snaps - */ -public class CachePerfTest { - - @Rule - public final TemporaryFolder diskFolder = new TemporaryFolder(); - - private static final Logger LOG = LoggerFactory.getLogger(CachePerfTest.class.getName()); - - - /** - * Checks the expense of checking for duplicates - * Typical Results Duplicate Check: 8ms versus 3ms for No Duplicate Check - *

- * 66ms for 1000, 6ms for no duplicate/expiry - * 187565 for 100000, where 500 is the in-memory size. 964ms without checking expiry. 134ms for getKeysNoDuplicateCheckTime - * 18795 for 100000, where 50000 is in-memory size. 873ms without checking expiry. 158ms for getKeysNoDuplicateCheckTime - */ - @Test - public void testGetKeysPerformance() throws Exception { - CacheManager manager = new CacheManager(new Configuration().name("testGetKeysPerformance") - .diskStore(new DiskStoreConfiguration().path(diskFolder.getRoot().getAbsolutePath()))); - try { - //Set size so the second element overflows to disk. - Ehcache cache = new Cache("test4", 1000, true, true, 0, 0); - manager.addCache(cache); - - for (int i = 0; i < 2000; i++) { - cache.put(new Element("key" + i, "value")); - } - //let the notifiers cool down - Thread.sleep(1000); - StopWatch stopWatch = new StopWatch(); - List keys = cache.getKeys(); - assertTrue("Should be 2000 keys. ", keys.size() == 2000); - long getKeysTime = stopWatch.getElapsedTime(); - cache.getKeysNoDuplicateCheck(); - long getKeysNoDuplicateCheckTime = stopWatch.getElapsedTime(); - LOG.info("Time to get 1000 keys: With Duplicate Check: " + getKeysTime - + " Without Duplicate Check: " + getKeysNoDuplicateCheckTime); - assertTrue("Getting keys took more than 150ms", getKeysTime < 100); - } finally { - manager.shutdown(); - } - } - - - /** - * Performance tests for a range of Memory Store - Disk Store combinations. - *

- * This demonstrates that a memory only store is approximately an order of magnitude - * faster than a disk only store. - *

- * It also shows that double the performance of a Disk Only store can be obtained - * with a maximum memory size of only 1. Accordingly a Cache created without a - * maximum memory size of less than 1 will issue a warning. - *

- * Threading changes were made in v1.41 of DiskStore. The before and after numbers are shown. - *

- * This test also has a cache with a CacheExceptionHandler registered. The performance effect is not detectable. - */ - @Test - public void testProportionMemoryAndDiskPerformance() throws Exception { - CacheManager manager = new CacheManager(new Configuration().name("testProportionMemoryAndDiskPerformance") - .diskStore(new DiskStoreConfiguration().path(diskFolder.getRoot().getAbsolutePath()))); - try { - StopWatch stopWatch = new StopWatch(); - long time = 0; - - //Memory only Typical 192ms - Cache memoryOnlyCache = new Cache("testMemoryOnly", 5000, false, false, 5, 2); - manager.addCache(memoryOnlyCache); - time = stopWatch.getElapsedTime(); - for (int i = 0; i < 5000; i++) { - Integer key = Integer.valueOf(i); - memoryOnlyCache.put(new Element(Integer.valueOf(i), "value")); - memoryOnlyCache.get(key); - } - time = stopWatch.getElapsedTime(); - LOG.info("Time for MemoryStore: " + time); - assertTrue("Time to put and get 5000 entries into MemoryStore", time < 300); - - //Memory only Typical 192ms - for (int j = 0; j < 10; j++) { - time = stopWatch.getElapsedTime(); - for (int i = 0; i < 5000; i++) { - Integer key = Integer.valueOf(i); - memoryOnlyCache.put(new Element(Integer.valueOf(i), "value")); - memoryOnlyCache.get(key); - } - time = stopWatch.getElapsedTime(); - LOG.info("Time for MemoryStore: " + time); - assertTrue("Time to put and get 5000 entries into MemoryStore", time < 300); - Thread.sleep(500); - } - - //Memory only with ExceptionHandlingTypical 192ms - manager.replaceCacheWithDecoratedCache(memoryOnlyCache, ExceptionHandlingDynamicCacheProxy.createProxy(memoryOnlyCache)); - Ehcache exceptionHandlingMemoryOnlyCache = manager.getEhcache("testMemoryOnly"); - for (int j = 0; j < 10; j++) { - time = stopWatch.getElapsedTime(); - for (int i = 0; i < 5000; i++) { - Integer key = Integer.valueOf(i); - exceptionHandlingMemoryOnlyCache.put(new Element(Integer.valueOf(i), "value")); - exceptionHandlingMemoryOnlyCache.get(key); - } - time = stopWatch.getElapsedTime(); - LOG.info("Time for exception handling MemoryStore: " + time); - assertTrue("Time to put and get 5000 entries into exception handling MemoryStore", time < 300); - Thread.sleep(500); - } - - //Set size so that all elements overflow to disk. - // 1245 ms v1.38 DiskStore - // 273 ms v1.42 DiskStore - Cache diskOnlyCache = new Cache("testDiskOnly", 1, true, false, 5, 2); - manager.addCache(diskOnlyCache); - time = stopWatch.getElapsedTime(); - for (int i = 0; i < 5000; i++) { - Integer key = Integer.valueOf(i); - diskOnlyCache.put(new Element(key, "value")); - diskOnlyCache.get(key); - } - time = stopWatch.getElapsedTime(); - LOG.info("Time for DiskStore: " + time); - assertTrue("Time to put and get 5000 entries into DiskStore was less than 2 sec", time < 2000); - - // 1 Memory, 999 Disk - // 591 ms v1.38 DiskStore - // 56 ms v1.42 DiskStore - Cache m1d999Cache = new Cache("m1d999Cache", 1, true, false, 5, 2); - manager.addCache(m1d999Cache); - time = stopWatch.getElapsedTime(); - for (int i = 0; i < 5000; i++) { - Integer key = Integer.valueOf(i); - m1d999Cache.put(new Element(key, "value")); - m1d999Cache.get(key); - } - time = stopWatch.getElapsedTime(); - LOG.info("Time for m1d999Cache: " + time); - assertTrue("Time to put and get 5000 entries into m1d999Cache", time < 2000); - - // 500 Memory, 500 Disk - // 669 ms v1.38 DiskStore - // 47 ms v1.42 DiskStore - Cache m500d500Cache = new Cache("m500d500Cache", 500, true, false, 5, 2); - manager.addCache(m500d500Cache); - time = stopWatch.getElapsedTime(); - for (int i = 0; i < 5000; i++) { - Integer key = Integer.valueOf(i); - m500d500Cache.put(new Element(key, "value")); - m500d500Cache.get(key); - } - time = stopWatch.getElapsedTime(); - LOG.info("Time for m500d500Cache: " + time); - assertTrue("Time to put and get 5000 entries into m500d500Cache", time < 2000); - } finally { - manager.shutdown(); - } - } - - - /** - * Checks the expense of checking in-memory size - * 3467890 bytes in 1601ms for JDK1.4.2 - */ - @Test - public void testCalculateInMemorySizePerformanceAndReasonableness() throws Exception { - CacheManager manager = new CacheManager(new Configuration().name("testCalculateInMemorySizePerformanceAndReasonableness")); - try { - //Set size so the second element overflows to disk. - Cache cache1 = new Cache("test4", 1000, false, true, 0, 0); - manager.addCache(cache1); - Ehcache cache = cache1; - - //Set up object graphs - for (int i = 0; i < 1000; i++) { - HashMap map = new HashMap(100); - for (int j = 0; j < 100; j++) { - map.put("key" + j, new String[]{"adfdafs", "asdfdsafa", "sdfasdf"}); - } - cache.put(new Element("key" + i, map)); - } - - StopWatch stopWatch = new StopWatch(); - long size = cache.getStatistics().getLocalHeapSizeInBytes(); - assertTrue("Size is " + size + ". Check it for reasonableness.", size > 10000000 && size < 22000000); - long elapsed = stopWatch.getElapsedTime(); - LOG.info("In-memory size in bytes: " + size - + " time to calculate in ms: " + elapsed); - assertTrue("Calculate memory size takes less than 3.5 seconds", elapsed < 3500); - } finally { - manager.shutdown(); - } - } - - /** - * When flushing large MemoryStores, OutOfMemory issues can happen if we are - * not careful to move each Element to the DiskStore, rather than copy them all - * and then delete them from the MemoryStore. - *

- * This test manipulates a MemoryStore right on the edge of what can fit into the 64MB standard VM size. - * An inefficient spool will cause an OutOfMemoryException. - * - * @throws Exception - */ - @Test - public void testMemoryEfficiencyOfFlushWhenOverflowToDisk() throws Exception { - CacheManager manager = new CacheManager(new Configuration().name("testMemoryEfficiencyOfFlushWhenOverflowToDisk") - .diskStore(new DiskStoreConfiguration().path(diskFolder.getRoot().getAbsolutePath()))); - try { - CacheConfiguration config = new CacheConfiguration("testGetMemoryStoreSize", 40000); - config.setOverflowToDisk(true); - config.setEternal(false); - config.setTimeToLiveSeconds(100); - config.setTimeToIdleSeconds(200); - config.setDiskPersistent(false); - config.setDiskExpiryThreadIntervalSeconds(120); - Cache cache = new Cache(config); - - manager.addCache(cache); - StopWatch stopWatch = new StopWatch(); - - assertEquals(0, cache.getStatistics().getLocalHeapSize()); - - for (int i = 0; i < 80000; i++) { - cache.put(new Element("" + i, new byte[480])); - } - LOG.info("Put time: " + stopWatch.getElapsedTime()); - DiskStoreHelper.flushAllEntriesToDisk(cache).get(); - assertEquals(40000, cache.getStatistics().getLocalHeapSize()); - assertEquals(80000, cache.getStatistics().getLocalDiskSize()); - - long beforeMemory = AbstractCacheTest.measureMemoryUse(); - stopWatch.getElapsedTime(); - cache.flush(); - LOG.info("Flush time: " + stopWatch.getElapsedTime()); - - //It takes a while to write all the Elements to disk - Thread.sleep(1000); - - long afterMemory = AbstractCacheTest.measureMemoryUse(); - long memoryIncrease = afterMemory - beforeMemory; - assertTrue(memoryIncrease < 40000000); - - assertEquals(0, cache.getStatistics().getLocalHeapSize()); - assertEquals(80000, cache.getStatistics().getLocalDiskSize()); - } finally { - manager.shutdown(); - } - } - - /** - * Orig. - * INFO: Average Get Time: 0.37618342 ms - * INFO: Average Put Time: 0.61346555 ms - * INFO: Average Remove Time: 0.43651128 ms - * INFO: Average Remove All Time: 0.20818481 ms - * INFO: Average keySet Time: 0.11898771 ms - *

- * CLHM - * INFO: Average Get Time for 3611277 observations: 0.0043137097 ms - * INFO: Average Put Time for 554433 obervations: 0.011824693 ms - * INFO: Average Remove Time for 802361 obervations: 0.008200797 ms - * INFO: Average Remove All Time for 2887862 observations: 4.685127E-4 ms - * INFO: Average keySet Time for 2659524 observations: 0.003155828 ms - *

- * CHM with sampling - * INFO: Average Get Time for 5424446 observations: 0.0046010227 ms - * INFO: Average Put Time for 358907 obervations: 0.027190888 ms - * INFO: Average Remove Time for 971741 obervations: 0.00924732 ms - * INFO: Average keySet Time for 466812 observations: 0.15059596 ms - *

- * After putting back synchronized: - *

- * INFO: Average Get Time for 7184321 observations: 0.009596036 ms - * INFO: Average Put Time for 15853 obervations: 0.117264874 ms - * INFO: Average Remove Time for 385518 obervations: 0.017298803 ms - * INFO: Average Remove All Time for 456174 observations: 0.10433519 ms - * INFO: Average keySet Time for 4042893 observations: 0.0029669348 ms - * INFO: Total loads: 123 - *

- * Ehcache 2.0: After turning off statistics. - * Feb 3, 2010 1:50:32 PM net.sf.ehcache.CacheTest testConcurrentReadWriteRemove - * INFO: Average Get Time for 7251897 observations: 0.006588345 ms - * INFO: Average Put Time for 6190 obervations: 0.07479806 ms - * INFO: Average Remove Time for 4428 obervations: 0.7606143 ms - * INFO: Average Remove All Time for 5183786 observations: 0.0020039408 ms - * INFO: Average keySet Time for 4973208 observations: 0.0020630546 ms - * INFO: Total loadAlls: 189 - *

- * Aug 10, 2011 4:43:47 PM Ehcache 2.1 Revalidation on Mac OS X Lion and same machine - * INFO: Average Get Time for 7474731 observations: 0.0066825147 ms - * INFO: Average Put Time for 12918 obervations: 0.6070599 ms - * INFO: Average Remove Time for 57024 obervations: 0.06649832 ms - * INFO: Average Remove All Time for 5147782 observations: 0.0026411375 ms - * INFO: Average keySet Time for 4717506 observations: 0.002453627 ms - *

- * Aug 10, 2011 4:47:16 PM 2.5 beta - * INFO: Average Get Time for 517885 observations: 0.16877685 ms - * INFO: Average Put Time for 52501 obervations: 0.5059332 ms - * INFO: Average Remove Time for 30177 obervations: 0.7006329 ms - * INFO: Average Remove All Time for 107152 observations: 0.8572775 ms - * INFO: Average keySet Time for 98991 observations: 0.92390215 ms - *

- * Aug 12, 2011 11:24:40 AM Java 6 Agent sizeof with "value" value - * INFO: Average Get Time for 1378042 observations: 0.18543556 ms - * INFO: Average Put Time for 1056477 obervations: 0.092374 ms - * INFO: Average Remove Time for 2013940 obervations: 0.032961756 ms - * INFO: Average Remove All Time for 894820 observations: 0.10991708 ms - * INFO: Average keySet Time for 114488 observations: 0.8662655 ms - *

- * Aug 12, 2011 11:32:38 AM with Java 6 Agent sizeof with list of stacktraces value - * INFO: Average Put Time for 753610 obervations: 0.119633496 ms - */ - @Test - public void testConcurrentReadWriteRemoveLRU() throws Exception { - testConcurrentReadWriteRemove(MemoryStoreEvictionPolicy.LRU); - } - - /** - *

-     * Orig.
-     * INFO: Average Get Time: 1.2396777 ms
-     * INFO: Average Put Time: 1.4968935 ms
-     * INFO: Average Remove Time: 1.3399061 ms
-     * INFO: Average Remove All Time: 0.22590445 ms
-     * INFO: Average keySet Time: 0.20492058 ms
-     *
-     * INFO: Average Get Time: 1.081209 ms
-     * INFO: Average Put Time: 1.2307026 ms
-     * INFO: Average Remove Time: 1.1294961 ms
-     * INFO: Average Remove All Time: 0.16385451 ms
-     * INFO: Average keySet Time: 0.1549516 ms
-     *
-     * CHM version with no sync on get.
-     * INFO: Average Get Time for 2582432 observations: 0.019930825 ms
-     * INFO: Average Put Time for 297 obervations: 41.40404 ms
-     * INFO: Average Remove Time for 1491 obervations: 13.892018 ms
-     * INFO: Average Remove All Time for 135893 observations: 0.54172766 ms
-     * INFO: Average keySet Time for 112686 observations: 0.7157411 ms
-     *
-     * 1.6
-     * INFO: Average Get Time for 4984448 observations: 0.006596317 ms
-     * INFO: Average Put Time for 7266 obervations: 0.42361686 ms
-     * INFO: Average Remove Time for 2024066 obervations: 0.012883473 ms
-     * INFO: Average Remove All Time for 3572412 observations: 8.817572E-5 ms
-     * INFO: Average keySet Time for 2653539 observations: 0.002160511 ms
-     * INFO: Total loads: 38
-     * 
- * With iterator - * 1.6 with 100,000 store size: puts take 45ms. keySet 7ms - * 1.6 with 1000,000 store size: puts take 381ms. keySet 7ms - * 1,000,000 - using FastRandom (j.u.Random was dog slow) - * INFO: Average Get Time for 2065131 observations: 0.013553619 ms - * INFO: Average Put Time for 46404 obervations: 0.1605034 ms - * INFO: Average Remove Time for 20515 obervations: 0.1515964 ms - * INFO: Average Remove All Time for 0 observations: NaN ms - * INFO: Average keySet Time for 198 observations: 0.0 ms - *

- * 9999 - using iterator - * INFO: Average Get Time for 4305030 observations: 0.006000423 ms - * INFO: Average Put Time for 3216 obervations: 0.92008704 ms - * INFO: Average Remove Time for 5294 obervations: 0.048545524 ms - * INFO: Average Remove All Time for 0 observations: NaN ms - * INFO: Average keySet Time for 147342 observations: 0.5606073 ms - * 10001 - using FastRandom - * INFO: Average Get Time for 4815249 observations: 0.005541354 ms - * INFO: Average Put Time for 5186 obervations: 0.49826455 ms - * INFO: Average Remove Time for 129163 obervations: 0.015120429 ms - * INFO: Average Remove All Time for 0 observations: NaN ms - * INFO: Average keySet Time for 177342 observations: 0.500733 ms - * 4999 - using iterator - * INFO: Average Get Time for 4317409 observations: 0.0061599445 ms - * INFO: Average Put Time for 2708 obervations: 1.0768094 ms - * INFO: Average Remove Time for 17664 obervations: 0.11713089 ms - * INFO: Average Remove All Time for 0 observations: NaN ms - * INFO: Average keySet Time for 321180 observations: 0.26723954 ms - * 5001 - using FastRandom - * INFO: Average Get Time for 3203904 observations: 0.0053447294 ms - * INFO: Average Put Time for 152905 obervations: 0.056616854 ms - * INFO: Average Remove Time for 737289 obervations: 0.008854059 ms - * INFO: Average Remove All Time for 0 observations: NaN ms - * INFO: Average keySet Time for 272898 observations: 0.3118601 ms - * - * @throws Exception - */ - @Test - public void testConcurrentReadWriteRemoveLFU() throws Exception { - testConcurrentReadWriteRemove(MemoryStoreEvictionPolicy.LFU); - } - - /** - * INFO: Average Get Time: 0.28684255 ms - * INFO: Average Put Time: 0.34759903 ms - * INFO: Average Remove Time: 0.31298608 ms - * INFO: Average Remove All Time: 0.21396147 ms - * INFO: Average keySet Time: 0.11740683 ms - *

- * CLHM - * INFO: Average Get Time for 4567959 observations: 0.005231658 ms - * INFO: Average Put Time for 437078 obervations: 0.01527645 ms - * INFO: Average Remove Time for 178915 obervations: 0.013335941 ms - * INFO: Average Remove All Time for 3500724 observations: 0.0070434003 ms - * INFO: Average keySet Time for 3207776 observations: 0.011053764 ms - */ - @Test - public void testConcurrentReadWriteRemoveFIFO() throws Exception { - testConcurrentReadWriteRemove(MemoryStoreEvictionPolicy.FIFO); - } - - public void testConcurrentReadWriteRemove(MemoryStoreEvictionPolicy policy) throws Exception { - CacheManager manager = new CacheManager(new Configuration().name("testConcurrentReadWriteRemove")); - try { - final int size = 10000; - //set it higher for normal continuous integration so occasional higher numbes do not break tests - final int maxTime = (int) (500 * StopWatch.getSpeedAdjustmentFactor()); - CacheConfiguration cacheConfigurationTest3Cache = new CacheConfiguration("test3cache", size) - .eternal(true).memoryStoreEvictionPolicy(MemoryStoreEvictionPolicy.LRU).overflowToDisk(false) - .statistics(false); - // CacheConfiguration cacheConfigurationTest3Cache = new CacheConfiguration() - // .name("test3cache").maxBytesLocalHeap(40, MemoryUnit.MEGABYTES) - // .eternal(true).memoryStoreEvictionPolicy(MemoryStoreEvictionPolicy.LRU).overflowToDisk(false) - // .statistics(false); - manager.addCache(new Cache(cacheConfigurationTest3Cache)); - final Ehcache cache = manager.getEhcache("test3cache"); - - System.gc(); - Thread.sleep(500); - System.gc(); - Thread.sleep(500); - - final AtomicLong getTimeSum = new AtomicLong(); - final AtomicLong getTimeCount = new AtomicLong(); - final AtomicLong putTimeSum = new AtomicLong(); - final AtomicLong putTimeCount = new AtomicLong(); - final AtomicLong removeTimeSum = new AtomicLong(); - final AtomicLong removeTimeCount = new AtomicLong(); - final AtomicLong removeAllTimeSum = new AtomicLong(); - final AtomicLong removeAllTimeCount = new AtomicLong(); - final AtomicLong keySetTimeSum = new AtomicLong(); - final AtomicLong keySetTimeCount = new AtomicLong(); - - // TODO : Reenable that somehow! - // CountingCacheLoader countingCacheLoader = new CountingCacheLoader(); - // cache.registerCacheLoader(countingCacheLoader); - - final List executables = new ArrayList(); - final Random random = new Random(); - - ArrayList list = new ArrayList(); - StackTraceElement[] stackTraceElements; - try { - throw new CacheException("test"); - } catch (CacheException e) { - stackTraceElements = e.getStackTrace(); - } - for (int i = 0; i < 1000; i++) { - list.add(stackTraceElements); - } - - for (int i = 0; i < size; i++) { - cache.put(new Element("" + i, "value")); - // cache.put(new Element("" + i, list)); - } - - //some of the time get data - for (int i = 0; i < 26; i++) { - final AbstractCacheTest.Executable executable = new AbstractCacheTest.Executable() { - public void execute() throws Exception { - final StopWatch stopWatch = new StopWatch(); - long start = stopWatch.getElapsedTime(); - cache.get("key" + random.nextInt(size)); - long end = stopWatch.getElapsedTime(); - long elapsed = end - start; - assertTrue("Get time outside of allowed range: " + elapsed, elapsed < maxTime); - getTimeSum.getAndAdd(elapsed); - getTimeCount.getAndIncrement(); - } - }; - executables.add(executable); - } - - //some of the time add data - for (int i = 0; i < 10; i++) { - final AbstractCacheTest.Executable executable = new AbstractCacheTest.Executable() { - public void execute() throws Exception { - final StopWatch stopWatch = new StopWatch(); - long start = stopWatch.getElapsedTime(); - cache.put(new Element("key" + random.nextInt(size), "value")); - long end = stopWatch.getElapsedTime(); - long elapsed = end - start; - assertTrue("Put time outside of allowed range: " + elapsed, elapsed < maxTime); - putTimeSum.getAndAdd(elapsed); - putTimeCount.getAndIncrement(); - } - }; - executables.add(executable); - } - - //some of the time remove the data - for (int i = 0; i < 7; i++) { - final AbstractCacheTest.Executable executable = new AbstractCacheTest.Executable() { - public void execute() throws Exception { - final StopWatch stopWatch = new StopWatch(); - long start = stopWatch.getElapsedTime(); - cache.remove("key" + random.nextInt(size)); - long end = stopWatch.getElapsedTime(); - long elapsed = end - start; - assertTrue("Remove time outside of allowed range: " + elapsed, elapsed < maxTime); - removeTimeSum.getAndAdd(elapsed); - removeTimeCount.getAndIncrement(); - } - }; - executables.add(executable); - } - - - //some of the time removeAll the data - for (int i = 0; i < 10; i++) { - final AbstractCacheTest.Executable executable = new AbstractCacheTest.Executable() { - public void execute() throws Exception { - final StopWatch stopWatch = new StopWatch(); - long start = stopWatch.getElapsedTime(); - int randomInteger = random.nextInt(20); - if (randomInteger == 3) { - cache.removeAll(); - } - long end = stopWatch.getElapsedTime(); - long elapsed = end - start; - //remove all is slower - assertTrue("RemoveAll time outside of allowed range: " + elapsed, elapsed < (maxTime * 3)); - removeAllTimeSum.getAndAdd(elapsed); - removeAllTimeCount.getAndIncrement(); - } - }; - executables.add(executable); - } - - - //some of the time iterate - for (int i = 0; i < 10; i++) { - final AbstractCacheTest.Executable executable = new AbstractCacheTest.Executable() { - public void execute() throws Exception { - final StopWatch stopWatch = new StopWatch(); - long start = stopWatch.getElapsedTime(); - int randomInteger = random.nextInt(20); - if (randomInteger == 3) { - cache.getKeys(); - } - long end = stopWatch.getElapsedTime(); - long elapsed = end - start; - //remove all is slower - assertTrue("cache.getKeys() time outside of allowed range: " + elapsed, elapsed < (maxTime * 3)); - keySetTimeSum.getAndAdd(elapsed); - keySetTimeCount.getAndIncrement(); - } - }; - executables.add(executable); - } - - //some of the time exercise the loaders through their various methods. Loader methods themselves make no performance - //guarantees. They should only lock the cache when doing puts and gets, which the time limits on the other threads - //will check for. - for (int i = 0; i < 4; i++) { - final AbstractCacheTest.Executable executable = new AbstractCacheTest.Executable() { - public void execute() throws Exception { - int randomInteger = random.nextInt(20); - List keys = new ArrayList(); - for (int i = 0; i < 2; i++) { - keys.add("key" + random.nextInt(size)); - } - if (randomInteger == 1) { - cache.load("key" + random.nextInt(size)); - } else if (randomInteger == 2) { - cache.loadAll(keys, null); - } else if (randomInteger == 3) { - cache.getWithLoader("key" + random.nextInt(size), null, null); - } else if (randomInteger == 4) { - cache.getAllWithLoader(keys, null); - } - } - }; - executables.add(executable); - } - - - try { - int failures = AbstractCacheTest.runThreadsNoCheck(executables); - LOG.info(failures + " failures"); - //CHM does have the occasional very slow time. - assertTrue("Failures = " + failures, failures <= 50); - } finally { - LOG.info("Average Get Time for " + getTimeCount.get() + " observations: " - + getTimeSum.floatValue() / getTimeCount.get() + " ms"); - LOG.info("Average Put Time for " + putTimeCount.get() + " obervations: " - + putTimeSum.floatValue() / putTimeCount.get() + " ms"); - LOG.info("Average Remove Time for " + removeTimeCount.get() + " obervations: " - + removeTimeSum.floatValue() / removeTimeCount.get() + " ms"); - LOG.info("Average Remove All Time for " + removeAllTimeCount.get() + " observations: " - + removeAllTimeSum.floatValue() / removeAllTimeCount.get() + " ms"); - LOG.info("Average keySet Time for " + keySetTimeCount.get() + " observations: " - + keySetTimeSum.floatValue() / keySetTimeCount.get() + " ms"); - // LOG.info("Total loads: " + countingCacheLoader.getLoadCounter()); - // LOG.info("Total loadAlls: " + countingCacheLoader.getLoadAllCounter()); - } - } finally { - manager.shutdown(); - } - } - - - /** - * Multi-thread read-write test with 20 threads - * Just use MemoryStore to put max stress on cache - * Values that work: - *

-     * Results 3/2/09
-     * Feb 3, 2009 5:57:35 PM net.sf.ehcache.CacheTest testConcurrentReadPerformanceMemoryOnly
-     * INFO: 400 threads. Average Get time: 0.033715356 ms
-     * INFO: 800 threads. Average Get time: 18.419634 ms
-     * INFO: 1200 threads. Average Get time: 56.21161 ms
-     * INFO: 1600 threads. Average Get time: 85.19998 ms
-     * INFO: 2000 threads. Average Get time: 85.83994 ms
-     * 
- * With ConcurrentHashMap - *
-     * INFO: 1 threads. Average Get time: 0.082987554 ms
-     * INFO: 401 threads. Average Get time: 0.0070842816 ms
-     * INFO: 801 threads. Average Get time: 0.0066290447 ms
-     * INFO: 1201 threads. Average Get time: 0.0063261427 ms
-     * INFO: 1601 threads. Average Get time: 0.005570657 ms
-     * INFO: 2001 threads. Average Get time: 0.015918251 ms
-     *
-     * v207
-     * INFO: 1 threads. Average Get time: 0.051759835 ms
-     * INFO: 401 threads. Average Get time: 0.0118925795 ms
-     * INFO: 801 threads. Average Get time: 0.021494854 ms
-     * INFO: 1201 threads. Average Get time: 0.07880102 ms
-     * INFO: 1601 threads. Average Get time: 0.067811936 ms
-     * INFO: 2001 threads. Average Get time: 0.12559706 ms
-     *
-     * Before AtomicLong
-     * INFO: 1 threads. Average Get time: 0.024948025 ms
-     * INFO: 401 threads. Average Get time: 0.0079776095 ms
-     * INFO: 801 threads. Average Get time: 0.0049358485 ms
-     * INFO: 1201 threads. Average Get time: 0.059032038 ms
-     * INFO: 1601 threads. Average Get time: 0.039221533 ms
-     * INFO: 2001 threads. Average Get time: 0.03138067 ms
-     *
-     * INFO: 1 threads. Average Get time: 0.039014373 ms
-     * INFO: 401 threads. Average Get time: 0.005683447 ms
-     * INFO: 801 threads. Average Get time: 0.0041153855 ms
-     * INFO: 1201 threads. Average Get time: 0.02003592 ms
-     * INFO: 1601 threads. Average Get time: 0.039240483 ms
-     * INFO: 2001 threads. Average Get time: 0.04503215 ms
-     *
-     * INFO: 1 threads. Average Get time: 0.026694044 ms
-     * INFO: 401 threads. Average Get time: 0.0076737576 ms
-     * INFO: 801 threads. Average Get time: 0.003894474 ms
-     * INFO: 1201 threads. Average Get time: 0.06022612 ms
-     * INFO: 1601 threads. Average Get time: 0.03710788 ms
-     * INFO: 2001 threads. Average Get time: 0.064271376 ms
-     *
-     * After AtomicLong counters
-     * INFO: 1 threads. Average Get time: 0.02566735 ms
-     * INFO: 401 threads. Average Get time: 0.0054228795 ms
-     * INFO: 801 threads. Average Get time: 0.0046341107 ms
-     * INFO: 1201 threads. Average Get time: 0.075431876 ms
-     * INFO: 1601 threads. Average Get time: 0.10669952 ms
-     * INFO: 2001 threads. Average Get time: 0.051209673 ms
-     *
-     * INFO: 1 threads. Average Get time: 0.028481012 ms
-     * INFO: 401 threads. Average Get time: 0.003833565 ms
-     * INFO: 801 threads. Average Get time: 0.005232163 ms
-     * INFO: 1201 threads. Average Get time: 0.06157142 ms
-     * INFO: 1601 threads. Average Get time: 0.08064302 ms
-     * INFO: 2001 threads. Average Get time: 0.048335962 ms
-     *
-     *
-     * 
- */ - @Test - public void testConcurrentReadPerformanceMemoryOnly() throws Exception { - CacheManager manager = new CacheManager(new Configuration().name("testConcurrentReadPerformanceMemoryOnly")); - try { - - final int size = 10000; - - manager.addCache(new Cache("test3cache", size, false, true, 1000, 1000)); - final Ehcache cache = manager.getEhcache("test3cache"); - final Vector readTimes = new Vector(); - - - for (int threads = 1; threads <= 2100; threads += 400) { - - readTimes.clear(); - - final List executables = new ArrayList(); - final Random random = new Random(); - - for (int i = 0; i < size; i++) { - cache.put(new Element("" + i, "value")); - } - - //some of the time get data - for (int i = 0; i < threads; i++) { - final AbstractCacheTest.Executable executable = new AbstractCacheTest.Executable() { - public void execute() throws Exception { - final StopWatch stopWatch = new StopWatch(); - long start = stopWatch.getElapsedTime(); - cache.get("key" + random.nextInt(size)); - long end = stopWatch.getElapsedTime(); - long elapsed = end - start; - readTimes.add(elapsed); - Thread.sleep(10); - } - }; - executables.add(executable); - } - - - int failures = AbstractCacheTest.runThreadsNoCheck(executables); - LOG.info(failures + " failures"); - assertTrue(failures == 0); - long totalReadTime = 0; - for (Long readTime : readTimes) { - totalReadTime += readTime; - } - LOG.info(threads + " threads. Average Get time: " + totalReadTime / (float) readTimes.size() + " ms"); - - } - } finally { - manager.shutdown(); - } - } -} Index: rctags/ehcache-2.10.9.0.411/system-tests/src/test/java/org/terracotta/ehcache/tests/servermap/ServerMapL1CapacityEvictionExpressTestClient.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/system-tests/src/test/java/org/terracotta/ehcache/tests/servermap/ServerMapL1CapacityEvictionExpressTestClient.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/system-tests/src/test/java/org/terracotta/ehcache/tests/servermap/ServerMapL1CapacityEvictionExpressTestClient.java (revision 0) @@ -1,74 +0,0 @@ -/* - * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved. - */ -package org.terracotta.ehcache.tests.servermap; - -import net.sf.ehcache.Cache; -import net.sf.ehcache.Element; - -import org.terracotta.toolkit.Toolkit; - -import java.util.Date; - -public class ServerMapL1CapacityEvictionExpressTestClient extends ServerMapClientBase { - - public ServerMapL1CapacityEvictionExpressTestClient(String[] args) { - super("testWithMaxElementsInMemory", args); - } - - public static void main(String[] args) { - new ServerMapL1CapacityEvictionExpressTestClient(args).run(); - } - - @Override - protected void runTest(Cache cache, Toolkit clusteringToolkit) throws Throwable { - assertLocalCache(true); - int size = cache.getSize(); - assertEquals(0, size); - System.out.println("Client populating cache."); - for (int i = 0; i < 5100; i++) { - cache.put(new Element("key-" + i, "value-" + i)); - } - - System.out.println("Cache populated. Sleeping for 3 secs. size: " + cache.getSize() + " inMemorySize: " - + cache.getStatistics().getLocalHeapSize()); - Thread.sleep(3000); - - System.out.println("After sleeping 3 secs. size: " + cache.getSize() + " inMemorySize: " - + cache.getStatistics().getLocalHeapSize()); - // assert range as some may have got evicted while populating cache - assertRange(4500, 5100, cache.getSize()); - assertRange(0, 5100, cache.getStatistics().getLocalHeapSize()); - - // add some more elements, to get eviction kicking if not already - for (int i = 5100; i < 5200; i++) { - cache.put(new Element("key-" + i, "value-" + i)); - } - - System.out.println("After adding 100 more. size: " + cache.getSize() + " inMemorySize: " - + cache.getStatistics().getLocalHeapSize()); - - System.out.println("Sleeping for 1.5 mins (now=" + new Date() + ") ... "); - // Wait a bit for the capacity evictor to do its thing. - Thread.sleep(15 * 6 * 1000); - - System.out.println("After sleeping for 1.5 mins. Size: " + cache.getSize() + " inMemorySize: " - + cache.getStatistics().getLocalHeapSize()); - // l1 cacacity evicts 20% extra of maxInMemory - assertRange(0, 5000, cache.getStatistics().getLocalHeapSize()); - - } - - private void assertRange(int min, int max, long actual) { - assertTrue("assert range failed: min: " + min + " max: " + max + " actual: " + actual, min <= actual - && actual <= max); - } - - private void assertLocalCache(boolean enabled) throws Exception { - String expected = enabled ? "true" : "false"; - String property = System.getProperty("com.tc.ehcache.storageStrategy.dcv2.localcache.enabled"); - if (property == null || !expected.equalsIgnoreCase(property)) { throw new Exception( - "This client needs to be run with local cache enabled"); } - } - -} Index: rctags/ehcache-2.10.9.0.411/ehcache-core/src/test/java/net/sf/ehcache/loader/ComponentB.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-core/src/test/java/net/sf/ehcache/loader/ComponentB.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-core/src/test/java/net/sf/ehcache/loader/ComponentB.java (revision 0) @@ -1,49 +0,0 @@ -/** - * Copyright Terracotta, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package net.sf.ehcache.loader; - -/** - * Written for Dead-lock poc - * - * @author Greg Luck - * @version $Id: ComponentB.java 5594 2012-05-07 16:04:31Z cdennis $ - */ -public class ComponentB { - - private String name; - - /** - * @param name - */ - public ComponentB(String name) { - this.name = name; - } - - /** - * @return - */ - public String getName() { - return name; - } - - /** - * @return - */ - public String toString() { - return "B(" + name + ")"; - } -} Index: rctags/ehcache-2.10.9.0.411/system-tests/src/test/java/org/terracotta/modules/ehcache/hibernate/domain/VersionedItem.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/system-tests/src/test/java/org/terracotta/modules/ehcache/hibernate/domain/VersionedItem.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/system-tests/src/test/java/org/terracotta/modules/ehcache/hibernate/domain/VersionedItem.java (revision 0) @@ -1,16 +0,0 @@ -/* - * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved. - */ -package org.terracotta.modules.ehcache.hibernate.domain; - -public class VersionedItem extends Item { - private Long version; - - public Long getVersion() { - return version; - } - - public void setVersion(Long version) { - this.version = version; - } -} Index: rctags/ehcache-2.10.9.0.411/ehcache-core/src/test/resources/ehcache-defaultonly.xml =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-core/src/test/resources/ehcache-defaultonly.xml (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-core/src/test/resources/ehcache-defaultonly.xml (revision 0) @@ -1,16 +0,0 @@ - - - - - - - - - Index: rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/terracotta/package.html =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/terracotta/package.html (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/terracotta/package.html (revision 0) @@ -1,7 +0,0 @@ - - - - - This package contains the Terracotta integration functionalities. - - \ No newline at end of file Index: rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/util/TimeUtil.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/util/TimeUtil.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/util/TimeUtil.java (revision 0) @@ -1,64 +0,0 @@ -/** - * Copyright Terracotta, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package net.sf.ehcache.util; - -/** - * Utilities for converting times - * @author Greg Luck - */ -public class TimeUtil { - - /** - * Constant that contains the amount of milliseconds in a second - */ - static final long ONE_SECOND = 1000L; - - /** - * Converts milliseconds to seconds - * @param timeInMillis - * @return The equivalent time in seconds - */ - public static int toSecs(long timeInMillis) { - // Rounding the result to the ceiling, otherwise a - // System.currentTimeInMillis that happens right before a new Element - // instantiation will be seen as 'later' than the actual creation time - return (int)Math.ceil((double)timeInMillis / ONE_SECOND); - } - - /** - * Converts seconds to milliseconds, with a precision of 1 second - * @param timeInSecs the time in seconds - * @return The equivalent time in milliseconds - */ - public static long toMillis(int timeInSecs) { - return timeInSecs * ONE_SECOND; - } - - /** - * Converts a long seconds value to an int seconds value and takes into account overflow - * from the downcast by switching to Integer.MAX_VALUE. - * @param seconds Long value - * @return Same int value unless long {@code >} Integer.MAX_VALUE in which case MAX_VALUE is returned - */ - public static int convertTimeToInt(long seconds) { - if (seconds > Integer.MAX_VALUE) { - return Integer.MAX_VALUE; - } else { - return (int) seconds; - } - } -} Index: rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/pool/sizeof/MaxDepthExceededException.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/pool/sizeof/MaxDepthExceededException.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/pool/sizeof/MaxDepthExceededException.java (revision 0) @@ -1,50 +0,0 @@ -/** - * Copyright Terracotta, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package net.sf.ehcache.pool.sizeof; - -/** - * @author Ludovic Orban - */ -public class MaxDepthExceededException extends RuntimeException { - - private long measuredSize; - - /** - * Constructor - */ - public MaxDepthExceededException(String msg) { - super(msg); - } - - /** - * Add to the partially measured size - * - * @param toAdd - */ - public void addToMeasuredSize(long toAdd) { - measuredSize += toAdd; - } - - /** - * Get the partially measured size - * - * @return - */ - public long getMeasuredSize() { - return measuredSize; - } -} Index: rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/statistics/StatisticBuilder.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/statistics/StatisticBuilder.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/statistics/StatisticBuilder.java (revision 0) @@ -1,141 +0,0 @@ -/** - * Copyright Terracotta, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package net.sf.ehcache.statistics; - -import java.util.Collections; -import java.util.HashSet; -import java.util.Set; - -import org.terracotta.statistics.StatisticsManager; -import org.terracotta.statistics.observer.OperationObserver; - -/** - * The StatisticBuilder. - * - * @author cdennis - */ -public final class StatisticBuilder { - - /** - * Instantiates a new statistic builder. - */ - private StatisticBuilder() { - - } - - /** - * Operation. - * - * @param the generic type - * @param type the type - * @return the operation statistic builder - */ - public static > OperationStatisticBuilder operation(Class type) { - return new OperationStatisticBuilder(type); - } - - /** - * The Class OperationStatisticBuilder. - * - * @param the generic type - */ - public static class OperationStatisticBuilder> extends AbstractStatisticBuilder> { - - /** The type. */ - private final Class type; - - /** - * Instantiates a new operation statistic builder. - * - * @param type the type - */ - public OperationStatisticBuilder(Class type) { - this.type = type; - } - - /** - * Builds the. - * - * @return the operation observer - */ - public OperationObserver build() { - if (context == null || name == null) { - throw new IllegalStateException(); - } else { - return StatisticsManager.createOperationStatistic(context, name, tags, type); - } - } - } - - /** - * The Class AbstractStatisticBuilder. - * - * @param the generic type - */ - static class AbstractStatisticBuilder { - - /** The tags. */ - protected final Set tags = new HashSet(); - - /** The context. */ - protected Object context; - - /** The name. */ - protected String name; - - /** - * Of. - * - * @param of the of - * @return the t - */ - public T of(Object of) { - if (context == null) { - context = of; - return (T) this; - } else { - throw new IllegalStateException("Context already defined"); - } - } - - /** - * Named. - * - * @param name the name - * @return the t - */ - public T named(String name) { - if (this.name == null) { - this.name = name; - return (T) this; - } else { - throw new IllegalStateException("Name already defined"); - } - } - - /** - * Tag. - * - * @param tags the tags - * @return the t - */ - public T tag(String ... tags) { - Collections.addAll(this.tags, tags); - return (T) this; - } - } -} Index: rctags/ehcache-2.10.9.0.411/ehcache-core/src/test/java/net/sf/ehcache/transaction/xa/XATransactionTest.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-core/src/test/java/net/sf/ehcache/transaction/xa/XATransactionTest.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-core/src/test/java/net/sf/ehcache/transaction/xa/XATransactionTest.java (revision 0) @@ -1,230 +0,0 @@ -package net.sf.ehcache.transaction.xa; - -import bitronix.tm.BitronixTransaction; -import bitronix.tm.TransactionManagerServices; -import bitronix.tm.internal.TransactionStatusChangeListener; -import bitronix.tm.recovery.Recoverer; -import bitronix.tm.resource.ResourceRegistrar; -import bitronix.tm.resource.common.XAResourceProducer; -import net.sf.ehcache.Cache; -import net.sf.ehcache.CacheManager; -import net.sf.ehcache.CacheStoreHelper; -import net.sf.ehcache.Ehcache; -import net.sf.ehcache.Element; -import net.sf.ehcache.store.TxCopyingCacheStore; -import net.sf.ehcache.transaction.TransactionTimeoutException; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import javax.transaction.Status; -import javax.transaction.TransactionManager; -import javax.transaction.xa.XAResource; -import javax.transaction.xa.Xid; - -import junit.framework.AssertionFailedError; -import junit.framework.TestCase; - -/** - * @author Ludovic Orban - */ -public class XATransactionTest extends TestCase { - - private static final Logger LOG = LoggerFactory.getLogger(XATransactionTest.class); - - private TransactionManager tm; - private CacheManager cacheManager; - private Ehcache cache1; - private Ehcache cache2; - - @Override - protected void setUp() throws Exception { - TransactionManagerServices.getConfiguration().setJournal("null").setGracefulShutdownInterval(0).setBackgroundRecoveryIntervalSeconds(1); - - tm = TransactionManagerServices.getTransactionManager(); - cacheManager = new CacheManager(XATransactionTest.class.getResourceAsStream("/ehcache-tx-twopc.xml")); - - cache1 = cacheManager.getEhcache("txCache1"); - cache2 = cacheManager.getEhcache("txCache2"); - tm.begin(); - - cache1.removeAll(); - cache2.removeAll(); - - tm.commit(); - } - - @Override - protected void tearDown() throws Exception { - if (tm.getTransaction() != null) { - tm.rollback(); - } - cacheManager.shutdown(); - TransactionManagerServices.getTransactionManager().shutdown(); - } - - public void testSimple() throws Exception { - LOG.info("******* START"); - - tm.begin(); - cache1.get(1); - cache1.put(new Element(1, "one")); - tm.commit(); - - tm.begin(); - Element e = cache1.get(1); - assertEquals("one", e.getObjectValue()); - cache1.remove(1); - e = cache1.get(1); - assertNull(e); - int size = cache1.getSize(); - assertEquals(0, size); - tm.rollback(); - - tm.begin(); - e = cache1.get(1); - assertEquals("one", e.getObjectValue()); - - tm.rollback(); - - LOG.info("******* END"); - } - - public void testRecoveryWhileTransactionsAreLive() throws Exception { - tm.begin(); - - BitronixTransaction transaction = (BitronixTransaction)tm.getTransaction(); - transaction.addTransactionStatusChangeListener(new TransactionStatusChangeListener() { - @Override - public void statusChanged(int oldStatus, int newStatus) { - if (oldStatus == Status.STATUS_PREPARED) { - try { - // - // the BTM recoverer must not run while we mess with the internal BTM structures - // so cancel it and wait until it doesn't run anymore - Recoverer recoverer = TransactionManagerServices.getRecoverer(); - TransactionManagerServices.getTaskScheduler().cancelRecovery(recoverer); - while (recoverer.isRunning()) { - try { Thread.sleep(100); } catch (InterruptedException e) { /* ignore */ } - } - - XAResourceProducer txCache1Producer = ResourceRegistrar.get("txCache1"); - XAResource xaResource1 = txCache1Producer.startRecovery().getXAResource(); - Xid[] recoveredXids1 = xaResource1.recover(XAResource.TMSTARTRSCAN); - txCache1Producer.endRecovery(); - - XAResourceProducer txCache2Producer = ResourceRegistrar.get("txCache2"); - XAResource xaResource2 = txCache2Producer.startRecovery().getXAResource(); - Xid[] recoveredXids2 = xaResource2.recover(XAResource.TMSTARTRSCAN); - txCache1Producer.endRecovery(); - - // recover should not return XIDs of active transactions - assertEquals(0, recoveredXids1.length); - assertEquals(0, recoveredXids2.length); - - // reschedule the BTM recoverer - // - TransactionManagerServices.getTaskScheduler().scheduleRecovery(recoverer, new java.util.Date()); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - } - }); - - cache1.put(new Element(1, "one")); - cache2.put(new Element(1, "one")); - tm.commit(); - } - - public void testPutDuring2PC() throws Exception { - tm.begin(); - - cache1.put(new Element(1, "one")); - // 1PC bypasses 1st phase -> enlist a 2nd resource to prevent it - cache2.put(new Element(1, "one")); - - BitronixTransaction tx = (BitronixTransaction) tm.getTransaction(); - - tx.addTransactionStatusChangeListener(new TransactionStatusChangeListener() { - public void statusChanged(int oldStatus, int newStatus) { - if (oldStatus == Status.STATUS_PREPARED) { - - TxThread t = new TxThread() { - @Override - public void exec() throws Exception { - tm.setTransactionTimeout(1); - tm.begin(); - - try { - cache1.put(new Element(1, "one#2")); - fail("expected TransactionTimeoutException"); - } catch (TransactionTimeoutException e) { - // expected - } - tm.rollback(); - } - }; - t.start(); - t.joinAndAssertNotFailed(); - } - } - }); - - tm.commit(); - } - - public void testGetOldElementFromStore() throws Exception { - Cache txCache = (Cache)cache1; - - CacheStoreHelper cacheStoreHelper = new CacheStoreHelper(txCache); - TxCopyingCacheStore store = (TxCopyingCacheStore)cacheStoreHelper.getStore(); - - Element one = new Element(1, "one"); - tm.begin(); - txCache.put(one); - tm.commit(); - - Element oneUp = new Element(1, "oneUp"); - tm.begin(); - txCache.put(oneUp); - assertEquals(one, store.getOldElement(1)); - tm.commit(); - - assertEquals(oneUp, store.getOldElement(1)); - } - - - - private static class TxThread extends Thread { - private volatile boolean failed; - - @Override - public final void run() { - try { - exec(); - } catch (Throwable t) { - t.printStackTrace(); - failed = true; - } - } - - public void exec() throws Exception { - } - - public void joinAndAssertNotFailed() { - try { - join(); - } catch (InterruptedException e) { - // ignore - } - assertNotFailed(); - } - - public void assertNotFailed() { - if (failed) { - throw new AssertionFailedError("TxThread failed"); - } - } - } -} Index: rctags/ehcache-2.10.9.0.411/ehcache-search-parser/src/main/java/net/sf/ehcache/search/parser/MAttribute.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-search-parser/src/main/java/net/sf/ehcache/search/parser/MAttribute.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-search-parser/src/main/java/net/sf/ehcache/search/parser/MAttribute.java (revision 0) @@ -1,179 +0,0 @@ -/** - * Copyright Terracotta, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, - * either express or implied. See the License for the specific language governing permissions and limitations under the - * License. - */ -package net.sf.ehcache.search.parser; - -import net.sf.ehcache.search.Attribute; -import net.sf.ehcache.search.Query; - -public class MAttribute implements ModelElement> { - - /** - * The name. - */ - private final String name; - - /** - * Is this the key. - */ - private final boolean isKey; - - /** - * Is this the value. - */ - private final boolean isValue; - - private final boolean isStar; - - /** - * The key. - */ - public static MAttribute KEY = new MAttribute("key", true, false, false); - - /** - * The value. - */ - public static MAttribute VALUE = new MAttribute("value", false, true, false); - - /** - * Star for doing count(*) - */ - public static MAttribute STAR = new MAttribute("star", false, false, true); - - /** - * Instantiates a new attribute. - * - * @param name the name - * @param k the k - * @param v the v - */ - private MAttribute(String name, boolean k, boolean v, boolean isStar) { - this.name = name; - isKey = k; - isValue = v; - this.isStar = isStar; - } - - /** - * Instantiates a new named attribute. - * - * @param name the name - */ - public MAttribute(String name) { - this(name, false, false, false); - } - - /** - * Gets the name. - * - * @return the name - */ - public String getName() { - return name; - } - - /** - * Checks if is key. - * - * @return true, if is key - */ - public boolean isKey() { - return isKey; - } - - /** - * Checks if is value. - * - * @return true, if is value - */ - public boolean isValue() { - return isValue; - } - - /** - * Checks if is star. - * - * @return true, if is star - */ - public boolean isStar() { - return isStar; - } - - /** - * As ehcache attribute string. - * - * @return the string - */ - public String asEhcacheAttributeString() { - if (isKey() || isStar()) { - return Query.KEY.getAttributeName(); - } else if (isValue()) { - return Query.VALUE.getAttributeName(); - } else { - return name; - } - } - - /** - * Get this model attribute as an ehcache attribute. - * - * @return the attribute - */ - - @SuppressWarnings("rawtypes") - public Attribute asEhcacheObject(ClassLoader loader) { - if (isKey() || isStar()) { - return Query.KEY; - } else if (isValue()) { - return Query.VALUE; - } else { - return new Attribute(name); - } - } - - /* - * (non-Javadoc) - * @see java.lang.Object#toString() - */ - @Override - public String toString() { - if (isKey()) { - return name; - } else if (isValue()) { - return name; - } else { - return "'" + name + "'"; - } - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + (isKey ? 1231 : 1237); - result = prime * result + (isValue ? 1231 : 1237); - result = prime * result + ((name == null) ? 0 : name.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) return true; - if (obj == null) return false; - if (getClass() != obj.getClass()) return false; - MAttribute other = (MAttribute)obj; - if (isKey != other.isKey) return false; - if (isValue != other.isValue) return false; - if (name == null) { - if (other.name != null) return false; - } else if (!name.equals(other.name)) return false; - return true; - - } - -} Index: rctags/ehcache-2.10.9.0.411/system-tests/src/test/java/org/terracotta/ehcache/tests/servermap/Client5.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/system-tests/src/test/java/org/terracotta/ehcache/tests/servermap/Client5.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/system-tests/src/test/java/org/terracotta/ehcache/tests/servermap/Client5.java (revision 0) @@ -1,27 +0,0 @@ -package org.terracotta.ehcache.tests.servermap; - -import net.sf.ehcache.Cache; -import net.sf.ehcache.Element; - -import org.terracotta.toolkit.Toolkit; - -public class Client5 extends ServerMapClientBase { - - public Client5(String[] args) { - super("test", args); - } - - public static void main(String[] args) { - new Client5(args).run(); - } - - @Override - protected void runTest(final Cache cache, final Toolkit clusteringToolkit) throws Throwable { - BasicServerMapExpressTestHelper.populateCache(cache); - cache.put(new Element("client1-exited", "true")); - - cache.getCacheManager().getCache("defaultStorageStrategyCache"); - - System.out.println("Asserted different/explicit storage strategys"); - } -} Index: rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/hibernate/management/impl/EhcacheHibernate.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/hibernate/management/impl/EhcacheHibernate.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/hibernate/management/impl/EhcacheHibernate.java (revision 0) @@ -1,589 +0,0 @@ -/** - * Copyright Terracotta, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package net.sf.ehcache.hibernate.management.impl; - -import java.util.Map; -import java.util.concurrent.atomic.AtomicBoolean; - -import javax.management.MBeanNotificationInfo; -import javax.management.NotCompliantMBeanException; -import javax.management.Notification; -import javax.management.openmbean.TabularData; - -import net.sf.ehcache.CacheManager; -import net.sf.ehcache.hibernate.management.api.EhcacheHibernateMBean; -import net.sf.ehcache.hibernate.management.api.EhcacheStats; -import net.sf.ehcache.hibernate.management.api.HibernateStats; - -import org.hibernate.SessionFactory; - -/** - * Implementation of the {@link EhcacheHibernateMBean} - * - *

- * - * @author Abhishek Sanoujam - * - */ -public class EhcacheHibernate extends BaseEmitterBean implements EhcacheHibernateMBean { - private static final MBeanNotificationInfo NOTIFICATION_INFO; - - private final AtomicBoolean statsEnabled = new AtomicBoolean(true); - private EhcacheStats ehcacheStats; - private volatile HibernateStats hibernateStats = NullHibernateStats.INSTANCE; - - static { - final String[] notifTypes = new String[] {}; - final String name = Notification.class.getName(); - final String description = "Ehcache Hibernate Statistics Event"; - NOTIFICATION_INFO = new MBeanNotificationInfo(notifTypes, name, description); - } - - /** - * Constructor accepting the backing {@link CacheManager} - * - * @param manager - * the backing {@link CacheManager} - * @throws NotCompliantMBeanException - */ - public EhcacheHibernate(CacheManager manager) throws NotCompliantMBeanException { - super(EhcacheHibernateMBean.class); - ehcacheStats = new EhcacheStatsImpl(manager); - } - - /** - * Enable hibernate statistics with the input session factory - * - */ - public void enableHibernateStatistics(SessionFactory sessionFactory) { - try { - hibernateStats = new HibernateStatsImpl(sessionFactory); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - /** - * {@inheritDoc} - * - */ - public boolean isHibernateStatisticsSupported() { - return hibernateStats instanceof HibernateStatsImpl; - } - - /** - * {@inheritDoc} - */ - public void setStatisticsEnabled(boolean flag) { - if (flag) { - hibernateStats.enableStats(); - } else { - hibernateStats.disableStats(); - } - statsEnabled.set(flag); - sendNotification(HibernateStats.CACHE_STATISTICS_ENABLED, flag); - } - - /** - * {@inheritDoc} - */ - public boolean isStatisticsEnabled() { - return statsEnabled.get(); - } - - /** - * {@inheritDoc} - */ - public void clearStats() { - hibernateStats.clearStats(); - } - - /** - * {@inheritDoc} - */ - public void disableStats() { - setStatisticsEnabled(false); - } - - /** - * {@inheritDoc} - */ - public void enableStats() { - setStatisticsEnabled(true); - } - - /** - * {@inheritDoc} - */ - public void flushRegionCache(String region) { - ehcacheStats.flushRegionCache(region); - sendNotification(HibernateStats.CACHE_REGION_FLUSHED, region); - } - - /** - * {@inheritDoc} - */ - public void flushRegionCaches() { - ehcacheStats.flushRegionCaches(); - sendNotification(HibernateStats.CACHE_FLUSHED); - } - - /** - * {@inheritDoc} - */ - public String generateActiveConfigDeclaration() { - return ehcacheStats.generateActiveConfigDeclaration(); - } - - /** - * {@inheritDoc} - */ - public String generateActiveConfigDeclaration(String region) { - return ehcacheStats.generateActiveConfigDeclaration(region); - } - - /** - * {@inheritDoc} - */ - public long getCacheHitCount() { - return ehcacheStats.getCacheHitCount(); - } - - /** - * {@inheritDoc} - */ - public double getCacheHitRate() { - return ehcacheStats.getCacheHitRate(); - } - - /** - * {@inheritDoc} - */ - public long getCacheHitSample() { - return ehcacheStats.getCacheHitSample(); - } - - /** - * {@inheritDoc} - */ - public long getCacheMissCount() { - return ehcacheStats.getCacheMissCount(); - } - - /** - * {@inheritDoc} - */ - public double getCacheMissRate() { - return ehcacheStats.getCacheMissRate(); - } - - /** - * {@inheritDoc} - */ - public long getCacheMissSample() { - return ehcacheStats.getCacheMissSample(); - } - - /** - * {@inheritDoc} - */ - public long getCachePutCount() { - return ehcacheStats.getCachePutCount(); - } - - /** - * {@inheritDoc} - */ - public double getCachePutRate() { - return ehcacheStats.getCachePutRate(); - } - - /** - * {@inheritDoc} - */ - public long getCachePutSample() { - return ehcacheStats.getCachePutSample(); - } - - /** - * {@inheritDoc} - */ - public TabularData getCacheRegionStats() { - return hibernateStats.getCacheRegionStats(); - } - - /** - * {@inheritDoc} - */ - public long getCloseStatementCount() { - return hibernateStats.getCloseStatementCount(); - } - - /** - * {@inheritDoc} - */ - public TabularData getCollectionStats() { - return hibernateStats.getCollectionStats(); - } - - /** - * {@inheritDoc} - */ - public long getConnectCount() { - return hibernateStats.getConnectCount(); - } - - /** - * {@inheritDoc} - */ - public TabularData getEntityStats() { - return hibernateStats.getEntityStats(); - } - - /** - * {@inheritDoc} - */ - public long getFlushCount() { - return hibernateStats.getFlushCount(); - } - - /** - * {@inheritDoc} - */ - public long getOptimisticFailureCount() { - return hibernateStats.getOptimisticFailureCount(); - } - - /** - * {@inheritDoc} - */ - public String getOriginalConfigDeclaration() { - return ehcacheStats.getOriginalConfigDeclaration(); - } - - /** - * {@inheritDoc} - */ - public String getOriginalConfigDeclaration(String region) { - return ehcacheStats.getOriginalConfigDeclaration(region); - } - - /** - * {@inheritDoc} - */ - public long getPrepareStatementCount() { - return hibernateStats.getPrepareStatementCount(); - } - - /** - * {@inheritDoc} - */ - public long getQueryExecutionCount() { - return hibernateStats.getQueryExecutionCount(); - } - - /** - * {@inheritDoc} - */ - public double getQueryExecutionRate() { - return hibernateStats.getQueryExecutionRate(); - } - - /** - * {@inheritDoc} - */ - public long getQueryExecutionSample() { - return hibernateStats.getQueryExecutionSample(); - } - - /** - * {@inheritDoc} - */ - public TabularData getQueryStats() { - return hibernateStats.getQueryStats(); - } - - /** - * {@inheritDoc} - */ - public Map> getRegionCacheAttributes() { - return ehcacheStats.getRegionCacheAttributes(); - } - - /** - * {@inheritDoc} - */ - public Map getRegionCacheAttributes(String regionName) { - return ehcacheStats.getRegionCacheAttributes(regionName); - } - - /** - * {@inheritDoc} - */ - public int getRegionCacheMaxTTISeconds(String region) { - return ehcacheStats.getRegionCacheMaxTTISeconds(region); - } - - /** - * {@inheritDoc} - */ - public int getRegionCacheMaxTTLSeconds(String region) { - return ehcacheStats.getRegionCacheMaxTTLSeconds(region); - } - - /** - * {@inheritDoc} - */ - public int getRegionCacheOrphanEvictionPeriod(String region) { - return ehcacheStats.getRegionCacheOrphanEvictionPeriod(region); - } - - /** - * {@inheritDoc} - */ - public Map getRegionCacheSamples() { - return ehcacheStats.getRegionCacheSamples(); - } - - /** - * {@inheritDoc} - */ - public int getRegionCacheTargetMaxInMemoryCount(String region) { - return ehcacheStats.getRegionCacheTargetMaxInMemoryCount(region); - } - - /** - * {@inheritDoc} - */ - public int getRegionCacheTargetMaxTotalCount(String region) { - return ehcacheStats.getRegionCacheTargetMaxTotalCount(region); - } - - /** - * {@inheritDoc} - */ - public long getSessionCloseCount() { - return hibernateStats.getSessionCloseCount(); - } - - /** - * {@inheritDoc} - */ - public long getSessionOpenCount() { - return hibernateStats.getSessionOpenCount(); - } - - /** - * {@inheritDoc} - */ - public long getSuccessfulTransactionCount() { - return hibernateStats.getSuccessfulTransactionCount(); - } - - /** - * {@inheritDoc} - */ - public String[] getTerracottaHibernateCacheRegionNames() { - return ehcacheStats.getTerracottaHibernateCacheRegionNames(); - } - - /** - * {@inheritDoc} - */ - public long getTransactionCount() { - return hibernateStats.getTransactionCount(); - } - - /** - * {@inheritDoc} - */ - public boolean isRegionCacheEnabled(String region) { - return ehcacheStats.isRegionCacheEnabled(region); - } - - /** - * {@inheritDoc} - */ - public void setRegionCachesEnabled(boolean enabled) { - ehcacheStats.setRegionCachesEnabled(enabled); - sendNotification(HibernateStats.CACHE_ENABLED, enabled); - } - - /** - * {@inheritDoc} - */ - public void setRegionCacheEnabled(String region, boolean enabled) { - ehcacheStats.setRegionCacheEnabled(region, enabled); - sendNotification(HibernateStats.CACHE_REGION_CHANGED, getRegionCacheAttributes(region), region); - } - - /** - * {@inheritDoc} - */ - public boolean isRegionCacheLoggingEnabled(String region) { - return ehcacheStats.isRegionCacheLoggingEnabled(region); - } - - /** - * {@inheritDoc} - */ - public boolean isRegionCacheOrphanEvictionEnabled(String region) { - return ehcacheStats.isRegionCacheOrphanEvictionEnabled(region); - } - - /** - * {@inheritDoc} - */ - public boolean isRegionCachesEnabled() { - return ehcacheStats.isRegionCachesEnabled(); - } - - /** - * {@inheritDoc} - */ - public boolean isTerracottaHibernateCache(String region) { - return ehcacheStats.isTerracottaHibernateCache(region); - } - - /** - * {@inheritDoc} - */ - public void setRegionCacheLoggingEnabled(String region, boolean loggingEnabled) { - ehcacheStats.setRegionCacheLoggingEnabled(region, loggingEnabled); - sendNotification(HibernateStats.CACHE_REGION_CHANGED, getRegionCacheAttributes(region), region); - } - - /** - * {@inheritDoc} - */ - public void setRegionCacheMaxTTISeconds(String region, int maxTTISeconds) { - ehcacheStats.setRegionCacheMaxTTISeconds(region, maxTTISeconds); - sendNotification(HibernateStats.CACHE_REGION_CHANGED, getRegionCacheAttributes(region), region); - } - - /** - * {@inheritDoc} - */ - public void setRegionCacheMaxTTLSeconds(String region, int maxTTLSeconds) { - ehcacheStats.setRegionCacheMaxTTLSeconds(region, maxTTLSeconds); - sendNotification(HibernateStats.CACHE_REGION_CHANGED, getRegionCacheAttributes(region), region); - } - - /** - * {@inheritDoc} - */ - public void setRegionCacheTargetMaxInMemoryCount(String region, int targetMaxInMemoryCount) { - ehcacheStats.setRegionCacheTargetMaxInMemoryCount(region, targetMaxInMemoryCount); - sendNotification(HibernateStats.CACHE_REGION_CHANGED, getRegionCacheAttributes(region), region); - } - - /** - * {@inheritDoc} - */ - public void setRegionCacheTargetMaxTotalCount(String region, int targetMaxTotalCount) { - ehcacheStats.setRegionCacheTargetMaxTotalCount(region, targetMaxTotalCount); - sendNotification(HibernateStats.CACHE_REGION_CHANGED, getRegionCacheAttributes(region), region); - } - - /** - * {@inheritDoc} - * - * @see net.sf.ehcache.hibernate.management.api.EhcacheStats#getNumberOfElementsInMemory(java.lang.String) - */ - public int getNumberOfElementsInMemory(String region) { - return ehcacheStats.getNumberOfElementsInMemory(region); - } - - /** - * {@inheritDoc} - * - * @see net.sf.ehcache.hibernate.management.api.EhcacheStats#getNumberOfElementsInMemory(java.lang.String) - */ - public int getNumberOfElementsOffHeap(String region) { - return ehcacheStats.getNumberOfElementsOffHeap(region); - } - - /** - * {@inheritDoc} - * - * @see net.sf.ehcache.hibernate.management.api.EhcacheStats#getNumberOfElementsOnDisk(java.lang.String) - */ - public int getNumberOfElementsOnDisk(String region) { - return ehcacheStats.getNumberOfElementsOnDisk(region); - } - - /** - * {@inheritDoc} - * - * @see net.sf.ehcache.hibernate.management.api.EhcacheStats#getMaxGetTimeMillis() - */ - public long getMaxGetTimeMillis() { - return ehcacheStats.getMaxGetTimeMillis(); - } - - /** - * {@inheritDoc} - * - * @see net.sf.ehcache.hibernate.management.api.EhcacheStats#getMaxGetTimeMillis(java.lang.String) - */ - public long getMaxGetTimeMillis(String cacheName) { - return ehcacheStats.getMaxGetTimeMillis(cacheName); - } - - /** - * {@inheritDoc} - * - * @see net.sf.ehcache.hibernate.management.api.EhcacheStats#getMinGetTimeMillis() - */ - public long getMinGetTimeMillis() { - return ehcacheStats.getMinGetTimeMillis(); - } - - /** - * {@inheritDoc} - * - * @see net.sf.ehcache.hibernate.management.api.EhcacheStats#getMinGetTimeMillis(java.lang.String) - */ - public long getMinGetTimeMillis(String cacheName) { - return ehcacheStats.getMinGetTimeMillis(cacheName); - } - - /** - * {@inheritDoc} - * - * @see net.sf.ehcache.hibernate.management.api.EhcacheStats#getAverageGetTimeMillis(java.lang.String) - */ - public float getAverageGetTimeMillis(String region) { - return ehcacheStats.getAverageGetTimeMillis(region); - } - - /** - * {@inheritDoc} - */ - @Override - protected void doDispose() { - // no-op - } - - /** - * @see BaseEmitterBean#getNotificationInfo() - */ - @Override - public MBeanNotificationInfo[] getNotificationInfo() { - return new MBeanNotificationInfo[] {NOTIFICATION_INFO}; - } -} Index: rctags/ehcache-2.10.9.0.411/ehcache-core/src/test/java/net/sf/ehcache/util/MemorySizeParserTest.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-core/src/test/java/net/sf/ehcache/util/MemorySizeParserTest.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-core/src/test/java/net/sf/ehcache/util/MemorySizeParserTest.java (revision 0) @@ -1,63 +0,0 @@ -/** - * Copyright Terracotta, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package net.sf.ehcache.util; - -import org.junit.Assert; -import org.junit.Test; - -import static org.junit.Assert.assertEquals; - -/** - * @author Ludovic Orban - */ -public class MemorySizeParserTest { - - @Test - public void testParse() { - assertEquals(0, MemorySizeParser.parse("0")); - assertEquals(0, MemorySizeParser.parse("")); - assertEquals(0, MemorySizeParser.parse(null)); - assertEquals(10, MemorySizeParser.parse("10")); - assertEquals(4096, MemorySizeParser.parse("4k")); - assertEquals(4096, MemorySizeParser.parse("4K")); - assertEquals(16777216, MemorySizeParser.parse("16m")); - assertEquals(16777216, MemorySizeParser.parse("16M")); - assertEquals(2147483648L, MemorySizeParser.parse("2g")); - assertEquals(2147483648L, MemorySizeParser.parse("2G")); - assertEquals(3298534883328L, MemorySizeParser.parse("3t")); - assertEquals(3298534883328L, MemorySizeParser.parse("3T")); - } - - @Test - public void testParseErrors() { - try { - MemorySizeParser.parse("-1G"); - Assert.fail("expected IllegalArgumentException"); - } catch (IllegalArgumentException e) { - // expected - } - - try { - MemorySizeParser.parse("1000y"); - Assert.fail("expected IllegalArgumentException"); - } catch (IllegalArgumentException e) { - // expected - } - - - } -} Index: rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/search/attribute/DynamicAttributesExtractor.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/search/attribute/DynamicAttributesExtractor.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/search/attribute/DynamicAttributesExtractor.java (revision 0) @@ -1,35 +0,0 @@ -/** - * Copyright Terracotta, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package net.sf.ehcache.search.attribute; - -import java.util.Map; - -import net.sf.ehcache.Ehcache; -import net.sf.ehcache.Element; - -/** - * Dynamic indexing API - * @author vfunshte - */ -public interface DynamicAttributesExtractor { - /** - * Given a particular cache element, returns a map from attribute names, to their respective values to use for indexing. - * This method will be called once for every {@link Ehcache#put(Element)} and {@code Ehcache#replace(Element)} call. - * @param element - * @return - */ - Map attributesFor(Element element); -} Index: rctags/ehcache-2.10.9.0.411/management-ehcache-v2/src/main/java/net/sf/ehcache/management/resource/services/ElementsResourceServiceImplV2.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/management-ehcache-v2/src/main/java/net/sf/ehcache/management/resource/services/ElementsResourceServiceImplV2.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/management-ehcache-v2/src/main/java/net/sf/ehcache/management/resource/services/ElementsResourceServiceImplV2.java (revision 0) @@ -1,61 +0,0 @@ -/* - * All content copyright (c) 2003-2012 Terracotta, Inc., except as may otherwise be noted in a separate copyright - * notice. All rights reserved. - */ - -package net.sf.ehcache.management.resource.services; - -import net.sf.ehcache.management.service.CacheServiceV2; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.terracotta.management.ServiceExecutionException; -import org.terracotta.management.ServiceLocator; -import org.terracotta.management.resource.exceptions.ResourceRuntimeException; -import org.terracotta.management.resource.services.validator.RequestValidator; - -import javax.ws.rs.DELETE; -import javax.ws.rs.Path; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriInfo; - -/** - * A resource service interface for implementations interacting with cache elements. - * - * @author brandony - */ -@Path("/v2/agents/cacheManagers/caches/elements") -public final class ElementsResourceServiceImplV2 { - private static final Logger LOG = LoggerFactory.getLogger(ElementsResourceServiceImplV2.class); - - private final CacheServiceV2 cacheSvc; - - private final RequestValidator validator; - - public ElementsResourceServiceImplV2() { - this.validator = ServiceLocator.locate(RequestValidator.class); - this.cacheSvc = ServiceLocator.locate(CacheServiceV2.class); - } - - /** - * Remove elements from the cache. - * - * @param info - * for this resource request - */ - @DELETE - public void deleteElements(@Context UriInfo info) { - LOG.debug(String.format("Invoking ElementsResourceServiceImpl.deleteElements: %s", info.getRequestUri())); - - validator.validate(info); - String cacheManagerName = info.getPathSegments().get(2).getMatrixParameters().getFirst("names"); - String cacheName = info.getPathSegments().get(3).getMatrixParameters().getFirst("names"); - - try { - cacheSvc.clearCache(cacheManagerName, cacheName); - } catch (ServiceExecutionException e) { - throw new ResourceRuntimeException("Failed to delete element", e, Response.Status.BAD_REQUEST.getStatusCode()); - } - } -} Index: rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/writer/CacheWriterManager.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/writer/CacheWriterManager.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/writer/CacheWriterManager.java (revision 0) @@ -1,65 +0,0 @@ -/** - * Copyright Terracotta, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package net.sf.ehcache.writer; - -import net.sf.ehcache.Cache; -import net.sf.ehcache.CacheEntry; -import net.sf.ehcache.CacheException; -import net.sf.ehcache.Element; - -/** - * A {@code CacheWriterManager} coordinates how element are written to a back-end store. - *

- * The {@code CacheWriterManager} will in its turn call the {@code CacheWriter} that belongs to the relevant cache to perform - * the actual write logic as it's implemented by the user. - * - * @author Geert Bevin - * @version $Id: CacheWriterManager.java 10789 2018-04-26 02:08:13Z adahanne $ - */ -public interface CacheWriterManager { - /** - * Initialize the cache writer manager. - *

- * This method is called when the cache writer manager is registered to a cache. - * - * @param cache the cache with which the writer manager - * @throws CacheException when an exception occurs during the initialisation of the cache - */ - void init(Cache cache) throws CacheException; - - /** - * Schedule a put operation for this element in the CacheWriterManager, which will call the CacheWriter when appropriate. - * - * @param element the element that should be used for the operation - * @throws CacheException when an exception occurs during the writing of the element - */ - void put(Element element) throws CacheException; - - /** - * Schedule a remove operation for this key in the CacheWriterManager, which will call the CacheWriter when appropriate. - * - * @param entry the entry that should be used for the operation - * @throws CacheException when an exception occurs during the removal of the element - */ - void remove(CacheEntry entry) throws CacheException; - - /** - * Cleans up the resources of the cache writer manager. - *

- * This method is called when the manager is unregistered from a cache. - */ - void dispose() throws CacheException; -} Index: rctags/ehcache-2.10.9.0.411/terracotta/bootstrap/.settings/org.eclipse.jdt.core.prefs =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/terracotta/bootstrap/.settings/org.eclipse.jdt.core.prefs (revision 11412) +++ rctags/ehcache-2.10.9.0.411/terracotta/bootstrap/.settings/org.eclipse.jdt.core.prefs (revision 0) @@ -1,347 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.codeComplete.argumentPrefixes= -org.eclipse.jdt.core.codeComplete.argumentSuffixes= -org.eclipse.jdt.core.codeComplete.fieldPrefixes= -org.eclipse.jdt.core.codeComplete.fieldSuffixes= -org.eclipse.jdt.core.codeComplete.localPrefixes= -org.eclipse.jdt.core.codeComplete.localSuffixes= -org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= -org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.6 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning -org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning -org.eclipse.jdt.core.compiler.problem.autoboxing=ignore -org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning -org.eclipse.jdt.core.compiler.problem.deadCode=ignore -org.eclipse.jdt.core.compiler.problem.deprecation=ignore -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled -org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore -org.eclipse.jdt.core.compiler.problem.emptyStatement=warning -org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning -org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning -org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled -org.eclipse.jdt.core.compiler.problem.fatalOptionalWarning=enabled -org.eclipse.jdt.core.compiler.problem.fieldHiding=warning -org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning -org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore -org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore -org.eclipse.jdt.core.compiler.problem.nullReference=warning -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning -org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning -org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore -org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore -org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning -org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore -org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore -org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore -org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled -org.eclipse.jdt.core.compiler.problem.suppressOptionalWarnings=disabled -org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore -org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning -org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning -org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled -org.eclipse.jdt.core.compiler.problem.unusedImport=warning -org.eclipse.jdt.core.compiler.problem.unusedLabel=warning -org.eclipse.jdt.core.compiler.problem.unusedLocal=warning -org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning -org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.6 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=true -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=18 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=18 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=18 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=0 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=18 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=18 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=18 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=18 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines=true -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=true -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=true -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=true -org.eclipse.jdt.core.formatter.comment.format_source_code=true -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert -org.eclipse.jdt.core.formatter.comment.line_length=120 -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true -org.eclipse.jdt.core.formatter.indentation.size=2 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=true -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=true -org.eclipse.jdt.core.formatter.lineSplit=120 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.jdt.core.formatter.tabulation.char=space -org.eclipse.jdt.core.formatter.tabulation.size=2 -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true Index: rctags/ehcache-2.10.9.0.411/system-tests/src/test/resources/compressed-cache-test.xml =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/system-tests/src/test/resources/compressed-cache-test.xml (revision 11412) +++ rctags/ehcache-2.10.9.0.411/system-tests/src/test/resources/compressed-cache-test.xml (revision 0) @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - Index: rctags/ehcache-2.10.9.0.411/management-ehcache-impl/management-ehcache-impl-v1/src/test/java/net/sf/ehcache/management/service/impl/DfltSamplerRepositoryServiceTest.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/management-ehcache-impl/management-ehcache-impl-v1/src/test/java/net/sf/ehcache/management/service/impl/DfltSamplerRepositoryServiceTest.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/management-ehcache-impl/management-ehcache-impl-v1/src/test/java/net/sf/ehcache/management/service/impl/DfltSamplerRepositoryServiceTest.java (revision 0) @@ -1,101 +0,0 @@ -/* - * All content copyright (c) 2003-2012 Terracotta, Inc., except as may otherwise be noted in a separate copyright - * notice. All rights reserved. - */ -package net.sf.ehcache.management.service.impl; - -import net.sf.ehcache.Cache; -import net.sf.ehcache.CacheManager; -import net.sf.ehcache.ClusteredInstanceFactoryAccessor; -import net.sf.ehcache.config.CacheConfiguration; -import net.sf.ehcache.config.Configuration; -import net.sf.ehcache.config.ManagementRESTServiceConfiguration; -import net.sf.ehcache.constructs.blocking.BlockingCache; -import net.sf.ehcache.terracotta.ClusteredInstanceFactory; -import net.sf.ehcache.terracotta.TerracottaClient; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; - -import java.util.Collections; - -import static java.util.Collections.singleton; -import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; -import static org.mockito.Matchers.anyBoolean; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -/** - * @author Ludovic Orban - */ -public class DfltSamplerRepositoryServiceTest { - - private DfltSamplerRepositoryService repositoryService; - private ClusteredInstanceFactory clusteredInstanceFactory; - private CacheManager cacheManager; - - @Before - public void setUp() throws Exception { - ManagementRESTServiceConfiguration managementRESTServiceConfiguration = new ManagementRESTServiceConfiguration(); - managementRESTServiceConfiguration.setEnabled(true); - RemoteAgentEndpointImpl remoteAgentEndpoint = mock(RemoteAgentEndpointImpl.class); - repositoryService = new DfltSamplerRepositoryService(managementRESTServiceConfiguration, remoteAgentEndpoint); - - Configuration configuration = new Configuration(); - configuration.setName("testCacheManager"); - CacheConfiguration cacheConfiguration = new CacheConfiguration("testCache1", 12); - configuration.addCache(cacheConfiguration); - cacheManager = new CacheManager(configuration); - TerracottaClient terracottaClient = mock(TerracottaClient.class); - clusteredInstanceFactory = mock(ClusteredInstanceFactory.class); - - ClusteredInstanceFactoryAccessor.setTerracottaClient(cacheManager, terracottaClient); - when(terracottaClient.getClusteredInstanceFactory()).thenReturn(clusteredInstanceFactory); - - repositoryService.register(cacheManager); - } - - @Test - public void testCreateCacheEntitiesDisablesNonStop() throws Exception { - repositoryService.createCacheEntities(Collections.singleton("testCacheManager"), - Collections.singleton("testCache1"), - Collections.singleton("Size")); - - verify(clusteredInstanceFactory, times(2)).enableNonStopForCurrentThread(anyBoolean()); - } - - @Test - public void testCreateCacheStatisticSampleEntityDisablesNonStop() throws Exception { - repositoryService.createCacheStatisticSampleEntity(Collections.singleton("testCacheManager"), - Collections.singleton("testCache1"), - Collections.singleton("Size")); - - verify(clusteredInstanceFactory, times(2)).enableNonStopForCurrentThread(anyBoolean()); - } - - @Test - public void testClearCacheDisablesNonStop() throws Exception { - repositoryService.clearCache("testCacheManager", "testCache1"); - - verify(clusteredInstanceFactory, times(2)).enableNonStopForCurrentThread(anyBoolean()); - } - - @Test - public void testCanAddDecoratedCache() { - String cacheName = "decoratedTestCache"; - Cache underlyingCache = new Cache(new CacheConfiguration(cacheName, 10)); - cacheManager.addCache(new BlockingCache(underlyingCache)); - - assertThat(repositoryService.createCacheEntities(null, singleton(cacheName), null).isEmpty(), is(false)); - } - - @After - public void tearDown() { - CacheManager.getCacheManager("testCacheManager").shutdown(); - } - -} Index: rctags/ehcache-2.10.9.0.411/ehcache-core/src/test/java/net/sf/ehcache/CacheManagerMockHelper.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-core/src/test/java/net/sf/ehcache/CacheManagerMockHelper.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-core/src/test/java/net/sf/ehcache/CacheManagerMockHelper.java (revision 0) @@ -1,31 +0,0 @@ -/** - * Copyright Terracotta, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package net.sf.ehcache; - -import net.sf.ehcache.terracotta.ClusteredInstanceFactory; -import net.sf.ehcache.terracotta.ClusteredInstanceFactoryWrapper; - -import org.mockito.Mockito; - -public class CacheManagerMockHelper { - - public static void mockGetClusteredInstanceFactory(CacheManager cacheManager, Cache cache) { - ClusteredInstanceFactory clusteredInstanceFactory = Mockito.mock(ClusteredInstanceFactoryWrapper.class); - Mockito.when(cacheManager.getClusteredInstanceFactory()).thenReturn(clusteredInstanceFactory); - } - -} Index: rctags/ehcache-2.10.9.0.411/system-tests/src/test/java/org/terracotta/ehcache/tests/container/BasicJTATestServlet.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/system-tests/src/test/java/org/terracotta/ehcache/tests/container/BasicJTATestServlet.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/system-tests/src/test/java/org/terracotta/ehcache/tests/container/BasicJTATestServlet.java (revision 0) @@ -1,114 +0,0 @@ -/* - * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved. - */ -package org.terracotta.ehcache.tests.container; - -import net.sf.ehcache.Cache; -import net.sf.ehcache.CacheManager; -import net.sf.ehcache.Element; -import net.sf.ehcache.transaction.manager.DefaultTransactionManagerLookup; -import net.sf.ehcache.transaction.manager.TransactionManagerLookup; - -import java.io.IOException; -import java.io.PrintWriter; - -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.transaction.Transaction; -import javax.transaction.TransactionManager; - -public class BasicJTATestServlet extends HttpServlet { - - @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { - resp.setContentType("text/html"); - PrintWriter out = resp.getWriter(); - try { - final TransactionManagerLookup lookup = new DefaultTransactionManagerLookup(); - final TransactionManager txManager = lookup.getTransactionManager(); - if(txManager == null) { - throw new AssertionError("txnManager is null, this test container test requires a txnManager"); - } - System.out.println("txnManager class: " + txManager); - String cmd = req.getParameter("cmd"); - debug("Doing command: " + cmd); - if ("insert".equals(cmd)) { - doInsert(txManager); - } else if ("query".equals(cmd)) { - doQuery(txManager); - } else { - out.println("Unknown command: " + cmd); - return; - } - } catch(Exception e) { - throw new IOException(e); - } - out.println("OK"); - } - - private void doInsert(TransactionManager txnManager) throws IllegalStateException, SecurityException { - CacheManager mgr = CacheManager.getInstance(); - Cache cache = mgr.getCache("test"); - - try { - txnManager.setTransactionTimeout(300); - txnManager.begin(); - - cache.put(new Element("1", "one")); - - Transaction tx1 = txnManager.suspend(); - - txnManager.begin(); - cache.put(new Element("2", "two")); - - txnManager.rollback(); - - txnManager.resume(tx1); - - if (cache.get("2") != null && "two".equals(cache.get("2").getValue())) - cache.put(new Element("1-2", "one-two")); - - txnManager.commit(); - - } catch(Exception e) { - throw new AssertionError(e); - } - } - - private void doQuery(TransactionManager txnManager) { - CacheManager mgr = CacheManager.getInstance(); - Cache cache = mgr.getCache("test"); - //validate - - try { - txnManager.begin(); - - Element elementOne = cache.get("1"); - - if(elementOne == null) { - throw new AssertionError("element one should exist!"); - } - - Element elementTwo = cache.get("2"); - if(elementTwo != null) { - throw new AssertionError("element two shouldn't exist!"); - } - - Element elementOneTwo = cache.get("1-2"); - if(elementOneTwo != null) { - throw new AssertionError("element one-two shouldn't exist!"); - } - - txnManager.commit(); - } catch (Exception e) { - throw new AssertionError(e); - } - } - - private void debug(String string) { - System.out.println(string); - - } - -} Index: rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/hibernate/nonstop/NonstopAwareEntityRegionAccessStrategy.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/hibernate/nonstop/NonstopAwareEntityRegionAccessStrategy.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/hibernate/nonstop/NonstopAwareEntityRegionAccessStrategy.java (revision 0) @@ -1,268 +0,0 @@ -/** - * Copyright Terracotta, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package net.sf.ehcache.hibernate.nonstop; - -import net.sf.ehcache.constructs.nonstop.NonStopCacheException; - -import org.hibernate.cache.CacheException; -import org.hibernate.cache.EntityRegion; -import org.hibernate.cache.access.EntityRegionAccessStrategy; -import org.hibernate.cache.access.SoftLock; - -/** - * Implementation of {@link EntityRegionAccessStrategy} that handles {@link NonStopCacheException} using - * {@link HibernateNonstopCacheExceptionHandler} - * - * @author Abhishek Sanoujam - * - */ -public class NonstopAwareEntityRegionAccessStrategy implements EntityRegionAccessStrategy { - - private final EntityRegionAccessStrategy actualStrategy; - private final HibernateNonstopCacheExceptionHandler hibernateNonstopExceptionHandler; - - /** - * Constructor accepting the actual {@link EntityRegionAccessStrategy} and the {@link HibernateNonstopCacheExceptionHandler} - * - * @param actualStrategy - * @param hibernateNonstopExceptionHandler - */ - public NonstopAwareEntityRegionAccessStrategy(EntityRegionAccessStrategy actualStrategy, - HibernateNonstopCacheExceptionHandler hibernateNonstopExceptionHandler) { - this.actualStrategy = actualStrategy; - this.hibernateNonstopExceptionHandler = hibernateNonstopExceptionHandler; - } - - /** - * {@inheritDoc} - * - * @see org.hibernate.cache.access.EntityRegionAccessStrategy#getRegion() - */ - public EntityRegion getRegion() { - return actualStrategy.getRegion(); - } - - /** - * {@inheritDoc} - * - * @see org.hibernate.cache.access.EntityRegionAccessStrategy#afterInsert(java.lang.Object, java.lang.Object, java.lang.Object) - */ - public boolean afterInsert(Object key, Object value, Object version) throws CacheException { - try { - return actualStrategy.afterInsert(key, value, version); - } catch (NonStopCacheException nonStopCacheException) { - hibernateNonstopExceptionHandler.handleNonstopCacheException(nonStopCacheException); - return false; - } - } - - /** - * {@inheritDoc} - * - * @see org.hibernate.cache.access.EntityRegionAccessStrategy#afterUpdate(java.lang.Object, java.lang.Object, java.lang.Object, - * java.lang.Object, org.hibernate.cache.access.SoftLock) - */ - public boolean afterUpdate(Object key, Object value, Object currentVersion, Object previousVersion, SoftLock lock) - throws CacheException { - try { - return actualStrategy.afterUpdate(key, value, currentVersion, previousVersion, lock); - } catch (NonStopCacheException nonStopCacheException) { - hibernateNonstopExceptionHandler.handleNonstopCacheException(nonStopCacheException); - return false; - } - } - - /** - * {@inheritDoc} - * - * @see org.hibernate.cache.access.EntityRegionAccessStrategy#evict(java.lang.Object) - */ - public void evict(Object key) throws CacheException { - try { - actualStrategy.evict(key); - } catch (NonStopCacheException nonStopCacheException) { - hibernateNonstopExceptionHandler.handleNonstopCacheException(nonStopCacheException); - } - } - - /** - * {@inheritDoc} - * - * @see org.hibernate.cache.access.EntityRegionAccessStrategy#evictAll() - */ - public void evictAll() throws CacheException { - try { - actualStrategy.evictAll(); - } catch (NonStopCacheException nonStopCacheException) { - hibernateNonstopExceptionHandler.handleNonstopCacheException(nonStopCacheException); - } - } - - /** - * {@inheritDoc} - * - * @see org.hibernate.cache.access.EntityRegionAccessStrategy#get(java.lang.Object, long) - */ - public Object get(Object key, long txTimestamp) throws CacheException { - try { - return actualStrategy.get(key, txTimestamp); - } catch (NonStopCacheException nonStopCacheException) { - hibernateNonstopExceptionHandler.handleNonstopCacheException(nonStopCacheException); - return null; - } - } - - /** - * {@inheritDoc} - * - * @see org.hibernate.cache.access.EntityRegionAccessStrategy#insert(java.lang.Object, java.lang.Object, java.lang.Object) - */ - public boolean insert(Object key, Object value, Object version) throws CacheException { - try { - return actualStrategy.insert(key, value, version); - } catch (NonStopCacheException nonStopCacheException) { - hibernateNonstopExceptionHandler.handleNonstopCacheException(nonStopCacheException); - return false; - } - } - - /** - * {@inheritDoc} - * - * @see org.hibernate.cache.access.EntityRegionAccessStrategy#lockItem(java.lang.Object, java.lang.Object) - */ - public SoftLock lockItem(Object key, Object version) throws CacheException { - try { - return actualStrategy.lockItem(key, version); - } catch (NonStopCacheException nonStopCacheException) { - hibernateNonstopExceptionHandler.handleNonstopCacheException(nonStopCacheException); - return null; - } - } - - /** - * {@inheritDoc} - * - * @see org.hibernate.cache.access.EntityRegionAccessStrategy#lockRegion() - */ - public SoftLock lockRegion() throws CacheException { - try { - return actualStrategy.lockRegion(); - } catch (NonStopCacheException nonStopCacheException) { - hibernateNonstopExceptionHandler.handleNonstopCacheException(nonStopCacheException); - return null; - } - } - - /** - * {@inheritDoc} - * - * @see org.hibernate.cache.access.EntityRegionAccessStrategy#putFromLoad(java.lang.Object, java.lang.Object, long, java.lang.Object, - * boolean) - */ - public boolean putFromLoad(Object key, Object value, long txTimestamp, Object version, boolean minimalPutOverride) - throws CacheException { - try { - return actualStrategy.putFromLoad(key, value, txTimestamp, version, minimalPutOverride); - } catch (NonStopCacheException nonStopCacheException) { - hibernateNonstopExceptionHandler.handleNonstopCacheException(nonStopCacheException); - return false; - } - } - - /** - * {@inheritDoc} - * - * @see org.hibernate.cache.access.EntityRegionAccessStrategy#putFromLoad(java.lang.Object, java.lang.Object, long, java.lang.Object) - */ - public boolean putFromLoad(Object key, Object value, long txTimestamp, Object version) throws CacheException { - try { - return actualStrategy.putFromLoad(key, value, txTimestamp, version); - } catch (NonStopCacheException nonStopCacheException) { - hibernateNonstopExceptionHandler.handleNonstopCacheException(nonStopCacheException); - return false; - } - } - - /** - * {@inheritDoc} - * - * @see org.hibernate.cache.access.EntityRegionAccessStrategy#remove(java.lang.Object) - */ - public void remove(Object key) throws CacheException { - try { - actualStrategy.remove(key); - } catch (NonStopCacheException nonStopCacheException) { - hibernateNonstopExceptionHandler.handleNonstopCacheException(nonStopCacheException); - } - } - - /** - * {@inheritDoc} - * - * @see org.hibernate.cache.access.EntityRegionAccessStrategy#removeAll() - */ - public void removeAll() throws CacheException { - try { - actualStrategy.removeAll(); - } catch (NonStopCacheException nonStopCacheException) { - hibernateNonstopExceptionHandler.handleNonstopCacheException(nonStopCacheException); - } - } - - /** - * {@inheritDoc} - * - * @see org.hibernate.cache.access.EntityRegionAccessStrategy#unlockItem(java.lang.Object, org.hibernate.cache.access.SoftLock) - */ - public void unlockItem(Object key, SoftLock lock) throws CacheException { - try { - actualStrategy.unlockItem(key, lock); - } catch (NonStopCacheException nonStopCacheException) { - hibernateNonstopExceptionHandler.handleNonstopCacheException(nonStopCacheException); - } - } - - /** - * {@inheritDoc} - * - * @see org.hibernate.cache.access.EntityRegionAccessStrategy#unlockRegion(org.hibernate.cache.access.SoftLock) - */ - public void unlockRegion(SoftLock lock) throws CacheException { - try { - actualStrategy.unlockRegion(lock); - } catch (NonStopCacheException nonStopCacheException) { - hibernateNonstopExceptionHandler.handleNonstopCacheException(nonStopCacheException); - } - } - - /** - * {@inheritDoc} - * - * @see org.hibernate.cache.access.EntityRegionAccessStrategy#update(java.lang.Object, java.lang.Object, java.lang.Object, - * java.lang.Object) - */ - public boolean update(Object key, Object value, Object currentVersion, Object previousVersion) throws CacheException { - try { - return actualStrategy.update(key, value, currentVersion, previousVersion); - } catch (NonStopCacheException nonStopCacheException) { - hibernateNonstopExceptionHandler.handleNonstopCacheException(nonStopCacheException); - return false; - } - } - -} Index: rctags/ehcache-2.10.9.0.411/terracotta/bootstrap/src/main/java/org/terracotta/modules/ehcache/async/PlatformExceptionUtils.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/terracotta/bootstrap/src/main/java/org/terracotta/modules/ehcache/async/PlatformExceptionUtils.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/terracotta/bootstrap/src/main/java/org/terracotta/modules/ehcache/async/PlatformExceptionUtils.java (revision 0) @@ -1,23 +0,0 @@ -/* - * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved. - */ -package org.terracotta.modules.ehcache.async; - -import org.terracotta.toolkit.rejoin.RejoinException; - -public class PlatformExceptionUtils { - - public static boolean isTCNRE(Throwable th) { - return th.getClass().getName().equals("com.tc.exception.TCNotRunningException"); - } - - public static boolean isRejoinException(Throwable th) { - if (th instanceof RejoinException) return true; - return false; - } - - public static boolean shouldIgnore(Throwable th) { - return isTCNRE(th) || isRejoinException(th); - } - -} Index: rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/hibernate/regions/EhcacheTransactionalDataRegion.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/hibernate/regions/EhcacheTransactionalDataRegion.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/hibernate/regions/EhcacheTransactionalDataRegion.java (revision 0) @@ -1,260 +0,0 @@ -/** - * Copyright Terracotta, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package net.sf.ehcache.hibernate.regions; - -import java.util.Properties; - -import net.sf.ehcache.Ehcache; -import net.sf.ehcache.Element; -import net.sf.ehcache.concurrent.CacheLockProvider; -import net.sf.ehcache.concurrent.LockType; -import net.sf.ehcache.concurrent.StripedReadWriteLockSync; -import net.sf.ehcache.constructs.nonstop.NonStopCacheException; -import net.sf.ehcache.hibernate.nonstop.HibernateNonstopCacheExceptionHandler; -import net.sf.ehcache.hibernate.strategy.EhcacheAccessStrategyFactory; - -import org.hibernate.cache.CacheDataDescription; -import org.hibernate.cache.CacheException; -import org.hibernate.cache.TransactionalDataRegion; -import org.hibernate.cfg.Settings; - -/** - * An Ehcache specific TransactionalDataRegion. - *

- * This is the common superclass entity and collection regions. - * - * @author Chris Dennis - * @author Greg Luck - * @author Emmanuel Bernard - * @author Abhishek Sanoujam - */ -public class EhcacheTransactionalDataRegion extends EhcacheDataRegion implements TransactionalDataRegion { - - private static final int LOCAL_LOCK_PROVIDER_CONCURRENCY = 128; - - /** - * Hibernate settings associated with the persistence unit. - */ - protected final Settings settings; - - /** - * Metadata associated with the objects stored in the region. - */ - protected final CacheDataDescription metadata; - - private final CacheLockProvider lockProvider; - - /** - * Construct an transactional Hibernate cache region around the given Ehcache instance. - */ - EhcacheTransactionalDataRegion(EhcacheAccessStrategyFactory accessStrategyFactory, Ehcache cache, Settings settings, - CacheDataDescription metadata, Properties properties) { - super(accessStrategyFactory, cache, properties); - this.settings = settings; - this.metadata = metadata; - - Object context = cache.getInternalContext(); - if (context instanceof CacheLockProvider) { - this.lockProvider = (CacheLockProvider) context; - } else { - this.lockProvider = new StripedReadWriteLockSync(LOCAL_LOCK_PROVIDER_CONCURRENCY); - } - } - - /** - * Return the hibernate settings - * - * @return settings - */ - public Settings getSettings() { - return settings; - } - - /** - * {@inheritDoc} - */ - public boolean isTransactionAware() { - return false; - } - - /** - * {@inheritDoc} - */ - public CacheDataDescription getCacheDataDescription() { - return metadata; - } - - /** - * Get the value mapped to this key, or null if no value is mapped to this key. - */ - public final Object get(Object key) { - try { - Element element = cache.get(key); - if (element == null) { - return null; - } else { - return element.getObjectValue(); - } - } catch (net.sf.ehcache.CacheException e) { - if (e instanceof NonStopCacheException) { - HibernateNonstopCacheExceptionHandler.getInstance().handleNonstopCacheException((NonStopCacheException) e); - return null; - } else { - throw new CacheException(e); - } - } - } - - /** - * Map the given value to the given key, replacing any existing mapping for this key - * this unpins the key in the cache should it be currently pinned - */ - public final void put(Object key, Object value) throws CacheException { - put(key, value, false); - } - - /** - * Map the given value to the given key, replacing any existing mapping for this key, - * pinning the key in the cache - */ - public final void putEternal(Object key, Object value) throws CacheException { - put(key, value, true); - } - - private void put(Object key, Object value, boolean eternal) throws CacheException { - try { - Element element = new Element(key, value); - element.setEternal(eternal); - cache.put(element); - } catch (IllegalArgumentException e) { - throw new CacheException(e); - } catch (IllegalStateException e) { - throw new CacheException(e); - } catch (net.sf.ehcache.CacheException e) { - if (e instanceof NonStopCacheException) { - HibernateNonstopCacheExceptionHandler.getInstance().handleNonstopCacheException((NonStopCacheException) e); - } else { - throw new CacheException(e); - } - } - } - - /** - * Remove the mapping for this key (if any exists). - */ - public final void remove(Object key) throws CacheException { - try { - cache.remove(key); - } catch (ClassCastException e) { - throw new CacheException(e); - } catch (IllegalStateException e) { - throw new CacheException(e); - } catch (net.sf.ehcache.CacheException e) { - if (e instanceof NonStopCacheException) { - HibernateNonstopCacheExceptionHandler.getInstance().handleNonstopCacheException((NonStopCacheException) e); - } else { - throw new CacheException(e); - } - } - } - - /** - * Remove all mapping from this cache region. - */ - public final void clear() throws CacheException { - try { - cache.removeAll(); - } catch (IllegalStateException e) { - throw new CacheException(e); - } catch (net.sf.ehcache.CacheException e) { - if (e instanceof NonStopCacheException) { - HibernateNonstopCacheExceptionHandler.getInstance().handleNonstopCacheException((NonStopCacheException) e); - } else { - throw new CacheException(e); - } - } - } - - /** - * Attempts to write lock the mapping for the given key. - */ - public final void writeLock(Object key) { - try { - lockProvider.getSyncForKey(key).lock(LockType.WRITE); - } catch (net.sf.ehcache.CacheException e) { - if (e instanceof NonStopCacheException) { - HibernateNonstopCacheExceptionHandler.getInstance().handleNonstopCacheException((NonStopCacheException) e); - } else { - throw new CacheException(e); - } - } - } - - /** - * Attempts to write unlock the mapping for the given key. - */ - public final void writeUnlock(Object key) { - try { - lockProvider.getSyncForKey(key).unlock(LockType.WRITE); - } catch (net.sf.ehcache.CacheException e) { - if (e instanceof NonStopCacheException) { - HibernateNonstopCacheExceptionHandler.getInstance().handleNonstopCacheException((NonStopCacheException) e); - } else { - throw new CacheException(e); - } - } - } - - /** - * Attempts to read lock the mapping for the given key. - */ - public final void readLock(Object key) { - try { - lockProvider.getSyncForKey(key).lock(LockType.READ); - } catch (net.sf.ehcache.CacheException e) { - if (e instanceof NonStopCacheException) { - HibernateNonstopCacheExceptionHandler.getInstance().handleNonstopCacheException((NonStopCacheException) e); - } else { - throw new CacheException(e); - } - } - } - - /** - * Attempts to read unlock the mapping for the given key. - */ - public final void readUnlock(Object key) { - try { - lockProvider.getSyncForKey(key).unlock(LockType.READ); - } catch (net.sf.ehcache.CacheException e) { - if (e instanceof NonStopCacheException) { - HibernateNonstopCacheExceptionHandler.getInstance().handleNonstopCacheException((NonStopCacheException) e); - } else { - throw new CacheException(e); - } - } - } - - /** - * Returns true if the locks used by the locking methods of this region are the independent of the cache. - *

- * Independent locks are not locked by the cache when the cache is accessed directly. This means that for an independent lock - * lock holds taken through a region method will not block direct access to the cache via other means. - */ - public final boolean locksAreIndependentOfCache() { - return lockProvider instanceof StripedReadWriteLockSync; - } -} Index: rctags/ehcache-2.10.9.0.411/ehcache-core/src/test/java/net/sf/ehcache/util/TimestamperTest.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-core/src/test/java/net/sf/ehcache/util/TimestamperTest.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-core/src/test/java/net/sf/ehcache/util/TimestamperTest.java (revision 0) @@ -1,126 +0,0 @@ -package net.sf.ehcache.util; - -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentMap; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicLong; -import java.util.logging.ConsoleHandler; -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - -import static org.hamcrest.core.Is.is; -import static org.hamcrest.number.OrderingComparison.lessThan; -import static org.junit.Assert.assertThat; - -/** - * @author Alex Snaps - */ -public class TimestamperTest { - - public static final int TOTAL_RUNS = 750000; - - private static final Logger slewClockLogger = Logger.getLogger(SlewClock.class.getName()); - private static final ConsoleHandler slewClockHandler = new ConsoleHandler(); - - @BeforeClass - public static void enableSlewClockDebugLogging() { - slewClockHandler.setLevel(Level.ALL); - slewClockLogger.setLevel(Level.ALL); - slewClockLogger.addHandler(slewClockHandler); - } - - @AfterClass - public static void disableSlewClockDebugLogging() { - slewClockLogger.setLevel(Level.INFO); - slewClockLogger.removeHandler(slewClockHandler); - } - - @Test - public void testCorrectness() throws Exception { - final int THREADS = 8; - final ConcurrentMap values = new ConcurrentHashMap(); - final AtomicLong errors = new AtomicLong(); - - Thread[] threads = new Thread[THREADS]; - for(int i =0; i < THREADS; i++) { - threads[i] = new Thread() { - - @Override - public void run() { - for (int i = 0; i < (TOTAL_RUNS / THREADS); i++) { - if(values.putIfAbsent(Timestamper.next(), 0) != null) { - errors.incrementAndGet(); - } - } - } - }; - } - for (Thread thread : threads) { - thread.start(); - } - for (Thread thread : threads) { - thread.join(); - } - assertThat(errors.get(), is(0L)); - } - - @Test - public void testLatency() throws Exception { - final int THREADS = Runtime.getRuntime().availableProcessors(); - final AtomicBoolean stopped = new AtomicBoolean(false); - final long[] maxima = new long[THREADS]; - final long[] maximaTimestamps = new long[THREADS]; - final int[] loops = new int[THREADS]; - Thread[] threads = new Thread[THREADS]; - for(int i =0; i < THREADS; i++) { - final int index = i; - threads[index] = new Thread() { - - @Override - public void run() { - long max = -1; - long maxTimestamp = -1; - int runs; - for (runs = 0; !stopped.get() && runs < (TOTAL_RUNS / THREADS); runs++) { - long start = System.nanoTime(); - Timestamper.next(); - long duration = System.nanoTime() - start; - if (duration > max) { - max = duration; - maxTimestamp = System.currentTimeMillis(); - } - /* - * Schedulers are dumb - make sure everyone gets a fair share of cpu. - */ - Thread.yield(); - } - stopped.set(true); - maxima[index] = max; - maximaTimestamps[index] = maxTimestamp; - loops[index] = runs; - } - }; - } - final long timestampOrigin = System.currentTimeMillis(); - for (Thread thread : threads) { - thread.start(); - } - for (Thread thread : threads) { - thread.join(); - } - - for (int i = 0; i < THREADS; i++) { - System.out.println(threads[i] + " " + loops[i] + " runs, maximum latency " + TimeUnit.NANOSECONDS.toMillis(maxima[i]) + "ms [@ " + (maximaTimestamps[i] - timestampOrigin) + "ms]"); - } - - for (int i = 0; i < THREADS; i++) { - Assert.assertThat(maxima[i], lessThan(TimeUnit.MILLISECONDS.toNanos(200))); - } - } -} Index: rctags/ehcache-2.10.9.0.411/system-tests/src/test/resources/eventual-cache-explicit-locking-test.xml =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/system-tests/src/test/resources/eventual-cache-explicit-locking-test.xml (revision 11412) +++ rctags/ehcache-2.10.9.0.411/system-tests/src/test/resources/eventual-cache-explicit-locking-test.xml (revision 0) @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file Index: rctags/ehcache-2.10.9.0.411/ehcache-core/src/test/java/net/sf/ehcache/pool/SizeOfEngineLoaderTest.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-core/src/test/java/net/sf/ehcache/pool/SizeOfEngineLoaderTest.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-core/src/test/java/net/sf/ehcache/pool/SizeOfEngineLoaderTest.java (revision 0) @@ -1,91 +0,0 @@ -package net.sf.ehcache.pool; - -import net.sf.ehcache.pool.impl.ConstantSizeOfEngine; -import net.sf.ehcache.pool.impl.DefaultSizeOfEngine; -import org.junit.Test; - -import java.io.IOException; -import java.net.URL; -import java.security.SecureClassLoader; -import java.util.Enumeration; - -import static org.hamcrest.CoreMatchers.instanceOf; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.notNullValue; -import static org.hamcrest.CoreMatchers.sameInstance; -import static org.junit.Assert.assertThat; - -/** - * @author Alex Snaps - */ -public class SizeOfEngineLoaderTest { - - private static SizeOfEngine constantSizeOfEngine = new ConstantSizeOfEngine(); - - @Test - public void testFallsBackToDefaultSizeOfEngine() { - final SizeOfEngine sizeOfEngine = SizeOfEngineLoader.INSTANCE.createSizeOfEngine(10, true, true); - assertThat(sizeOfEngine, notNullValue()); - assertThat(sizeOfEngine, instanceOf(DefaultSizeOfEngine.class)); - } - - @Test - public void testUsesServiceLoaderWhenItCan() { - ClassLoader cl = new CheatingClassLoader(); - SizeOfEngineLoader loader = new SizeOfEngineLoader(cl); - assertThat(loader.createSizeOfEngine(10, true, true), sameInstance(constantSizeOfEngine)); - } - - @Test - public void testLoadsSpecificType() { - SizeOfEngineLoader loader = new SizeOfEngineLoader(new CheatingClassLoader()); - assertThat(loader.load(MyRealFactory.class, false), is(true)); - assertThat(loader.createSizeOfEngine(10, true, true), sameInstance(constantSizeOfEngine)); - } - - @Test - public void testLoadsMatchingSuperType() { - SizeOfEngineLoader loader = new SizeOfEngineLoader(new CheatingClassLoader()); - assertThat(loader.load(MyFactory.class, false), is(true)); - assertThat(loader.createSizeOfEngine(10, true, true), sameInstance(constantSizeOfEngine)); - } - - @Test - public void testFalseBackToDefaultWhenNotMatchLoaded() { - SizeOfEngineLoader loader = new SizeOfEngineLoader(new CheatingClassLoader()); - assertThat(loader.load(NoFactory.class, true), is(false)); - assertThat(loader.createSizeOfEngine(10, true, true), instanceOf(DefaultSizeOfEngine.class)); - } - - public static interface MyFactory extends SizeOfEngineFactory { - - } - - public static final class MyRealFactory implements MyFactory { - - @Override - public SizeOfEngine createSizeOfEngine(final int maxObjectCount, final boolean abort, final boolean silent) { - return constantSizeOfEngine; - } - } - - public static interface NoFactory extends SizeOfEngineFactory { - - } - - private static class CheatingClassLoader extends SecureClassLoader { - - public CheatingClassLoader() { - super(SizeOfEngineLoader.class.getClassLoader()); - } - - @Override - public Enumeration getResources(final String name) throws IOException { - final String className = SizeOfEngineFactory.class.getName(); - if (name.equals("META-INF/services/" + className)) { - return super.getResources("services/" + className + ".txt"); - } - return super.getResources(name); - } - } -} Index: rctags/ehcache-2.10.9.0.411/system-tests/src/test/java/org/terracotta/ehcache/tests/BasicStandaloneCacheAndServerTopologyTest.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/system-tests/src/test/java/org/terracotta/ehcache/tests/BasicStandaloneCacheAndServerTopologyTest.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/system-tests/src/test/java/org/terracotta/ehcache/tests/BasicStandaloneCacheAndServerTopologyTest.java (revision 0) @@ -1,28 +0,0 @@ -/* - * All content copyright (c) 2003-2008 Terracotta, Inc., except as may otherwise be noted in a separate copyright - * notice. All rights reserved. - */ -package org.terracotta.ehcache.tests; - -import com.tc.test.config.model.TestConfig; - -public class BasicStandaloneCacheAndServerTopologyTest extends AbstractCacheTestBase { - - int dsoPort; - - public BasicStandaloneCacheAndServerTopologyTest(TestConfig testConfig) { - super("basic-cache-test-different-server-topology.xml", testConfig); - testConfig.getClientConfig().setParallelClients(false); - } - - @Override - protected void startClients() throws Throwable { - getTestConfig().getClientConfig().addExtraClientJvmArg("-Dmy.tc.server.topology=127.0.0.1:" - + getGroupData(0).getTsaPort(0)); - getTestConfig().getClientConfig().addExtraClientJvmArg("-Dtc.server.topology=127.0.0.1:" - + getGroupData(0).getTsaPort(0)); - - runClient(Client3.class); - runClient(Client4.class); - } -} Index: rctags/ehcache-2.10.9.0.411/ehcache-core/src/test/java/com/terracotta/ehcache/special/annotation/IgnoreSizeOffff.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-core/src/test/java/com/terracotta/ehcache/special/annotation/IgnoreSizeOffff.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-core/src/test/java/com/terracotta/ehcache/special/annotation/IgnoreSizeOffff.java (revision 0) @@ -1,28 +0,0 @@ -/** - * Copyright Terracotta, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.terracotta.ehcache.special.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.FIELD, ElementType.TYPE, ElementType.PACKAGE }) -public @interface IgnoreSizeOffff { - -} Index: rctags/ehcache-2.10.9.0.411/distribution/events/src/assemble/bin/start-db.sh =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/distribution/events/src/assemble/bin/start-db.sh (revision 11412) +++ rctags/ehcache-2.10.9.0.411/distribution/events/src/assemble/bin/start-db.sh (revision 0) @@ -1,22 +0,0 @@ -#!/bin/bash - -cygwin=false -if [ `uname | grep CYGWIN` ]; then - cygwin=true -fi - -if [ "$JAVA_HOME" = "" ]; then - echo "JAVA_HOME is not defined" - exit 1 -fi - -unset CDPATH -root=`dirname $0`/.. -root=`cd $root && pwd` -h2_jar=$root/src/main/webapp/WEB-INF/lib/h2-1.1.116.jar - -if $cygwin; then - h2_jar=`cygpath -w -p $h2_jar` -fi - -$JAVA_HOME/bin/java -cp $h2_jar org.h2.tools.Server -tcp -tcpAllowOthers& Index: rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/config/CacheConfigError.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/config/CacheConfigError.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/config/CacheConfigError.java (revision 0) @@ -1,48 +0,0 @@ -/** - * Copyright Terracotta, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package net.sf.ehcache.config; - -/** - * Represents a config error in a cache configuration - * @author Alex Snaps - */ -public class CacheConfigError extends ConfigError { - private final String cacheName; - - /** - * Constructor - * @param error the error message - * @param cacheName the cache name for which this error occured - */ - public CacheConfigError(final String error, final String cacheName) { - super(error); - this.cacheName = cacheName; - } - - /** - * Returns the cache name - * @return cache name - */ - public String getCacheName() { - return cacheName; - } - - @Override - public String toString() { - return "Cache '" + cacheName + "' error: " + getError(); - } -} Index: rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/transaction/xa/commands/AbstractStoreCommand.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/transaction/xa/commands/AbstractStoreCommand.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/transaction/xa/commands/AbstractStoreCommand.java (revision 0) @@ -1,121 +0,0 @@ -/** - * Copyright Terracotta, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package net.sf.ehcache.transaction.xa.commands; - -import net.sf.ehcache.Element; -import net.sf.ehcache.store.ElementValueComparator; -import net.sf.ehcache.store.Store; -import net.sf.ehcache.transaction.SoftLock; -import net.sf.ehcache.transaction.SoftLockManager; -import net.sf.ehcache.transaction.SoftLockID; -import net.sf.ehcache.transaction.xa.OptimisticLockFailureException; -import net.sf.ehcache.transaction.xa.XidTransactionID; - -/** - * @author Ludovic Orban - */ -public abstract class AbstractStoreCommand implements Command { - - private final Element oldElement; - private final Element newElement; - - private Element softLockedElement; - - /** - * Create a Store Command - * @param oldElement the element in the underlying store at the time this command is created - * @param newElement the new element to put in the underlying store - */ - public AbstractStoreCommand(final Element oldElement, final Element newElement) { - this.newElement = newElement; - this.oldElement = oldElement; - } - - /** - * Get the element in the underlying store at the time this command is created - * @return the old element - */ - protected Element getOldElement() { - return oldElement; - } - - /** - * Get the new element to put in the underlying store - * @return the new element to put in the underlying store - */ - protected Element getNewElement() { - return newElement; - } - - /** - * {@inheritDoc} - */ - public boolean prepare(Store store, SoftLockManager softLockManager, XidTransactionID transactionId, - ElementValueComparator comparator) { - Object objectKey = getObjectKey(); - - SoftLockID softLockId = softLockManager.createSoftLockID(transactionId, objectKey, newElement, oldElement); - SoftLock softLock = softLockManager.findSoftLockById(softLockId); - softLockedElement = createElement(objectKey, softLockId, store, false); - softLock.lock(); - softLock.freeze(); - - if (oldElement == null) { - Element previousElement = store.putIfAbsent(softLockedElement); - if (previousElement != null) { - softLock.unfreeze(); - softLock.unlock(); - softLockedElement = null; - throw new OptimisticLockFailureException(); - } - } else { - boolean replaced = store.replace(oldElement, softLockedElement, comparator); - if (!replaced) { - softLock.unfreeze(); - softLock.unlock(); - softLockedElement = null; - throw new OptimisticLockFailureException(); - } - } - - return true; - } - - /** - * {@inheritDoc} - */ - public void rollback(Store store, SoftLockManager softLockManager) { - if (oldElement == null) { - store.remove(getObjectKey()); - } else { - store.put(oldElement); - } - - SoftLockID softLockId = (SoftLockID) softLockedElement.getObjectValue(); - SoftLock softLock = softLockManager.findSoftLockById(softLockId); - - softLock.unfreeze(); - softLock.unlock(); - softLockedElement = null; - } - - private Element createElement(Object key, SoftLockID softLockId, Store store, boolean wasPinned) { - Element element = new Element(key, softLockId); - element.setEternal(true); - return element; - } - -} Index: rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/pool/sizeof/filter/AnnotationProxyFactory.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/pool/sizeof/filter/AnnotationProxyFactory.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/pool/sizeof/filter/AnnotationProxyFactory.java (revision 0) @@ -1,114 +0,0 @@ -/** - * Copyright Terracotta, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package net.sf.ehcache.pool.sizeof.filter; - -import java.lang.annotation.Annotation; -import java.lang.reflect.InvocationHandler; -import java.lang.reflect.Method; -import java.lang.reflect.Proxy; - -/** - *

- * Allows you to transform the type of your custom annotation to a reference annotation type.
- * It can come handy when you want to allow the consumers of your library not to depend on your API because of the annotations, still allowing them to use the original annotation methods. - *

- * Example : - *

- * getting a custom annotation from a class
- * {@code my.Annotation customAnnotation = klazz.getAnnotation(my.Annotation.class);}
- * if this annotation is "similar" (duck-typing, same methods) to the reference one, I can get a proxy to it, whose type is the reference annotation
- * {@code ehcache.Annotation annotation = AnnotationProxyFactory.getAnnotationProxy(customAnnotation, ehcache.Annotation.class);} - *

- * so my library can apply the behavior when the default annotation is used
- * {@code @ehcache.Annotation(action="true") - * public class UserClass {}} - *

- * or when a custom one is used, since all calls to action() will be caught and redirected to the custom annotation action method, if it exists, - * or fall back to the reference action method
- * {@code @my.Annotation(action="true") - * public class UserClass {}} - * - * - * @author Anthony Dahanne - * - */ -public final class AnnotationProxyFactory { - - - private AnnotationProxyFactory() { - //not to instantiate - } - - /** - * Returns a proxy on the customAnnotation, having the same type than the referenceAnnotation - * - * @param customAnnotation - * @param referenceAnnotation - * @return proxied customAnnotation with the type of referenceAnnotation - */ - public static T getAnnotationProxy(Annotation customAnnotation, Class referenceAnnotation) { - InvocationHandler handler = new AnnotationInvocationHandler(customAnnotation); - return (T) Proxy.newProxyInstance(referenceAnnotation.getClassLoader(), new Class[] {referenceAnnotation}, handler); - } - - /** - * - * Invocation handler implementing an invoke method that redirects every method call to the custom annotation method - * when possible; if not returns the reference annotation method default value - * - */ - private static class AnnotationInvocationHandler implements InvocationHandler { - - private final Annotation customAnnotation; - - public AnnotationInvocationHandler(Annotation customAnnotation) { - this.customAnnotation = customAnnotation; - } - - public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable { - //trying to call the method on the custom annotation, if it exists - Method methodOnCustom = getMatchingMethodOnGivenAnnotation(method); - if (methodOnCustom != null) { - return methodOnCustom.invoke(customAnnotation, args); - } else { - //otherwise getting the default value of the reference annotation method - Object defaultValue = method.getDefaultValue(); - if (defaultValue != null) { - return defaultValue; - } - throw new UnsupportedOperationException( - "The method \"" - + method.getName() - + "\" does not exist in the custom annotation, and there is no default value for" - + " it in the reference annotation, please implement this method in your custom annotation."); - } - } - - private Method getMatchingMethodOnGivenAnnotation(Method method) { - try { - Method customMethod = customAnnotation.getClass().getDeclaredMethod(method.getName(), method.getParameterTypes()); - if (customMethod.getReturnType().isAssignableFrom(method.getReturnType())) { - return customMethod; - } - return null; - } catch (NoSuchMethodException e) { - return null; - } - } - } - -} Index: rctags/ehcache-2.10.9.0.411/system-tests/src/test/java/org/terracotta/ehcache/tests/servermap/ServerMapL1CapacityEvictionExpressTest.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/system-tests/src/test/java/org/terracotta/ehcache/tests/servermap/ServerMapL1CapacityEvictionExpressTest.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/system-tests/src/test/java/org/terracotta/ehcache/tests/servermap/ServerMapL1CapacityEvictionExpressTest.java (revision 0) @@ -1,31 +0,0 @@ -/* - * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved. - */ -package org.terracotta.ehcache.tests.servermap; - -import org.terracotta.ehcache.tests.AbstractCacheTestBase; - -import com.tc.test.config.model.TestConfig; - -import java.util.Iterator; - -public class ServerMapL1CapacityEvictionExpressTest extends AbstractCacheTestBase { - - public ServerMapL1CapacityEvictionExpressTest(TestConfig testConfig) { - super("/servermap/servermap-l1-capacity-test.xml", testConfig, ServerMapL1CapacityEvictionExpressTestClient.class); - - testConfig.getClientConfig().addExtraClientJvmArg("-Dcom.tc.l1.lockmanager.timeout.interval=600000"); - testConfig.getClientConfig().addExtraClientJvmArg("-Dcom.tc.ehcache.evictor.logging.enabled=true"); - final Iterator iter = testConfig.getClientConfig().getExtraClientJvmArgs().iterator(); - while (iter.hasNext()) { - final String prop = iter.next(); - if (prop.contains("ehcache.storageStrategy.dcv2.localcache.enabled")) { - // remove it and always enable localcache for this test - iter.remove(); - } - } - // always enable local cache - testConfig.getClientConfig().addExtraClientJvmArg("-Dcom.tc.ehcache.storageStrategy.dcv2.localcache.enabled=true"); - } - -} Index: rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/distribution/RMICacheReplicatorFactory.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/distribution/RMICacheReplicatorFactory.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/distribution/RMICacheReplicatorFactory.java (revision 0) @@ -1,268 +0,0 @@ -/** - * Copyright Terracotta, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package net.sf.ehcache.distribution; - -import net.sf.ehcache.event.CacheEventListener; -import net.sf.ehcache.event.CacheEventListenerFactory; -import net.sf.ehcache.util.PropertyUtil; - -import java.util.Properties; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - - -/** - * Creates an RMICacheReplicator using properties. Config lines look like: - *

<cacheEventListenerFactory class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"
- * properties="
- * replicateAsynchronously=true,
- * replicatePuts=true
- * replicateUpdates=true
- * replicateUpdatesViaCopy=true
- * replicateRemovals=true
- * "/>
- * - * @author Greg Luck - * @version $Id: RMICacheReplicatorFactory.java 10789 2018-04-26 02:08:13Z adahanne $ - */ -public class RMICacheReplicatorFactory extends CacheEventListenerFactory { - - /** - * A default for the amount of time the replication thread sleeps after it detects the replicationQueue is empty - * before checking again. - */ - protected static final int DEFAULT_ASYNCHRONOUS_REPLICATION_INTERVAL_MILLIS = 1000; - - /** - * A default for the maximum number of operations in an RMI message. - */ - protected static final int DEFAULT_ASYNCHRONOUS_REPLICATION_MAXIMUM_BATCH_SIZE = 1000; - - private static final Logger LOG = LoggerFactory.getLogger(RMICacheReplicatorFactory.class.getName()); - private static final String REPLICATE_PUTS = "replicatePuts"; - private static final String REPLICATE_PUTS_VIA_COPY = "replicatePutsViaCopy"; - private static final String REPLICATE_UPDATES = "replicateUpdates"; - private static final String REPLICATE_UPDATES_VIA_COPY = "replicateUpdatesViaCopy"; - private static final String REPLICATE_REMOVALS = "replicateRemovals"; - private static final String REPLICATE_ASYNCHRONOUSLY = "replicateAsynchronously"; - private static final String ASYNCHRONOUS_REPLICATION_INTERVAL_MILLIS = "asynchronousReplicationIntervalMillis"; - private static final String ASYNCHRONOUS_REPLICATION_MAXIMUM_BATCH_SIZE = "asynchronousReplicationMaximumBatchSize"; - private static final int MINIMUM_REASONABLE_INTERVAL = 10; - - /** - * Create a CacheEventListener which is also a CacheReplicator. - *

- * The defaults if properties are not specified are: - *

    - *
  • replicatePuts=true - *
  • replicatePutsViaCopy=true - *
  • replicateUpdates=true - *
  • replicateUpdatesViaCopy=true - *
  • replicateRemovals=true; - *
  • replicateAsynchronously=true - *
  • asynchronousReplicationIntervalMillis=1000 - *
- * - * @param properties implementation specific properties. These are configured as comma - * separated name value pairs in ehcache.xml e.g. - *

- * - * <cacheEventListenerFactory class="net.sf.ehcache.distribution.RMICacheReplicatorFactory" - * properties=" - * replicateAsynchronously=true, - * replicatePuts=true - * replicateUpdates=true - * replicateUpdatesViaCopy=true - * replicateRemovals=true - * asynchronousReplicationIntervalMillis=1000 - * "/> - * @return a constructed CacheEventListener - */ - public final CacheEventListener createCacheEventListener(Properties properties) { - boolean replicatePuts = extractReplicatePuts(properties); - boolean replicatePutsViaCopy = extractReplicatePutsViaCopy(properties); - boolean replicateUpdates = extractReplicateUpdates(properties); - boolean replicateUpdatesViaCopy = extractReplicateUpdatesViaCopy(properties); - boolean replicateRemovals = extractReplicateRemovals(properties); - boolean replicateAsynchronously = extractReplicateAsynchronously(properties); - int replicationIntervalMillis = extractReplicationIntervalMilis(properties); - int maximumBatchSize = extractMaximumBatchSize(properties); - - if (replicateAsynchronously) { - return new RMIAsynchronousCacheReplicator( - replicatePuts, - replicatePutsViaCopy, - replicateUpdates, - replicateUpdatesViaCopy, - replicateRemovals, - replicationIntervalMillis, - maximumBatchSize); - } else { - return new RMISynchronousCacheReplicator( - replicatePuts, - replicatePutsViaCopy, - replicateUpdates, - replicateUpdatesViaCopy, - replicateRemovals); - } - } - - /** - * Extracts the value of asynchronousReplicationIntervalMillis. Sets it to 1000ms if - * either not set or there is a problem parsing the number - * @param properties - */ - protected int extractReplicationIntervalMilis(Properties properties) { - int asynchronousReplicationIntervalMillis; - String asynchronousReplicationIntervalMillisString = - PropertyUtil.extractAndLogProperty(ASYNCHRONOUS_REPLICATION_INTERVAL_MILLIS, properties); - if (asynchronousReplicationIntervalMillisString != null) { - try { - int asynchronousReplicationIntervalMillisCandidate = - Integer.parseInt(asynchronousReplicationIntervalMillisString); - if (asynchronousReplicationIntervalMillisCandidate < MINIMUM_REASONABLE_INTERVAL) { - LOG.debug("Trying to set the asynchronousReplicationIntervalMillis to an unreasonable number." + - " Using the default instead."); - asynchronousReplicationIntervalMillis = DEFAULT_ASYNCHRONOUS_REPLICATION_INTERVAL_MILLIS; - } else { - asynchronousReplicationIntervalMillis = asynchronousReplicationIntervalMillisCandidate; - } - } catch (NumberFormatException e) { - LOG.warn("Number format exception trying to set asynchronousReplicationIntervalMillis. " + - "Using the default instead. String value was: '" + asynchronousReplicationIntervalMillisString + "'"); - asynchronousReplicationIntervalMillis = DEFAULT_ASYNCHRONOUS_REPLICATION_INTERVAL_MILLIS; - } - } else { - asynchronousReplicationIntervalMillis = DEFAULT_ASYNCHRONOUS_REPLICATION_INTERVAL_MILLIS; - } - return asynchronousReplicationIntervalMillis; - } - - /** - * Extracts the value of maximumBatchSize. Sets it to 1024 if - * either not set or there is a problem parsing the number - * @param properties - */ - protected int extractMaximumBatchSize(Properties properties) { - String maximumBatchSizeString = - PropertyUtil.extractAndLogProperty(ASYNCHRONOUS_REPLICATION_MAXIMUM_BATCH_SIZE, properties); - if (maximumBatchSizeString == null) { - return DEFAULT_ASYNCHRONOUS_REPLICATION_MAXIMUM_BATCH_SIZE; - } else { - try { - return Integer.parseInt(maximumBatchSizeString); - } catch (NumberFormatException e) { - LOG.warn("Number format exception trying to set maximumBatchSize. " + - "Using the default instead. String value was: '" + maximumBatchSizeString + "'"); - return DEFAULT_ASYNCHRONOUS_REPLICATION_MAXIMUM_BATCH_SIZE; - } - } - } - - /** - * Extracts the value of replicateAsynchronously from the properties - * @param properties - */ - protected boolean extractReplicateAsynchronously(Properties properties) { - boolean replicateAsynchronously; - String replicateAsynchronouslyString = PropertyUtil.extractAndLogProperty(REPLICATE_ASYNCHRONOUSLY, properties); - if (replicateAsynchronouslyString != null) { - replicateAsynchronously = PropertyUtil.parseBoolean(replicateAsynchronouslyString); - } else { - replicateAsynchronously = true; - } - return replicateAsynchronously; - } - - /** - * Extracts the value of replicateRemovals from the properties - * @param properties - */ - protected boolean extractReplicateRemovals(Properties properties) { - boolean replicateRemovals; - String replicateRemovalsString = PropertyUtil.extractAndLogProperty(REPLICATE_REMOVALS, properties); - if (replicateRemovalsString != null) { - replicateRemovals = PropertyUtil.parseBoolean(replicateRemovalsString); - } else { - replicateRemovals = true; - } - return replicateRemovals; - } - - /** - * Extracts the value of replicateUpdatesViaCopy from the properties - * @param properties - */ - protected boolean extractReplicateUpdatesViaCopy(Properties properties) { - boolean replicateUpdatesViaCopy; - String replicateUpdatesViaCopyString = PropertyUtil.extractAndLogProperty(REPLICATE_UPDATES_VIA_COPY, properties); - if (replicateUpdatesViaCopyString != null) { - replicateUpdatesViaCopy = PropertyUtil.parseBoolean(replicateUpdatesViaCopyString); - } else { - replicateUpdatesViaCopy = true; - } - return replicateUpdatesViaCopy; - } - - /** - * Extracts the value of replicatePutsViaCopy from the properties - * @param properties - */ - protected boolean extractReplicatePutsViaCopy(Properties properties) { - boolean replicatePutsViaCopy; - String replicatePutsViaCopyString = PropertyUtil.extractAndLogProperty(REPLICATE_PUTS_VIA_COPY, properties); - if (replicatePutsViaCopyString != null) { - replicatePutsViaCopy = PropertyUtil.parseBoolean(replicatePutsViaCopyString); - } else { - replicatePutsViaCopy = true; - } - return replicatePutsViaCopy; - } - - /** - * Extracts the value of replicateUpdates from the properties - * @param properties - */ - protected boolean extractReplicateUpdates(Properties properties) { - boolean replicateUpdates; - String replicateUpdatesString = PropertyUtil.extractAndLogProperty(REPLICATE_UPDATES, properties); - if (replicateUpdatesString != null) { - replicateUpdates = PropertyUtil.parseBoolean(replicateUpdatesString); - } else { - replicateUpdates = true; - } - return replicateUpdates; - } - - /** - * Extracts the value of replicatePuts from the properties - * @param properties - */ - protected boolean extractReplicatePuts(Properties properties) { - boolean replicatePuts; - String replicatePutsString = PropertyUtil.extractAndLogProperty(REPLICATE_PUTS, properties); - if (replicatePutsString != null) { - replicatePuts = PropertyUtil.parseBoolean(replicatePutsString); - } else { - replicatePuts = true; - } - return replicatePuts; - } - - -} Index: rctags/ehcache-2.10.9.0.411/system-tests/src/test/java/org/terracotta/ehcache/tests/SharedClientMBeanTest.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/system-tests/src/test/java/org/terracotta/ehcache/tests/SharedClientMBeanTest.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/system-tests/src/test/java/org/terracotta/ehcache/tests/SharedClientMBeanTest.java (revision 0) @@ -1,113 +0,0 @@ -/* - * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved. - */ -package org.terracotta.ehcache.tests; - -import net.sf.ehcache.CacheManager; -import net.sf.ehcache.config.CacheConfiguration; -import net.sf.ehcache.config.Configuration; -import net.sf.ehcache.config.TerracottaClientConfiguration; -import net.sf.ehcache.config.TerracottaConfiguration; - -import org.terracotta.test.util.JMXUtils; -import org.terracotta.tests.base.AbstractClientBase; -import org.terracotta.toolkit.ToolkitFactory; - -import com.tc.test.config.model.TestConfig; -import com.tc.util.concurrent.ThreadUtil; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import javax.management.MBeanServerConnection; -import javax.management.ObjectInstance; -import javax.management.ObjectName; -import javax.management.remote.JMXConnector; - -import junit.framework.Assert; - -public class SharedClientMBeanTest extends AbstractCacheTestBase { - - public SharedClientMBeanTest(TestConfig testConfig) { - super(testConfig, SharedClientMBeanTestClient.class); - - } - - public static class SharedClientMBeanTestClient extends AbstractClientBase { - - public SharedClientMBeanTestClient(String[] args) { - super(args); - } - - @Override - protected void doTest() throws Throwable { - String tcUrl = getTerracottaUrl(); - - // first create a toolkit - ToolkitFactory.createToolkit("toolkit:terracotta://" + tcUrl); - - // create ehcache cacheManager - will be shared client - Configuration configuration = new Configuration().name("cm").terracotta(new TerracottaClientConfiguration() - .rejoin(false).url(tcUrl)); - - configuration.addCache(new CacheConfiguration().name("mbeanCache") - .terracotta(new TerracottaConfiguration().clustered(true)).maxEntriesLocalHeap(100)); - CacheManager.newInstance(configuration); - - checkEhcacheMBeansRegistered(getGroupData(0).getJmxPort(0), false); - - } - - private void checkEhcacheMBeansRegistered(int jmxPort, boolean afterRejoin) throws Exception { - - MBeanServerConnection mbs = getOrWaitForServerMbeanConnection("localhost", jmxPort); - ObjectName name = new ObjectName("net.sf.ehcache:*"); - Set queryMBeans = mbs.queryMBeans(name, null); - System.out.println("======================================="); - System.out.println("List of objectNames registered in L2"); - for (ObjectInstance oname : queryMBeans) { - System.out.println(oname.getObjectName().getCanonicalName()); - } - System.out.println("======================================="); - - Map mbeanNames = new HashMap(); - ObjectName cacheMgrMbeanName = null; - - for (ObjectInstance oi : queryMBeans) { - ObjectName objectName = oi.getObjectName(); - String type = objectName.getKeyProperty("type"); - if ("SampledCache".equals(type)) { - if (objectName.getKeyProperty("name").equals("mbeanCache")) { - mbeanNames.put("exception", objectName); - } - } - if ("SampledCacheManager".equals(type)) { - cacheMgrMbeanName = objectName; - } - } - Assert.assertNotNull("CacheManager mbean is not tunneled", cacheMgrMbeanName); - Assert.assertEquals("Some mbeans for cache are missing", 1, mbeanNames.size()); - for (Entry entry : mbeanNames.entrySet()) { - Assert.assertNotNull("Mbean should be present for cache type : " + entry.getKey(), entry.getValue()); - } - } - - private MBeanServerConnection getOrWaitForServerMbeanConnection(String host, int port) { - MBeanServerConnection mbs = null; - while (mbs == null) { - try { - final JMXConnector jmxConnector = JMXUtils.getJMXConnector(host, port); - mbs = jmxConnector.getMBeanServerConnection(); - } catch (IOException e) { - System.err.println("XXX getOrWaitForServerMbeanConnection " + host + ":" + port + " - " + e); - } - ThreadUtil.reallySleep(3000); - } - return mbs; - } - } - -} Index: rctags/ehcache-2.10.9.0.411/system-tests/src/test/java/org/terracotta/ehcache/tests/JmxThreadDumper.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/system-tests/src/test/java/org/terracotta/ehcache/tests/JmxThreadDumper.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/system-tests/src/test/java/org/terracotta/ehcache/tests/JmxThreadDumper.java (revision 0) @@ -1,61 +0,0 @@ -/* - * All content copyright (c) Terracotta, Inc., except as may otherwise be noted in a separate copyright - * notice. All rights reserved. - */ -package org.terracotta.ehcache.tests; - -import java.io.IOException; -import java.lang.management.ManagementFactory; -import java.lang.management.ThreadInfo; -import java.lang.management.ThreadMXBean; - -import javax.management.MBeanServerConnection; - -public class JmxThreadDumper { - private ThreadMXBean threadMxBean; - - public JmxThreadDumper(MBeanServerConnection server) throws IOException { - this.threadMxBean = ManagementFactory.newPlatformMXBeanProxy(server, ManagementFactory.THREAD_MXBEAN_NAME, ThreadMXBean.class); - } - - /** - * Prints the thread dump information to System.out. - */ - public void threadDump() { - System.out.println("Full Java thread dump"); - long[] threadIds = threadMxBean.getAllThreadIds(); - ThreadInfo[] threadInfos = threadMxBean.getThreadInfo(threadIds, Integer.MAX_VALUE); - for (ThreadInfo threadInfo : threadInfos) { - printThreadInfo(threadInfo); - } - } - - private void printThreadInfo(ThreadInfo threadInfo) { - printThread(threadInfo); - - StackTraceElement[] stackTrace = threadInfo.getStackTrace(); - for (StackTraceElement stackTraceElement : stackTrace) { - System.out.println(" at " + stackTraceElement.toString()); - } - System.out.println(); - } - - private void printThread(ThreadInfo threadInfo) { - StringBuilder sb = new StringBuilder("\"" + threadInfo.getThreadName() + "\"" + " Id=" + threadInfo.getThreadId() + - " in " + threadInfo.getThreadState()); - if (threadInfo.getLockName() != null) { - sb.append(" on lock=").append(threadInfo.getLockName()); - } - if (threadInfo.isSuspended()) { - sb.append(" (suspended)"); - } - if (threadInfo.isInNative()) { - sb.append(" (running in native)"); - } - System.out.println(sb.toString()); - if (threadInfo.getLockOwnerName() != null) { - System.out.println(" owned by " + threadInfo.getLockOwnerName() + " Id=" + threadInfo.getLockOwnerId()); - } - } - -} Index: rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/distribution/CacheReplicator.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/distribution/CacheReplicator.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/distribution/CacheReplicator.java (revision 0) @@ -1,46 +0,0 @@ -/** - * Copyright Terracotta, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package net.sf.ehcache.distribution; - -import net.sf.ehcache.event.CacheEventListener; - -/** - * Replicates cache entries to peers of the CacheManager - * @author Greg Luck - * @version $Id: CacheReplicator.java 5594 2012-05-07 16:04:31Z cdennis $ - */ -public interface CacheReplicator extends CacheEventListener { - - /** - * Returns whether update is through copy or invalidate - * @return true if update is via copy, else false if invalidate - */ - boolean isReplicateUpdatesViaCopy(); - - /** - * Returns whether the replicator is not active. - * @return true if the status is not STATUS_ALIVE - */ - boolean notAlive(); - - /** - * Checks that the replicator is is STATUS_ALIVE. - * @return true if the replicator is is STATUS_ALIVE, else false. - */ - boolean alive(); - -} Index: rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/config/generator/model/NodeAttribute.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/config/generator/model/NodeAttribute.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/config/generator/model/NodeAttribute.java (revision 0) @@ -1,98 +0,0 @@ -/** - * Copyright Terracotta, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package net.sf.ehcache.config.generator.model; - -/** - * Interface that abstracts the idea of an attribute. An attribute has a name, a value, boolean indicating if its an optional attribute and - * a default value - * - * @author Abhishek Sanoujam - * - */ -public interface NodeAttribute { - - /** - * Name of the attribute - * - * @return Name of the attribute - */ - String getName(); - - /** - * Value of the attribute - * - * @return value of the attribute - */ - String getValue(); - - /** - * Returns true if the attribute is optional, otherwise false - * - * @return Returns true if the attribute is optional, otherwise false - */ - boolean isOptional(); - - /** - * Returns the default value of the attribute - * - * @return default value of the attribute - */ - String getDefaultValue(); - - /** - * Sets this attribute to optional or not - * - * @param optional - * true if this attribute is optional - */ - public void setOptional(boolean optional); - - /** - * Default value setter - * - * @param defaultValue - * the default value - */ - public void setDefaultValue(String defaultValue); - - /** - * Setter for value - * - * @param value - * the new value - */ - public void setValue(String value); - - /** - * Builder convenience method for setting optional - * - * @param optional - * true if optional - * @return the same attribute instance - */ - NodeAttribute optional(boolean optional); - - /** - * Builder convenience method for setting defaultValue - * - * @param defaultValue - * the default value - * @return the same attribute instance - */ - NodeAttribute defaultValue(String defaultValue); - -} Index: rctags/ehcache-2.10.9.0.411/terracotta/bootstrap/src/main/java/org/terracotta/modules/ehcache/ToolkitInstanceFactoryImpl.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/terracotta/bootstrap/src/main/java/org/terracotta/modules/ehcache/ToolkitInstanceFactoryImpl.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/terracotta/bootstrap/src/main/java/org/terracotta/modules/ehcache/ToolkitInstanceFactoryImpl.java (revision 0) @@ -1,954 +0,0 @@ -/* - * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved. - */ -package org.terracotta.modules.ehcache; - -import net.sf.ehcache.Ehcache; -import net.sf.ehcache.config.CacheConfiguration; -import net.sf.ehcache.config.ConfigurationFactory; -import net.sf.ehcache.config.PinningConfiguration; -import net.sf.ehcache.config.TerracottaClientConfiguration; -import net.sf.ehcache.config.TerracottaConfiguration; -import net.sf.ehcache.config.TerracottaConfiguration.Consistency; -import net.sf.ehcache.config.generator.ConfigurationUtil; -import net.sf.ehcache.search.attribute.AttributeExtractor; -import net.sf.ehcache.transaction.Decision; -import net.sf.ehcache.transaction.TransactionID; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.terracotta.modules.ehcache.async.AsyncConfig; -import org.terracotta.modules.ehcache.collections.SerializationHelper; -import org.terracotta.modules.ehcache.collections.SerializedToolkitCache; -import org.terracotta.modules.ehcache.event.CacheDisposalNotification; -import org.terracotta.modules.ehcache.event.CacheEventNotificationMsg; -import org.terracotta.modules.ehcache.store.CacheConfigChangeNotificationMsg; -import org.terracotta.modules.ehcache.store.TerracottaClusteredInstanceFactory; -import org.terracotta.modules.ehcache.store.ToolkitNonStopConfiguration; -import org.terracotta.modules.ehcache.store.nonstop.ToolkitNonstopDisableConfig; -import org.terracotta.modules.ehcache.transaction.ClusteredSoftLockIDKey; -import org.terracotta.modules.ehcache.transaction.SerializedReadCommittedClusteredSoftLock; -import org.terracotta.modules.ehcache.wan.WANUtil; -import org.terracotta.modules.ehcache.wan.Watchable; -import org.terracotta.modules.ehcache.wan.Watchdog; -import org.terracotta.toolkit.Toolkit; -import org.terracotta.toolkit.ToolkitFeatureType; -import org.terracotta.toolkit.ToolkitObjectType; -import org.terracotta.toolkit.builder.ToolkitCacheConfigBuilder; -import org.terracotta.toolkit.builder.ToolkitStoreConfigBuilder; -import org.terracotta.toolkit.cache.ToolkitCache; -import org.terracotta.toolkit.collections.ToolkitMap; -import org.terracotta.toolkit.concurrent.locks.ToolkitLock; -import org.terracotta.toolkit.concurrent.locks.ToolkitReadWriteLock; -import org.terracotta.toolkit.config.Configuration; -import org.terracotta.toolkit.events.ToolkitNotifier; -import org.terracotta.toolkit.internal.ToolkitInternal; -import org.terracotta.toolkit.internal.ToolkitLogger; -import org.terracotta.toolkit.internal.cache.BufferingToolkitCache; -import org.terracotta.toolkit.internal.cache.ToolkitCacheInternal; -import org.terracotta.toolkit.internal.collections.ToolkitListInternal; -import org.terracotta.toolkit.internal.store.ConfigFieldsInternal; -import org.terracotta.toolkit.nonstop.NonStopConfigurationRegistry; -import org.terracotta.toolkit.store.ToolkitConfigFields; - -import com.terracotta.entity.ClusteredEntityManager; -import com.terracotta.entity.ehcache.ClusteredCache; -import com.terracotta.entity.ehcache.ClusteredCacheConfiguration; -import com.terracotta.entity.ehcache.ClusteredCacheManager; -import com.terracotta.entity.ehcache.ClusteredCacheManagerConfiguration; -import com.terracotta.entity.ehcache.EhcacheEntitiesNaming; -import com.terracotta.entity.ehcache.ToolkitBackedClusteredCache; -import com.terracotta.entity.ehcache.ToolkitBackedClusteredCacheManager; - -import java.io.BufferedInputStream; -import java.io.BufferedReader; -import java.io.ByteArrayInputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.Serializable; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.Collections; -import java.util.HashSet; -import java.util.Objects; -import java.util.Set; -import java.util.concurrent.TimeUnit; - -import static java.lang.String.format; - -public class ToolkitInstanceFactoryImpl implements ToolkitInstanceFactory { - - public static final Logger LOGGER = LoggerFactory - .getLogger(ToolkitInstanceFactoryImpl.class); - private static final String CONFIG_LOGGER_NAME = "com.terracotta.ehcache.config"; - - public static final String DELIMITER = "|"; - private static final String EVENT_NOTIFIER_SUFFIX = "event-notifier"; - private static final String DISPOSAL_NOTIFIER_SUFFIX = "disposal-notifier"; - private static final String EHCACHE_NAME_PREFIX = "__tc_clustered-ehcache"; - private static final String CONFIG_NOTIFIER_SUFFIX = "config-notifier"; - private static final String EHCACHE_TXNS_DECISION_STATE_MAP_NAME = EHCACHE_NAME_PREFIX + DELIMITER - + "txnsDecision"; - private static final String ALL_SOFT_LOCKS_MAP_SUFFIX = "softLocks"; - private static final String NEW_SOFT_LOCKS_LIST_SUFFIX = "newSoftLocks"; - - private static final String LOCK_TAG = "::LOCK"; - - static final String CLUSTERED_STORE_CONFIG_MAP = EHCACHE_NAME_PREFIX + DELIMITER + "configMap"; - - private static final String EHCACHE_TXNS_SOFTLOCK_WRITE_LOCK_NAME = EHCACHE_NAME_PREFIX + DELIMITER - + "softWriteLock"; - - private static final String EHCACHE_TXNS_SOFTLOCK_FREEZE_LOCK_NAME = EHCACHE_NAME_PREFIX + DELIMITER - + "softFreezeLock"; - private static final String EHCACHE_TXNS_SOFTLOCK_NOTIFIER_LOCK_NAME = EHCACHE_NAME_PREFIX + DELIMITER - + "softNotifierLock"; - public static final int RETRY_MARK_IN_USE_AFTER_REJOIN = 5; - - protected final Toolkit toolkit; - private final WANUtil wanUtil; - private final ClusteredEntityManager clusteredEntityManager; - private volatile ClusteredCacheManager clusteredCacheManagerEntity; - private final EntityNamesHolder entityNames; - private final Watchdog wanWatchdog; - - public ToolkitInstanceFactoryImpl(final TerracottaClientConfiguration terracottaClientConfiguration, - final String productId, ClassLoader loader) { - this.toolkit = createTerracottaToolkit(terracottaClientConfiguration, productId, loader); - updateDefaultNonStopConfig(toolkit); - this.clusteredEntityManager = new ClusteredEntityManager(toolkit); - this.entityNames = new EntityNamesHolder(); - this.wanUtil = new WANUtil(this); - this.wanWatchdog = Watchdog.create(); - } - - public ToolkitInstanceFactoryImpl(final TerracottaClientConfiguration terracottaClientConfiguration, - ClassLoader loader) { - this(terracottaClientConfiguration, null, loader); - } - - // Constructor to enable unit testing - ToolkitInstanceFactoryImpl(final Toolkit toolkit, final ClusteredEntityManager clusteredEntityManager) { - this.toolkit = toolkit; - this.clusteredEntityManager = clusteredEntityManager; - this.entityNames = new EntityNamesHolder(); - this.wanUtil = new WANUtil(this); - this.wanWatchdog = Watchdog.create(); - } - - ToolkitInstanceFactoryImpl(final Toolkit toolkit, final ClusteredEntityManager clusteredEntityManager, - final WANUtil util, final Watchdog wanWatchdog) { - this.toolkit = toolkit; - this.clusteredEntityManager = clusteredEntityManager; - this.entityNames = new EntityNamesHolder(); - this.wanUtil = util; - this.wanWatchdog = wanWatchdog; - } - - private void updateDefaultNonStopConfig(Toolkit toolkitParam) { - ToolkitNonstopDisableConfig disableNonStop = new ToolkitNonstopDisableConfig(); - NonStopConfigurationRegistry nonStopConfigurationRegistry = toolkitParam.getFeature(ToolkitFeatureType.NONSTOP) - .getNonStopConfigurationRegistry(); - for (ToolkitObjectType t : ToolkitObjectType.values()) { - try { - nonStopConfigurationRegistry.registerForType(disableNonStop, t); - } catch (UnsupportedOperationException e) { - // expected for Barrier and BlockingQueue. - if (!(t == ToolkitObjectType.BARRIER || t == ToolkitObjectType.BLOCKING_QUEUE)) { throw e; } - } - } - } - - private static Toolkit createTerracottaToolkit(TerracottaClientConfiguration terracottaClientConfiguration, - String productId, ClassLoader loader) { - TerracottaToolkitBuilder terracottaClientBuilder = new TerracottaToolkitBuilder(); - EhcacheTcConfig ehcacheTcConfig = EhcacheTcConfig.create(terracottaClientConfiguration); - switch (ehcacheTcConfig.type) { - case URL: - terracottaClientBuilder.setTCConfigUrl(ehcacheTcConfig.tcConfigUrlOrSnippet); - break; - case EMBEDDED_TC_CONFIG: - case FILE: - terracottaClientBuilder.setTCConfigSnippet(ehcacheTcConfig.tcConfigUrlOrSnippet); - break; - } - terracottaClientBuilder.addTunnelledMBeanDomain("net.sf.ehcache"); - terracottaClientBuilder.addTunnelledMBeanDomain("net.sf.ehcache.hibernate"); - terracottaClientBuilder.addTunnelledMBeanDomain("org.terracotta.wan"); - terracottaClientBuilder.setRejoinEnabled(terracottaClientConfiguration.isRejoin()); - terracottaClientBuilder.setProductId(productId); - terracottaClientBuilder.setClassLoader(loader); - return terracottaClientBuilder.buildToolkit(); - } - - @Override - public void waitForOrchestrator(String cacheManagerName) { - wanUtil.waitForOrchestrator(cacheManagerName); - } - - @Override - public void markCacheWanDisabled(String cacheManagerName, String cacheName) { - wanUtil.markCacheWanDisabled(cacheManagerName, cacheName); - } - - @Override - public Toolkit getToolkit() { - return toolkit; - } - - @Override - public ToolkitCacheInternal getOrCreateToolkitCache(final Ehcache cache) { - final String cacheManagerName = getCacheManagerName(cache); - final String cacheName = cache.getName(); - - ToolkitCacheInternal toolkitCache = getOrCreateRegularToolkitCache( - cacheManagerName, cacheName, cache.getCacheConfiguration()); - if(wanUtil.isWanEnabledCache(cacheManagerName, cacheName)) { - final boolean replicaCache = wanUtil.isCacheReplica(cacheManagerName, cacheName); - final boolean bidirectional = wanUtil.isCacheBidirectional(cacheManagerName, cacheName); - toolkitCache = createWanAwareToolkitCache(cacheManagerName, cacheName, toolkitCache, - cache.getCacheConfiguration(), !replicaCache, bidirectional); - - if (replicaCache) { - LOGGER.info("Pinning the Cache '{}' belonging to Cache Manager '{}' " + - "and setting its TTI and TTL values to zero as it is a WAN Replica Cache. " + - "This cache's capacity will be controlled by its Master cache.", - cacheName, cacheManagerName); - PinningConfiguration pinningConfiguration = new PinningConfiguration(); - pinningConfiguration.setStore(PinningConfiguration.Store.INCACHE.toString()); - cache.getCacheConfiguration().addPinning(pinningConfiguration); - cache.getCacheConfiguration().setMaxEntriesInCache(0); - cache.getCacheConfiguration().setTimeToLiveSeconds(0); - cache.getCacheConfiguration().setTimeToIdleSeconds(0); - } - - cache.getCacheConfiguration().freezeConfiguration(); - - wanWatchdog.watch((Watchable) toolkitCache); - } - - return toolkitCache; - } - - @Override - public WanAwareToolkitCache getOrCreateWanAwareToolkitCache(final String cacheManagerName, - final String cacheName, - final CacheConfiguration ehcacheConfig, - final boolean masterCache, - final boolean bidirectional) { - final ToolkitCacheInternal toolkitCache = - getOrCreateRegularToolkitCache(cacheManagerName, cacheName, ehcacheConfig); - return createWanAwareToolkitCache(cacheManagerName, cacheName, toolkitCache, ehcacheConfig, masterCache, bidirectional); - } - - private WanAwareToolkitCache createWanAwareToolkitCache(final String cacheManagerName, - final String cacheName, - final ToolkitCacheInternal toolkitCache, - final CacheConfiguration cacheConfiguration, - final boolean masterCache, - final boolean bidirectional) { - final String fullyQualifiedCacheName = EhcacheEntitiesNaming.getToolkitCacheNameFor(cacheManagerName, cacheName); - final ToolkitMap configMap = getOrCreateConfigMap(fullyQualifiedCacheName); - return new WanAwareToolkitCache((BufferingToolkitCache)toolkitCache, configMap, - toolkit.getFeature(ToolkitFeatureType.NONSTOP), - toolkit.getLock(toolkitCache.getName() + LOCK_TAG), - cacheConfiguration, masterCache, bidirectional); - } - - private ToolkitCacheInternal getOrCreateRegularToolkitCache(final String cacheManagerName, - final String cacheName, - final CacheConfiguration ehcacheConfig) { - final Configuration toolkitCacheConfig = createClusteredCacheConfig(ehcacheConfig, cacheManagerName); - final String fullyQualifiedCacheName = EhcacheEntitiesNaming.getToolkitCacheNameFor(cacheManagerName, cacheName); - addNonStopConfigForCache(ehcacheConfig, fullyQualifiedCacheName); - ToolkitCacheInternal toolkitCache = getOrCreateToolkitCache(fullyQualifiedCacheName, toolkitCacheConfig); - addCacheEntityInfo(cacheName, ehcacheConfig, fullyQualifiedCacheName); - return toolkitCache; - } - - private ToolkitCacheInternal getOrCreateToolkitCache(final String fullyQualifiedCacheName, - final Configuration toolkitCacheConfig) { - return (ToolkitCacheInternal) toolkit.getCache(fullyQualifiedCacheName, toolkitCacheConfig, - Serializable.class); - } - - @Override - public ToolkitNotifier getOrCreateConfigChangeNotifier(Ehcache cache) { - return getOrCreateConfigChangeNotifier(cache.getCacheManager().getName(), cache.getName()); - } - - private ToolkitNotifier getOrCreateConfigChangeNotifier(String cacheManagerName, String cacheName) { - String notifierName = EhcacheEntitiesNaming.getToolkitCacheNameFor(cacheManagerName, cacheName) + DELIMITER - + CONFIG_NOTIFIER_SUFFIX; - ToolkitNotifier notifier = toolkit - .getNotifier(notifierName, CacheConfigChangeNotificationMsg.class); - addCacheMetaInfo(cacheName, ToolkitObjectType.NOTIFIER, notifierName); - return notifier; - } - - @Override - public ToolkitNotifier getOrCreateCacheEventNotifier(Ehcache cache) { - return getOrCreateCacheEventNotifier(cache.getCacheManager().getName(), cache.getName()); - } - - @Override - public ToolkitNotifier getOrCreateCacheDisposalNotifier(Ehcache cache) { - return toolkit.getNotifier(EhcacheEntitiesNaming.getToolkitCacheNameFor(cache.getCacheManager().getName(), cache.getName()) - + DELIMITER + DISPOSAL_NOTIFIER_SUFFIX, CacheDisposalNotification.class); - } - - private ToolkitNotifier getOrCreateCacheEventNotifier(String cacheManagerName, String cacheName) { - String notifierName = EhcacheEntitiesNaming.getToolkitCacheNameFor(cacheManagerName, cacheName) + DELIMITER - + EVENT_NOTIFIER_SUFFIX; - ToolkitNotifier notifier = toolkit.getNotifier(notifierName, - CacheEventNotificationMsg.class); - addCacheMetaInfo(cacheName, ToolkitObjectType.NOTIFIER, notifierName); - return notifier; - } - - private static Configuration createClusteredCacheConfig(final CacheConfiguration ehcacheConfig, - final String cacheManagerName) { - ToolkitCacheConfigBuilder builder = new ToolkitCacheConfigBuilder(); - final TerracottaConfiguration terracottaConfiguration = ehcacheConfig.getTerracottaConfiguration(); - builder.maxTTISeconds((int) ehcacheConfig.getTimeToIdleSeconds()); - builder.maxTTLSeconds((int) ehcacheConfig.getTimeToLiveSeconds()); - builder.localCacheEnabled(terracottaConfiguration.isLocalCacheEnabled()); - - // Fix for Dev-9223. Dont set anything incase of Default value. Assuming tookit and ehcache defaults are aligned. - if (ehcacheConfig.getMaxEntriesInCache() != CacheConfiguration.DEFAULT_MAX_ENTRIES_IN_CACHE) { - if (ehcacheConfig.getMaxEntriesInCache() > Integer.MAX_VALUE) { - throw new IllegalArgumentException("Values greater than Integer.MAX_VALUE are not currently supported."); - } else { - builder.maxTotalCount((int) ehcacheConfig.getMaxEntriesInCache()); - } - } - - if (terracottaConfiguration.isSynchronousWrites()) { - builder.consistency(org.terracotta.toolkit.store.ToolkitConfigFields.Consistency.SYNCHRONOUS_STRONG); - } else if (terracottaConfiguration.getConsistency() == Consistency.EVENTUAL) { - builder.consistency(org.terracotta.toolkit.store.ToolkitConfigFields.Consistency.EVENTUAL); - } else { - builder.consistency(org.terracotta.toolkit.store.ToolkitConfigFields.Consistency.STRONG); - } - - if (terracottaConfiguration.getConcurrency() == TerracottaConfiguration.DEFAULT_CONCURRENCY) { - builder.concurrency(calculateCorrectConcurrency(ehcacheConfig)); - } else { - builder.concurrency(terracottaConfiguration.getConcurrency()); - } - - builder.localCacheEnabled(terracottaConfiguration.isLocalCacheEnabled()); - builder.configField(ConfigFieldsInternal.LOCAL_STORE_MANAGER_NAME_NAME, cacheManagerName); - builder.pinnedInLocalMemory(isPinnedInLocalMemory(ehcacheConfig)); - builder.evictionEnabled(!isPinnedInCache(ehcacheConfig)); - builder.maxCountLocalHeap((int) ehcacheConfig.getMaxEntriesLocalHeap()); - builder.maxBytesLocalHeap(ehcacheConfig.getMaxBytesLocalHeap()); - builder.maxBytesLocalOffheap(ehcacheConfig.getMaxBytesLocalOffHeap()); - builder.offheapEnabled(ehcacheConfig.isOverflowToOffHeap()); - builder.compressionEnabled(terracottaConfiguration.isCompressionEnabled()); - builder.copyOnReadEnabled(ehcacheConfig.isCopyOnRead()); - - return builder.build(); - } - - private static boolean isPinnedInCache(final CacheConfiguration ehcacheConfig) { - return ehcacheConfig.getPinningConfiguration() != null - && ehcacheConfig.getPinningConfiguration().getStore() == PinningConfiguration.Store.INCACHE; - } - - private static int calculateCorrectConcurrency(CacheConfiguration cacheConfiguration) { - int maxElementOnDisk = cacheConfiguration.getMaxElementsOnDisk(); - if (maxElementOnDisk <= 0 || maxElementOnDisk >= ToolkitConfigFields.DEFAULT_CONCURRENCY) { return ToolkitConfigFields.DEFAULT_CONCURRENCY; } - int concurrency = 1; - while (concurrency * 2 <= maxElementOnDisk) {// this while loop is not very time consuming, maximum it will do 8 - // iterations - concurrency *= 2; - } - return concurrency; - } - - private static boolean isPinnedInLocalMemory(CacheConfiguration ehcacheConfig) { - return ehcacheConfig.getPinningConfiguration() != null - && ehcacheConfig.getPinningConfiguration().getStore() == PinningConfiguration.Store.LOCALMEMORY; - } - - @Override - public String getFullyQualifiedCacheName(Ehcache cache) { - return EhcacheEntitiesNaming.getToolkitCacheNameFor(getCacheManagerName(cache), cache.getName()); - } - - private static String getCacheManagerName(Ehcache cache) { - final String cacheMgrName; - if (cache.getCacheManager().isNamed()) { - cacheMgrName = cache.getCacheManager().getName(); - } else { - cacheMgrName = TerracottaClusteredInstanceFactory.DEFAULT_CACHE_MANAGER_NAME; - } - return cacheMgrName; - } - - @Override - public ToolkitLock getOrCreateStoreLock(Ehcache cache) { - return toolkit.getLock(getFullyQualifiedCacheName(cache) + DELIMITER + "storeRWLock"); - } - - @Override - public ToolkitMap getOrCreateExtractorsMap(final String cacheManagerName, String cacheName) { - // implemented in ee version - throw new UnsupportedOperationException(); - } - - @Override - public ToolkitMap getOrCreateAttributeMap(final String cacheManagerName, String cacheName) { - throw new UnsupportedOperationException(); - } - - @Override - public void shutdown() { - if (clusteredCacheManagerEntity != null) { - try { - clusteredCacheManagerEntity.releaseUse(); - } catch (Exception e) { - // Ignore - will be shutting down toolkit anyway - LOGGER.debug("Exception occurred while releasing clustered cache manager entity use", e); - } - } - clusteredEntityManager.dispose(); - toolkit.shutdown(); - } - - @Override - public SerializedToolkitCache getOrCreateAllSoftLockMap(String cacheManagerName, - String cacheName) { - // TODO: what should be the local cache config for the map? - Configuration config = new ToolkitStoreConfigBuilder() - .consistency(org.terracotta.toolkit.store.ToolkitConfigFields.Consistency.STRONG).build(); - String softLockCacheName = EhcacheEntitiesNaming.getToolkitCacheNameFor(cacheManagerName, cacheName) + DELIMITER - + ALL_SOFT_LOCKS_MAP_SUFFIX; - ToolkitCache map = toolkit - .getCache(softLockCacheName, config, SerializedReadCommittedClusteredSoftLock.class); - addCacheMetaInfo(cacheName, ToolkitObjectType.CACHE, softLockCacheName); - return new SerializedToolkitCache(map); - - } - - @Override - public ToolkitMap getOrCreateNewSoftLocksSet(String cacheManagerName, - String cacheName) { - String softLockMapName = EhcacheEntitiesNaming.getToolkitCacheNameFor(cacheManagerName, cacheName) + DELIMITER - + NEW_SOFT_LOCKS_LIST_SUFFIX; - ToolkitMap softLockMap = toolkit - .getMap(softLockMapName, SerializedReadCommittedClusteredSoftLock.class, Integer.class); - addCacheMetaInfo(cacheName, ToolkitObjectType.MAP, softLockMapName); - return softLockMap; - } - - @Override - public ToolkitMap getOrCreateAsyncConfigMap() { - return toolkit.getMap(EhcacheEntitiesNaming.getAsyncConfigMapName(), String.class, AsyncConfig.class); - } - - @Override - public ToolkitMap> getOrCreateAsyncListNamesMap(String fullAsyncName, String cacheName) { - ToolkitMap asyncListNames = toolkit.getMap(fullAsyncName, String.class, Set.class); - addCacheMetaInfo(cacheName, ToolkitObjectType.MAP, fullAsyncName); - addKeyRemoveInfo(cacheName, EhcacheEntitiesNaming.getAsyncConfigMapName(), fullAsyncName); - return asyncListNames; - } - - @Override - public ToolkitListInternal getAsyncProcessingBucket(String bucketName, String cacheName) { - ToolkitListInternal toolkitList = (ToolkitListInternal) toolkit.getList(bucketName, null); - addCacheMetaInfo(cacheName, ToolkitObjectType.LIST, bucketName); - return toolkitList; - } - - @Override - public ToolkitMap getOrCreateClusteredStoreConfigMap(String cacheManagerName, String cacheName) { - String configMapName = EhcacheEntitiesNaming.getToolkitCacheNameFor(cacheManagerName, cacheName); - ToolkitMap configMap = getOrCreateConfigMap(configMapName); - addCacheMetaInfo(cacheName, ToolkitObjectType.MAP, configMapName); - return configMap; - } - - private ToolkitMap getOrCreateConfigMap(final String fullyQualifiedCacheName) { - // TODO: what should be the local cache config for the map? - return toolkit.getMap(EhcacheEntitiesNaming.getToolkitCacheConfigMapName(fullyQualifiedCacheName), String.class, Serializable.class); - } - - @Override - public SerializedToolkitCache getOrCreateTransactionCommitStateMap(String cacheManagerName) { - // TODO: what should be the local cache config for the map? - Configuration config = new ToolkitStoreConfigBuilder() - .consistency(org.terracotta.toolkit.store.ToolkitConfigFields.Consistency.SYNCHRONOUS_STRONG).build(); - ToolkitCache map = toolkit.getCache(cacheManagerName + DELIMITER - + EHCACHE_TXNS_DECISION_STATE_MAP_NAME, config, - Decision.class); - return new SerializedToolkitCache(map); - } - - @Override - public ToolkitLock getSoftLockWriteLock(String cacheManagerName, String cacheName, TransactionID transactionID, - Object key) { - - return toolkit.getLock(EhcacheEntitiesNaming.getToolkitCacheNameFor(cacheManagerName, cacheName) + DELIMITER - + serializeToString(transactionID) + DELIMITER + serializeToString(key) + DELIMITER - + EHCACHE_TXNS_SOFTLOCK_WRITE_LOCK_NAME); - } - - @Override - public ToolkitLock getLockForCache(Ehcache cache, String lockName) { - return toolkit.getLock(getFullyQualifiedCacheName(cache) + DELIMITER + lockName); - } - - - - private static String serializeToString(Object serializable) { - try { - return SerializationHelper.serializeToString(serializable); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - @Override - public ToolkitReadWriteLock getSoftLockFreezeLock(String cacheManagerName, String cacheName, - TransactionID transactionID, Object key) { - - return toolkit.getReadWriteLock(EhcacheEntitiesNaming.getToolkitCacheNameFor(cacheManagerName, cacheName) + DELIMITER - + serializeToString(transactionID) + DELIMITER + serializeToString(key) + DELIMITER - + EHCACHE_TXNS_SOFTLOCK_FREEZE_LOCK_NAME); - } - - @Override - public ToolkitReadWriteLock getSoftLockNotifierLock(String cacheManagerName, String cacheName, - TransactionID transactionID, Object key) { - - return toolkit.getReadWriteLock(EhcacheEntitiesNaming.getToolkitCacheNameFor(cacheManagerName, cacheName) + DELIMITER - + serializeToString(transactionID) + DELIMITER + serializeToString(key) + DELIMITER - + EHCACHE_TXNS_SOFTLOCK_NOTIFIER_LOCK_NAME); - } - - @Override - public boolean destroy(final String cacheManagerName, final String cacheName) { - getOrCreateAllSoftLockMap(cacheManagerName, cacheName).destroy(); - getOrCreateNewSoftLocksSet(cacheManagerName, cacheName).destroy(); - getOrCreateCacheEventNotifier(cacheManagerName, cacheName).destroy(); - getOrCreateConfigChangeNotifier(cacheManagerName, cacheName).destroy(); - getOrCreateToolkitCache(EhcacheEntitiesNaming.getToolkitCacheNameFor(cacheManagerName, cacheName), - new ToolkitCacheConfigBuilder().maxCountLocalHeap(1).maxBytesLocalOffheap(0).build()) - .destroy(); - - // We always write the transactional mode into this config map, so theoretically if the cache existed, this map - // won't be empty. - ToolkitMap clusteredStoreConfigMap = getOrCreateClusteredStoreConfigMap(cacheManagerName, cacheName); - boolean existed = !clusteredStoreConfigMap.isEmpty(); - clusteredStoreConfigMap.destroy(); - - return existed; - } - - protected void addNonStopConfigForCache(final CacheConfiguration ehcacheConfig, final String fullyQualifiedCacheName) { - final TerracottaConfiguration terracottaConfiguration = ehcacheConfig.getTerracottaConfiguration(); - ToolkitNonStopConfiguration nonstopConfiguration = new ToolkitNonStopConfiguration( - terracottaConfiguration - .getNonstopConfiguration()); - toolkit.getFeature(ToolkitFeatureType.NONSTOP).getNonStopConfigurationRegistry() - .registerForInstance(nonstopConfiguration, fullyQualifiedCacheName, ToolkitObjectType.CACHE); - } - - @Override - public void removeNonStopConfigforCache(Ehcache cache) { - toolkit.getFeature(ToolkitFeatureType.NONSTOP).getNonStopConfigurationRegistry() - .deregisterForInstance(getFullyQualifiedCacheName(cache), ToolkitObjectType.CACHE); - - } - - protected void addCacheMetaInfo(String cacheName, ToolkitObjectType type, String dsName) { - ToolkitBackedClusteredCacheManager tbccm = (ToolkitBackedClusteredCacheManager) clusteredCacheManagerEntity; - tbccm.addCacheMetaInfo(cacheName, type, dsName); - } - - private void addKeyRemoveInfo(String cacheName, String toolkitMapName, String keytoBeRemoved) { - ToolkitBackedClusteredCacheManager tbccm = (ToolkitBackedClusteredCacheManager) clusteredCacheManagerEntity; - tbccm.addKeyRemoveInfo(cacheName, toolkitMapName, keytoBeRemoved); - } - - @Override - public void linkClusteredCacheManager(String cacheManagerName, net.sf.ehcache.config.Configuration configuration) { - Objects.requireNonNull(cacheManagerName); - if (clusteredCacheManagerEntity == null) { - try { - logCacheManagerConfigInTerracottaClientLogs(cacheManagerName, configuration); - - ClusteredCacheManager clusteredCacheManager = clusteredEntityManager.getRootEntity(cacheManagerName, - ClusteredCacheManager.class); - ToolkitReadWriteLock cmRWLock = clusteredEntityManager.getEntityLock(EhcacheEntitiesNaming - .getCacheManagerLockNameFor(cacheManagerName)); - ToolkitLock cmWriteLock = cmRWLock.writeLock(); - while (clusteredCacheManager == null) { - if (cmWriteLock.tryLock()) { - try { - clusteredCacheManager = createClusteredCacheManagerEntity(cacheManagerName, configuration); - } finally { - cmWriteLock.unlock(); - } - } else { - clusteredCacheManager = clusteredEntityManager.getRootEntity(cacheManagerName, ClusteredCacheManager.class); - } - } - clusteredCacheManagerEntity = clusteredCacheManager; - entityNames.setCacheManagerName(cacheManagerName); - } catch (RuntimeException re) { - entityNames.linkFailure = re; - throw re; - } - } - } - - private void logCacheManagerConfigInTerracottaClientLogs(String cacheManagerName, net.sf.ehcache.config.Configuration configuration) { - ToolkitLogger logger = ((ToolkitInternal)toolkit).getLogger(CONFIG_LOGGER_NAME); - if (logger.isInfoEnabled()) { - try { - logger.info("Configuration for clustered cache manager " + cacheManagerName + ":\n" + - convertConfigurationToXMLString(configuration, cacheManagerName, true)); - } catch (Exception e) { - logger.warn("Exception while trying to log configuration for clustered cache manager " + cacheManagerName, e); - } - } - } - - private ClusteredCacheManager createClusteredCacheManagerEntity(String cacheManagerName, net.sf.ehcache.config.Configuration configuration) { - ClusteredCacheManager clusteredCacheManager; - String xmlConfig = convertConfigurationToXMLString(configuration, cacheManagerName, true); - clusteredCacheManager = new ToolkitBackedClusteredCacheManager(cacheManagerName, - new ClusteredCacheManagerConfiguration(xmlConfig)); - ClusteredCacheManager existing = clusteredEntityManager.addRootEntityIfAbsent(cacheManagerName, ClusteredCacheManager.class, clusteredCacheManager); - if (existing != null) { - clusteredCacheManager = existing; - } - return clusteredCacheManager; - } - - @Override - public ToolkitMap getOrCreateCacheManagerMetaInfoMap(String cacheManagerName) { - String configMapName = EhcacheEntitiesNaming.getCacheManagerConfigMapName(cacheManagerName); - ToolkitMap configMap = toolkit.getMap(configMapName, String.class, Serializable.class); - return configMap; - } - - void addCacheEntityInfo(final String cacheName, final CacheConfiguration ehcacheConfig, String toolkitCacheName) { - if (clusteredCacheManagerEntity == null) { - throw new IllegalStateException(format("ClusteredCacheManger entity not configured for cache %s", cacheName)); - } - - logCacheConfigInTerracottaClientLogs(cacheName, ehcacheConfig); - - ClusteredCache cacheEntity = clusteredCacheManagerEntity.getCache(cacheName); - if (cacheEntity == null) { - ToolkitReadWriteLock cacheRWLock = clusteredCacheManagerEntity.getCacheLock(cacheName); - ToolkitLock cacheWriteLock = cacheRWLock.writeLock(); - while (cacheEntity == null) { - if (cacheWriteLock.tryLock()) { - try { - cacheEntity = createClusteredCacheEntity(cacheName, ehcacheConfig, toolkitCacheName); - } finally { - cacheWriteLock.unlock(); - } - } else { - cacheEntity = clusteredCacheManagerEntity.getCache(cacheName); - } - } - } - // TODO check some config elements - clusteredCacheManagerEntity.markCacheInUse(cacheEntity); - entityNames.addCacheName(cacheName); - } - - private void logCacheConfigInTerracottaClientLogs(String cacheName, CacheConfiguration ehcacheConfig) { - ToolkitLogger logger = ((ToolkitInternal)toolkit).getLogger(CONFIG_LOGGER_NAME); - if (logger.isInfoEnabled()) { - try { - logger.info("Client configuration for clustered cache named " + cacheName + ":\n(clustered properties may differ in runtime cache depending on configuration used at creation time)\n" + - convertCacheConfigurationToXMLString(ehcacheConfig)); - } catch (Exception e) { - logger.warn("Exception while trying to log configuration for clustered cache " + cacheName, e); - } - } - } - - private ClusteredCache createClusteredCacheEntity(String cacheName, CacheConfiguration ehcacheConfig, String toolkitCacheName) { - ClusteredCacheConfiguration clusteredConfiguration = createClusteredCacheConfiguration(ehcacheConfig); - ClusteredCache cacheEntity = new ToolkitBackedClusteredCache(cacheName, clusteredConfiguration, toolkitCacheName); - - ClusteredCache existing = clusteredCacheManagerEntity.addCacheIfAbsent(cacheName, cacheEntity); - if (existing != null) { - cacheEntity = existing; - } - return cacheEntity; - } - - private ClusteredCacheConfiguration createClusteredCacheConfiguration(CacheConfiguration ehcacheConfig) { - String xmlConfig = convertCacheConfigurationToXMLString(ehcacheConfig); - return new ClusteredCacheConfiguration(xmlConfig); - } - - private String convertCacheConfigurationToXMLString(CacheConfiguration ehcacheConfig) { - net.sf.ehcache.config.Configuration configuration = parseCacheManagerConfiguration(clusteredCacheManagerEntity.getConfiguration() - .getConfigurationAsText()); - return ConfigurationUtil.generateCacheConfigurationText(configuration, ehcacheConfig); - } - - @Override - public void unlinkCache(String cacheName) { - entityNames.removeCacheName(cacheName); - ClusteredCache cacheEntity = clusteredCacheManagerEntity.getCache(cacheName); - clusteredCacheManagerEntity.releaseCacheUse(cacheEntity); - } - - @Override - public void clusterRejoined() { - synchronized (entityNames) { - String cacheManagerName = entityNames.cacheManagerName; - /* - * There's tricky race condition in the cache manager's initialization that requires a perfectly timed disconnection event plus a rejoin event to happen at the exact right moment. - * - * In a normal scenario, here is what happens when a clustered cache manager gets initialized: - * - * CacheManager.doInit() is called - * then terracottaClient.createClusteredInstanceFactory() is called - * then terracottaClient.getClusteredInstanceFactory().linkClusteredCacheManager(getName(), configuration) is called - * - * If any call in doInit() fails, the ClusteredInstanceFactory gets cleaned up which tears down the L1 (plus other local cleanups). - * - * The linkClusteredCacheManager() call initializes a cacheManagerName variable in ToolkitInstanceFactoryImpl, which is then used later on during a rejoin to tell the entity manager that this cache manager is being released then re-used. - * - * - * Now imagine what would happen in the following scenario: - * - * CacheManager.doInit() is called - * then terracottaClient.createClusteredInstanceFactory() is called and succeeds - * then a disconnection happens - * then terracottaClient.getClusteredInstanceFactory().linkClusteredCacheManager(getName(), configuration) is called and fails, the cacheManagerName variable in ToolkitInstanceFactoryImpl is left to null - * then rejoin happens - * then the clusterRejoined() notification that tries to read the cacheManagerName variable gets called before the doInit() teardown happens - * - * -> you get a NPE from clusterRejoined() - * - * Hence, this null check is about catching this exact event, log it clearly and force shutting down the L1. - */ - if (cacheManagerName == null) { - LOGGER.error("Cache Manager {} linking to the entity manager failed - shutting down to prevent any further use of clustered features", cacheManagerName, entityNames.linkFailure); - shutdown(); - return; - } - - ClusteredCacheManager clusteredCacheManager = clusteredEntityManager.getRootEntity(cacheManagerName, - ClusteredCacheManager.class); - if (clusteredCacheManager == null) { - LOGGER.error("Cache Manager {} has been destroyed by some other node - shutting down to prevent any further use of clustered features", cacheManagerName); - shutdown(); - } else { - // release Cache Manager lock after rejoin - try { - clusteredCacheManager.releaseUse(); - } catch (Exception e) { - // Ignore - just trying to clean up - LOGGER.trace("Exception trying to release cache manager {} after rejoin", entityNames.cacheManagerName); - } - - // release cache read lock after rejoin - for (String cacheName : entityNames.getCacheNames()) { - ClusteredCache cacheEntity = clusteredCacheManagerEntity.getCache(cacheName); - if (cacheEntity != null) { - try { - clusteredCacheManagerEntity.releaseCacheUse(cacheEntity); - } catch (Exception e) { - // Ignore - just trying to clean up - LOGGER.trace("Exception trying to release cache {} after rejoin", cacheName); - } - } - } - - int retryCount = 0; - boolean success = false; - while (retryCount < RETRY_MARK_IN_USE_AFTER_REJOIN) { - // grab Cache Manager read lock after rejoin - try { - clusteredCacheManager.markInUse(); - success = (clusteredEntityManager.getRootEntity(cacheManagerName, ClusteredCacheManager.class) != null); - break; - } catch (Exception e) { - try { - TimeUnit.SECONDS.sleep(1); - } catch (InterruptedException e1) { - // Do nothing - } - retryCount++; - } - } - if (!success) { - LOGGER.error("Unable to mark cache manager {} in use - shutting down to prevent any further use of clustered features", cacheManagerName); - shutdown(); - } else { - // grab cache read lock after rejoin - for (String cacheName : entityNames.getCacheNames()) { - boolean successCache = false; - int retryCountCache = 0; - while (!successCache && retryCountCache < RETRY_MARK_IN_USE_AFTER_REJOIN) { - ClusteredCache cacheEntity = clusteredCacheManagerEntity.getCache(cacheName); - if (cacheEntity == null) { - LOGGER.error("Cache " + cacheName + " has been destroyed by some other node"); - successCache = true; - } else { - try { - clusteredCacheManagerEntity.markCacheInUse(cacheEntity); - successCache = true; - } catch (Exception e) { - try { - TimeUnit.SECONDS.sleep(1); - } catch (InterruptedException e1) { - // Do nothing - } - retryCountCache++; - } - } - } - } - } - } - } - } - - private String convertConfigurationToXMLString(net.sf.ehcache.config.Configuration configuration, String cacheManagerName, boolean stripCacheConfigs) { - net.sf.ehcache.config.Configuration targetConfiguration = cloneConfiguration(configuration); - targetConfiguration.setName(cacheManagerName); - if (stripCacheConfigs) { - targetConfiguration.getCacheConfigurations().clear(); - } - return ConfigurationUtil.generateCacheManagerConfigurationText(targetConfiguration); - } - - private net.sf.ehcache.config.Configuration cloneConfiguration(net.sf.ehcache.config.Configuration configuration) { - String tmp = ConfigurationUtil.generateCacheManagerConfigurationText(configuration); - net.sf.ehcache.config.Configuration targetConfiguration; - targetConfiguration = parseCacheManagerConfiguration(tmp); - return targetConfiguration; - } - - private net.sf.ehcache.config.Configuration parseCacheManagerConfiguration(String xmlCacheManagerConfig) { - net.sf.ehcache.config.Configuration targetConfiguration; - targetConfiguration = ConfigurationFactory.parseConfiguration(new BufferedInputStream(new ByteArrayInputStream(xmlCacheManagerConfig - .getBytes()))); - return targetConfiguration; - } - - private class EntityNamesHolder { - volatile RuntimeException linkFailure; - - private String cacheManagerName; - private final Set cacheNames; - - private EntityNamesHolder() { - cacheNames = new HashSet(); - } - - private synchronized void setCacheManagerName(String cacheMgrName) { - if (cacheManagerName == null) { - cacheManagerName = cacheMgrName; - ToolkitInstanceFactoryImpl.this.clusteredCacheManagerEntity.markInUse(); - } - } - - private synchronized void addCacheName(String cacheName) { - cacheNames.add(cacheName); - } - - private synchronized void removeCacheName(String cacheName) { - cacheNames.remove(cacheName); - } - - private Set getCacheNames() { - return Collections.unmodifiableSet(cacheNames); - } - } - - private static class EhcacheTcConfig { - private enum Type { - URL, EMBEDDED_TC_CONFIG, FILE - } - - private final Type type; - private final String tcConfigUrlOrSnippet; - - private EhcacheTcConfig(Type type, String config) { - this.type = type; - this.tcConfigUrlOrSnippet = config; - } - - public static EhcacheTcConfig create(TerracottaClientConfiguration config) { - if (config.isUrlConfig()) { - String urlOrFilePath = config.getUrl(); - if (isFile(urlOrFilePath)) { - return new EhcacheTcConfig(Type.FILE, slurpFile(urlOrFilePath)); - } else if (isValidURL(urlOrFilePath)) { - return new EhcacheTcConfig(Type.EMBEDDED_TC_CONFIG, fetchConfigFromURL(urlOrFilePath)); - } else { - return new EhcacheTcConfig(Type.URL, urlOrFilePath); - } - } else { - return new EhcacheTcConfig(Type.EMBEDDED_TC_CONFIG, config.getEmbeddedConfig()); - } - } - - private static String slurpFile(String urlOrFilePath) { - try { - return fetchConfigFromStream(new FileInputStream(urlOrFilePath)); - } catch (FileNotFoundException e) { - throw new RuntimeException(e); - } - } - - private static boolean isFile(String urlOrFilePath) { - File file = new File(urlOrFilePath); - return file.exists() && file.isFile(); - } - - private static String fetchConfigFromURL(String urlOrFilePath) { - try { - return fetchConfigFromStream(new URL(urlOrFilePath).openStream()); - } catch (MalformedURLException e) { - throw new RuntimeException(e); - } catch (IOException e) { - throw new RuntimeException(e); - } - } - - private static String fetchConfigFromStream(InputStream inputStream) { - try { - StringBuilder builder = new StringBuilder(); - BufferedReader br = new BufferedReader(new InputStreamReader(inputStream)); - String line = null; - while ((line = br.readLine()) != null) { - builder.append(line); - } - return builder.toString(); - } catch (IOException e) { - throw new RuntimeException(e); - } - } - - private static boolean isValidURL(String urlOrFilePath) { - try { - new URL(urlOrFilePath); - return true; - } catch (MalformedURLException e) { - return false; - } - } - - } -} Index: rctags/ehcache-2.10.9.0.411/system-tests/src/test/java/org/terracotta/ehcache/tests/GetKeysClient.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/system-tests/src/test/java/org/terracotta/ehcache/tests/GetKeysClient.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/system-tests/src/test/java/org/terracotta/ehcache/tests/GetKeysClient.java (revision 0) @@ -1,58 +0,0 @@ -/* - * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved. - */ -package org.terracotta.ehcache.tests; - -import net.sf.ehcache.Cache; -import net.sf.ehcache.Element; - -import org.terracotta.toolkit.Toolkit; - -import java.util.Date; -import java.util.List; -import java.util.concurrent.TimeUnit; - -/** - * @author Chris Dennis - */ -public class GetKeysClient extends ClientBase { - - public static void main(String[] args) { - new GetKeysClient(args).run(); - } - - public GetKeysClient(String[] args) { - super("test", args); - } - - @Override - protected void runTest(Cache cache, Toolkit toolkit) { - cache.put(new Element(new Date(), "now")); - - List keys = cache.getKeys(); - boolean interrupted = false; - try { - long end = System.nanoTime() + TimeUnit.SECONDS.toNanos(30); - while (System.nanoTime() < end && keys.isEmpty()) { - try { - Thread.sleep(1000); - } catch (InterruptedException e) { - interrupted = true; - } - keys = cache.getKeys(); - } - } finally { - if (interrupted) { - Thread.currentThread().interrupt(); - } - } - if (keys.isEmpty()) { - throw new AssertionError(); - } - for (Object key : keys) { - if (!(key instanceof Date)) { - throw new AssertionError("Expected Date type for key"); - } - } - } -} Index: rctags/ehcache-2.10.9.0.411/ehcache-core/src/test/java/net/sf/ehcache/statistics/PassThroughStatisticsTest.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-core/src/test/java/net/sf/ehcache/statistics/PassThroughStatisticsTest.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-core/src/test/java/net/sf/ehcache/statistics/PassThroughStatisticsTest.java (revision 0) @@ -1,82 +0,0 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ -package net.sf.ehcache.statistics; - -import net.sf.ehcache.Cache; -import net.sf.ehcache.CacheManager; -import net.sf.ehcache.Element; -import net.sf.ehcache.config.CacheConfiguration; -import net.sf.ehcache.config.Configuration; -import net.sf.ehcache.statistics.extended.ExtendedStatistics; - -import org.junit.Test; - -import static org.hamcrest.core.Is.*; -import static org.hamcrest.number.OrderingComparison.*; -import static org.junit.Assert.assertThat; - -/** - * - * @author cdennis - */ -public class PassThroughStatisticsTest { - - @Test - public void testGetSize() { - CacheManager manager = new CacheManager(new Configuration().name("foo-manager")); - try { - Cache foo = new Cache(new CacheConfiguration().name("foo").maxEntriesLocalHeap(1000)); - manager.addCache(foo); - - ExtendedStatistics extendedStats = foo.getStatistics().getExtended(); - - assertThat(extendedStats.size().value().longValue(), is(0L)); - - foo.put(new Element("foo", "foo")); - - assertThat(extendedStats.size().value().longValue(), is(1L)); - } finally { - manager.shutdown(); - } - } - - @Test - public void testGetLocalHeapSize() { - CacheManager manager = new CacheManager(new Configuration().name("foo-manager")); - try { - Cache foo = new Cache(new CacheConfiguration().name("foo").maxEntriesLocalHeap(1000)); - manager.addCache(foo); - - ExtendedStatistics extendedStats = foo.getStatistics().getExtended(); - - assertThat(extendedStats.localHeapSize().value().longValue(), is(0L)); - - foo.put(new Element("foo", "foo")); - - assertThat(extendedStats.localHeapSize().value().longValue(), is(1L)); - } finally { - manager.shutdown(); - } - } - - @Test - public void testGetLocalHeapSizeInBytes() { - CacheManager manager = new CacheManager(new Configuration().name("foo-manager")); - try { - Cache foo = new Cache(new CacheConfiguration().name("foo").maxEntriesLocalHeap(1000)); - manager.addCache(foo); - - ExtendedStatistics extendedStats = foo.getStatistics().getExtended(); - - assertThat(extendedStats.localHeapSize().value().longValue(), is(0L)); - - foo.put(new Element("foo", "foo")); - - assertThat(extendedStats.localHeapSizeInBytes().value().longValue(), greaterThan(1L)); - } finally { - manager.shutdown(); - } - } -} Index: rctags/ehcache-2.10.9.0.411/ehcache/src/test/resources/serializedforms/ElementSerializationTest.testBasic.ser =================================================================== diff -u -N -r11412 -r11530 Binary files differ Index: rctags/ehcache-2.10.9.0.411/ehcache-core/src/test/java/net/sf/ehcache/distribution/PayloadUtilPerfTest.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-core/src/test/java/net/sf/ehcache/distribution/PayloadUtilPerfTest.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-core/src/test/java/net/sf/ehcache/distribution/PayloadUtilPerfTest.java (revision 0) @@ -1,94 +0,0 @@ -package net.sf.ehcache.distribution; - -import net.sf.ehcache.StopWatch; -import org.junit.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.IOException; -import java.util.Set; - -import net.sf.ehcache.config.Configuration; -import net.sf.ehcache.config.ConfigurationFactory; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -/** - * @author Alex Snaps - */ -public class PayloadUtilPerfTest { - - private static final Logger LOG = LoggerFactory.getLogger(PayloadUtilPerfTest.class.getName()); - - /** - * 376 µs per one gzipping each time. - * .1 µs if we compare hashCodes on the String and only gzip as necessary. - * - * @throws java.io.IOException - * @throws InterruptedException - */ - @Test - public void testGzipSanityAndPerformance() throws IOException, InterruptedException { - String payload = createReferenceString(); - // warmup vm - for (int i = 0; i < 10; i++) { - byte[] compressed = PayloadUtil.gzip(payload.getBytes()); - // make sure we don't forget to close the stream - assertTrue(compressed.length > 300); - Thread.sleep(20); - } - int hashCode = payload.hashCode(); - StopWatch stopWatch = new StopWatch(); - for (int i = 0; i < 10000; i++) { - if (hashCode != payload.hashCode()) { - PayloadUtil.gzip(payload.getBytes()); - } - } - long elapsed = stopWatch.getElapsedTime(); - LOG.info("Gzip took " + elapsed / 10F + " µs"); - } - - /** - * 169 µs per one. - * - * @throws IOException - * @throws InterruptedException - */ - @Test - public void testUngzipPerformance() throws IOException, InterruptedException { - String payload = createReferenceString(); - int length = payload.toCharArray().length; - byte[] original = payload.getBytes(); - int byteLength = original.length; - assertEquals(length, byteLength); - byte[] compressed = PayloadUtil.gzip(original); - // warmup vm - for (int i = 0; i < 10; i++) { - byte[] uncompressed = PayloadUtil.ungzip(compressed); - uncompressed.hashCode(); - assertEquals(original.length, uncompressed.length); - Thread.sleep(20); - } - StopWatch stopWatch = new StopWatch(); - for (int i = 0; i < 10000; i++) { - PayloadUtil.ungzip(compressed); - } - long elapsed = stopWatch.getElapsedTime(); - LOG.info("Ungzip took " + elapsed / 10000F + " µs"); - } - - private String createReferenceString() { - Configuration config = ConfigurationFactory.parseConfiguration(PayloadUtilPerfTest.class.getResource("/cachemanager-perf.xml")); - Set names = config.getCacheConfigurations().keySet(); - String urlBase = "//localhost.localdomain:12000/"; - StringBuilder buffer = new StringBuilder(); - for (String name : names) { - buffer.append(urlBase); - buffer.append(name); - buffer.append("|"); - } - String payload = buffer.toString(); - return payload; - } - -} Index: rctags/ehcache-2.10.9.0.411/system-tests/src/test/java/org/terracotta/modules/ehcache/hibernate/domain/UuidItem.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/system-tests/src/test/java/org/terracotta/modules/ehcache/hibernate/domain/UuidItem.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/system-tests/src/test/java/org/terracotta/modules/ehcache/hibernate/domain/UuidItem.java (revision 0) @@ -1,29 +0,0 @@ -/* - * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved. - */ -package org.terracotta.modules.ehcache.hibernate.domain; - -public class UuidItem { - private String id; - private String name; - private String description; - - public String getDescription() { - return description; - } - public void setDescription(String description) { - this.description = description; - } - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } -} Index: rctags/ehcache-2.10.9.0.411/ehcache-core/src/test/java/net/sf/ehcache/hibernate/domain/EventManager.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-core/src/test/java/net/sf/ehcache/hibernate/domain/EventManager.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-core/src/test/java/net/sf/ehcache/hibernate/domain/EventManager.java (revision 0) @@ -1,249 +0,0 @@ -/** - * Copyright Terracotta, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package net.sf.ehcache.hibernate.domain; - -import java.util.ArrayList; -import java.util.Date; -import java.util.Iterator; -import java.util.List; -import java.util.ListIterator; - -import org.hibernate.Query; -import org.hibernate.Session; -import org.hibernate.SessionFactory; - -public class EventManager { - - private final SessionFactory sessionFactory; - - public EventManager(SessionFactory sessionFactory) { - this.sessionFactory = sessionFactory; - } - - public List listEmailsOfEvent(Long eventId) { - Session session = sessionFactory.getCurrentSession(); - session.beginTransaction(); - - List emailList = new ArrayList(); - Event event = (Event) session.load(Event.class, eventId); - for (Iterator it = event.getParticipants().iterator(); it.hasNext();) { - Person person = (Person) it.next(); - emailList.addAll(person.getEmailAddresses()); - } - - session.getTransaction().commit(); - return emailList; - } - - public Long createAndStoreEvent(String title, Person organizer, Date theDate) { - - Session session = sessionFactory.getCurrentSession(); - - session.beginTransaction(); - - Event theEvent = new Event(); - theEvent.setTitle(title); - theEvent.setDate(theDate); - theEvent.setOrganizer(organizer); - - Long eventId = (Long) session.save(theEvent); - - session.getTransaction().commit(); - return eventId; - } - - public Long createAndStorePerson(String firstName, String lastName) { - - Session session = sessionFactory.getCurrentSession(); - - session.beginTransaction(); - - Person person = new Person(); - person.setFirstname(firstName); - person.setLastname(lastName); - - Long personId = (Long) session.save(person); - - session.getTransaction().commit(); - return personId; - } - - public Long createAndStorePerson(Person person) { - - Session session = sessionFactory.getCurrentSession(); - - session.beginTransaction(); - - Long personId = (Long) session.save(person); - - session.getTransaction().commit(); - return personId; - } - - public List listEvents() { - - Session session = sessionFactory.getCurrentSession(); - - session.beginTransaction(); - - List result = session.createQuery("from Event").setCacheable(true).list(); - - session.getTransaction().commit(); - - return result; - } - - /** - * Call setEntity() on a cacheable query - see FORGE-265 - */ - public List listEventsOfOrganizer(Person organizer) { - - Session session = sessionFactory.getCurrentSession(); - - session.beginTransaction(); - - Query query = session.createQuery("from Event ev where ev.organizer = :organizer"); - - query.setCacheable(true); - query.setEntity("organizer", organizer); - List result = query.list(); - - session.getTransaction().commit(); - - return result; - } - - /** - * Use a Criteria query - see FORGE-247 - */ - public List listEventsWithCriteria() { - Session session = sessionFactory.getCurrentSession(); - - session.beginTransaction(); - - List result = session.createCriteria(Event.class) - .setCacheable(true) - .list(); - - session.getTransaction().commit(); - - return result; - } - - public void addPersonToEvent(Long personId, Long eventId) { - - Session session = sessionFactory.getCurrentSession(); - session.beginTransaction(); - - Person aPerson = (Person) session.load(Person.class, personId); - Event anEvent = (Event) session.load(Event.class, eventId); - - aPerson.getEvents().add(anEvent); - - session.getTransaction().commit(); - } - - public Long addPersonToAccount(Long personId, Account account) { - Session session = sessionFactory.getCurrentSession(); - session.beginTransaction(); - - Person aPerson = (Person) session.load(Person.class, personId); - account.setPerson(aPerson); - - Long accountId = (Long) session.save(account); - - session.getTransaction().commit(); - return accountId; - } - - public Account getAccount(Long accountId) { - Session session = sessionFactory.getCurrentSession(); - session.beginTransaction(); - - Account account = (Account) session.load(Account.class, accountId); - - session.getTransaction().commit(); - return account; - } - - public void addEmailToPerson(Long personId, String emailAddress) { - - Session session = sessionFactory.getCurrentSession(); - session.beginTransaction(); - - Person aPerson = (Person) session.load(Person.class, personId); - - // The getEmailAddresses() might trigger a lazy load of the collection - aPerson.getEmailAddresses().add(emailAddress); - - session.getTransaction().commit(); - } - - public void addPhoneNumberToPerson(Long personId, PhoneNumber pN) { - - Session session = sessionFactory.getCurrentSession(); - session.beginTransaction(); - - Person aPerson = (Person) session.load(Person.class, personId); - pN.setPersonId(personId.longValue()); - aPerson.getPhoneNumbers().add(pN); - - session.getTransaction().commit(); - } - - public void addTalismanToPerson(Long personId, String talisman) { - - Session session = sessionFactory.getCurrentSession(); - session.beginTransaction(); - - Person aPerson = (Person) session.load(Person.class, personId); - aPerson.addTalisman(talisman); - - session.getTransaction().commit(); - } - - public Long createHolidayCalendar() { - - Session session = sessionFactory.getCurrentSession(); - session.beginTransaction(); - - // delete all existing calendars - List calendars = session.createQuery("from HolidayCalendar").setCacheable(true).list(); - for (ListIterator li = calendars.listIterator(); li.hasNext();) { - session.delete(li.next()); - } - - HolidayCalendar calendar = new HolidayCalendar(); - calendar.init(); - - Long calendarId = (Long) session.save(calendar); - - session.getTransaction().commit(); - return calendarId; - } - - public HolidayCalendar getHolidayCalendar() { - Session session = sessionFactory.getCurrentSession(); - - session.beginTransaction(); - - List calendars = session.createQuery("from HolidayCalendar").setCacheable(true).list(); - - session.getTransaction().commit(); - - return calendars.isEmpty() ? null : (HolidayCalendar) calendars.get(0); - } -} Index: rctags/ehcache-2.10.9.0.411/ehcache-core/src/test/java/net/sf/ehcache/config/generator/AttributeIgnoringXMLGenerator.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-core/src/test/java/net/sf/ehcache/config/generator/AttributeIgnoringXMLGenerator.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-core/src/test/java/net/sf/ehcache/config/generator/AttributeIgnoringXMLGenerator.java (revision 0) @@ -1,45 +0,0 @@ -/** - * Copyright Terracotta, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package net.sf.ehcache.config.generator; - -import java.io.PrintWriter; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Set; - -import net.sf.ehcache.config.generator.model.NodeAttribute; -import net.sf.ehcache.config.generator.model.NodeElement; -import net.sf.ehcache.config.generator.model.XMLGeneratorVisitor; - -public class AttributeIgnoringXMLGenerator extends XMLGeneratorVisitor { - - private final Set ignoredAttributes; - - public AttributeIgnoringXMLGenerator(PrintWriter out, String... ignoredAttributes) { - super(out); - this.ignoredAttributes = new HashSet(Arrays.asList(ignoredAttributes)); - } - - @Override - protected void visitAttribute(NodeElement element, NodeAttribute attribute) { - if (ignoredAttributes.contains(attribute.getName())) { - return; - } - super.visitAttribute(element, attribute); - } - -} Index: rctags/ehcache-2.10.9.0.411/system-tests/src/test/resources/http-url-config-cache-test.xml =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/system-tests/src/test/resources/http-url-config-cache-test.xml (revision 11412) +++ rctags/ehcache-2.10.9.0.411/system-tests/src/test/resources/http-url-config-cache-test.xml (revision 0) @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - Index: rctags/ehcache-2.10.9.0.411/ehcache-scheduled-refresh/src/main/java/net/sf/ehcache/constructs/scheduledrefresh/ScheduledRefreshCacheExtensionFactory.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-scheduled-refresh/src/main/java/net/sf/ehcache/constructs/scheduledrefresh/ScheduledRefreshCacheExtensionFactory.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-scheduled-refresh/src/main/java/net/sf/ehcache/constructs/scheduledrefresh/ScheduledRefreshCacheExtensionFactory.java (revision 0) @@ -1,48 +0,0 @@ -/** - * Copyright Terracotta, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package net.sf.ehcache.constructs.scheduledrefresh; - -import net.sf.ehcache.Ehcache; -import net.sf.ehcache.extension.CacheExtension; -import net.sf.ehcache.extension.CacheExtensionFactory; - -import java.util.Properties; - -/** - * Factory class for generating instances of - * {@link ScheduledRefreshCacheExtension}. This is the class used in the - * ehcache.xml file to add and extension to a cache. - * - * @author cschanck - */ -public class ScheduledRefreshCacheExtensionFactory extends CacheExtensionFactory { - /** - * No arg constructor. - */ - public ScheduledRefreshCacheExtensionFactory() { - super(); - } - - /** - * {@inheritDoc} - */ - @Override - public CacheExtension createCacheExtension(Ehcache cache, Properties properties) { - ScheduledRefreshConfiguration config = new ScheduledRefreshConfiguration().fromProperties(properties).build(); - return new ScheduledRefreshCacheExtension(config, cache); - } - -} Index: rctags/ehcache-2.10.9.0.411/terracotta/bootstrap/src/main/java/org/terracotta/modules/ehcache/async/exceptions/ProcessingException.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/terracotta/bootstrap/src/main/java/org/terracotta/modules/ehcache/async/exceptions/ProcessingException.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/terracotta/bootstrap/src/main/java/org/terracotta/modules/ehcache/async/exceptions/ProcessingException.java (revision 0) @@ -1,11 +0,0 @@ -/* - * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved. - */ -package org.terracotta.modules.ehcache.async.exceptions; - - -public class ProcessingException extends AsyncException { - public ProcessingException(final String msg, final Throwable cause) { - super(msg, cause); - } -} Index: rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/constructs/EhcacheDecoratorAdapter.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/constructs/EhcacheDecoratorAdapter.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/constructs/EhcacheDecoratorAdapter.java (revision 0) @@ -1,857 +0,0 @@ -/** - * Copyright Terracotta, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package net.sf.ehcache.constructs; - -import java.beans.PropertyChangeListener; -import java.io.Serializable; -import java.util.Collection; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import net.sf.ehcache.CacheException; -import net.sf.ehcache.CacheManager; -import net.sf.ehcache.Ehcache; -import net.sf.ehcache.Element; -import net.sf.ehcache.Status; -import net.sf.ehcache.bootstrap.BootstrapCacheLoader; -import net.sf.ehcache.config.CacheConfiguration; -import net.sf.ehcache.event.RegisteredEventListeners; -import net.sf.ehcache.exceptionhandler.CacheExceptionHandler; -import net.sf.ehcache.extension.CacheExtension; -import net.sf.ehcache.loader.CacheLoader; -import net.sf.ehcache.search.Attribute; -import net.sf.ehcache.search.Query; -import net.sf.ehcache.search.attribute.DynamicAttributesExtractor; -import net.sf.ehcache.statistics.StatisticsGateway; -import net.sf.ehcache.terracotta.InternalEhcache; -import net.sf.ehcache.terracotta.TerracottaNotRunningException; -import net.sf.ehcache.transaction.manager.TransactionManagerLookup; -import net.sf.ehcache.writer.CacheWriter; -import net.sf.ehcache.writer.CacheWriterManager; -import org.terracotta.statistics.StatisticsManager; - -/** - * Adapter class for Ehcache interface decorators. Implements all method in {@link Ehcache} by delegating all calls to the decorated - * {@link Ehcache}. This class is provided as a convenience for easily creating {@link Ehcache} decorators by extending this class and - * overriding only the methods of interest. - * - * @author Abhishek Sanoujam - * - */ -public class EhcacheDecoratorAdapter implements InternalEhcache { - - /** - * The decorated {@link Ehcache}, has protected visibility so that sub-classes can have access to it. - */ - protected final Ehcache underlyingCache; - - /** - * Constructor accepting the cache to be decorated - * - * @param underlyingCache - */ - public EhcacheDecoratorAdapter(Ehcache underlyingCache) { - if (underlyingCache == null) { - throw new NullPointerException("Underlying cache cannot be null"); - } - StatisticsManager.associate(this).withParent(underlyingCache); - this.underlyingCache = underlyingCache; - } - - /** - * {@inheritDoc} - */ - public Element get(Object key) throws IllegalStateException, CacheException { - return underlyingCache.get(key); - } - - /** - * {@inheritDoc} - */ - public Map getAll(Collection keys) throws IllegalStateException, CacheException { - return underlyingCache.getAll(keys); - } - - /** - * {@inheritDoc} - */ - public Element get(Serializable key) throws IllegalStateException, CacheException { - return underlyingCache.get(key); - } - - /** - * {@inheritDoc} - */ - public Element getQuiet(Object key) throws IllegalStateException, CacheException { - return underlyingCache.getQuiet(key); - } - - /** - * {@inheritDoc} - */ - public Element getQuiet(Serializable key) throws IllegalStateException, CacheException { - return underlyingCache.getQuiet(key); - } - - /** - * {@inheritDoc} - */ - public void put(Element element, boolean doNotNotifyCacheReplicators) throws IllegalArgumentException, IllegalStateException, - CacheException { - underlyingCache.put(element, doNotNotifyCacheReplicators); - } - - /** - * {@inheritDoc} - */ - public void put(Element element) throws IllegalArgumentException, IllegalStateException, CacheException { - underlyingCache.put(element); - } - - /** - * {@inheritDoc} - */ - public void putAll(Collection elements) throws IllegalArgumentException, IllegalStateException, CacheException { - underlyingCache.putAll(elements); - } - - /** - * {@inheritDoc} - */ - public void putQuiet(Element element) throws IllegalArgumentException, IllegalStateException, CacheException { - underlyingCache.putQuiet(element); - } - - /** - * {@inheritDoc} - */ - public void putWithWriter(Element element) throws IllegalArgumentException, IllegalStateException, CacheException { - underlyingCache.putWithWriter(element); - } - - /** - * {@inheritDoc} - */ - public boolean remove(Object key, boolean doNotNotifyCacheReplicators) throws IllegalStateException { - return underlyingCache.remove(key, doNotNotifyCacheReplicators); - } - - /** - * {@inheritDoc} - */ - public boolean remove(Object key) throws IllegalStateException { - return underlyingCache.remove(key); - } - - /** - * {@inheritDoc} - */ - public void removeAll(Collection keys) throws IllegalStateException { - underlyingCache.removeAll(keys); - } - - /** - * {@inheritDoc} - */ - public void removeAll(Collection keys, boolean doNotNotifyCacheReplicators) throws IllegalStateException { - underlyingCache.removeAll(keys, doNotNotifyCacheReplicators); - } - - /** - * {@inheritDoc} - */ - public boolean remove(Serializable key, boolean doNotNotifyCacheReplicators) throws IllegalStateException { - return underlyingCache.remove(key, doNotNotifyCacheReplicators); - } - - /** - * {@inheritDoc} - */ - public boolean remove(Serializable key) throws IllegalStateException { - return underlyingCache.remove(key); - } - - /** - * {@inheritDoc} - */ - public void removeAll() throws IllegalStateException, CacheException { - underlyingCache.removeAll(); - } - - /** - * {@inheritDoc} - */ - public void removeAll(boolean doNotNotifyCacheReplicators) throws IllegalStateException, CacheException { - underlyingCache.removeAll(doNotNotifyCacheReplicators); - } - - /** - * {@inheritDoc} - */ - public void bootstrap() { - underlyingCache.bootstrap(); - } - - /** - * {@inheritDoc} - */ - @Deprecated public long calculateInMemorySize() throws IllegalStateException, CacheException { - return underlyingCache.calculateInMemorySize(); - } - - /** - * {@inheritDoc} - */ - @Deprecated public long calculateOffHeapSize() throws IllegalStateException, CacheException { - return underlyingCache.calculateOffHeapSize(); - } - - /** - * {@inheritDoc} - */ - @Deprecated public long calculateOnDiskSize() throws IllegalStateException, CacheException { - return underlyingCache.calculateOnDiskSize(); - } - - /** - * {@inheritDoc} - */ - public boolean hasAbortedSizeOf() { - return underlyingCache.hasAbortedSizeOf(); - } - - /** - * {@inheritDoc} - */ - public void disableDynamicFeatures() { - underlyingCache.disableDynamicFeatures(); - } - - /** - * {@inheritDoc} - */ - public void dispose() throws IllegalStateException { - underlyingCache.dispose(); - } - - /** - * {@inheritDoc} - */ - public void evictExpiredElements() { - underlyingCache.evictExpiredElements(); - } - - /** - * {@inheritDoc} - */ - public void flush() throws IllegalStateException, CacheException { - underlyingCache.flush(); - } - - /** - * {@inheritDoc} - */ - public Element getWithLoader(Object key, CacheLoader loader, Object loaderArgument) throws CacheException { - return underlyingCache.getWithLoader(key, loader, loaderArgument); - } - - /** - * {@inheritDoc} - */ - public Map getAllWithLoader(Collection keys, Object loaderArgument) throws CacheException { - return underlyingCache.getAllWithLoader(keys, loaderArgument); - } - - /** - * {@inheritDoc} - */ - public void registerCacheLoader(CacheLoader cacheLoader) { - underlyingCache.registerCacheLoader(cacheLoader); - } - - /** - * {@inheritDoc} - */ - public void unregisterCacheLoader(CacheLoader cacheLoader) { - underlyingCache.unregisterCacheLoader(cacheLoader); - } - - /** - * {@inheritDoc} - */ - public void load(Object key) throws CacheException { - underlyingCache.load(key); - } - - /** - * {@inheritDoc} - */ - public void loadAll(Collection keys, Object argument) throws CacheException { - underlyingCache.loadAll(keys, argument); - } - - /** - * {@inheritDoc} - */ - public BootstrapCacheLoader getBootstrapCacheLoader() { - return underlyingCache.getBootstrapCacheLoader(); - } - - /** - * {@inheritDoc} - */ - public CacheConfiguration getCacheConfiguration() { - return underlyingCache.getCacheConfiguration(); - } - - /** - * {@inheritDoc} - */ - public RegisteredEventListeners getCacheEventNotificationService() { - return underlyingCache.getCacheEventNotificationService(); - } - - /** - * {@inheritDoc} - */ - public CacheExceptionHandler getCacheExceptionHandler() { - return underlyingCache.getCacheExceptionHandler(); - } - - /** - * {@inheritDoc} - */ - public CacheManager getCacheManager() { - return underlyingCache.getCacheManager(); - } - - /** - * {@inheritDoc} - */ - @Deprecated public long getOffHeapStoreSize() throws IllegalStateException { - return underlyingCache.getOffHeapStoreSize(); - } - - /** - * {@inheritDoc} - */ - @Deprecated public int getDiskStoreSize() throws IllegalStateException { - return underlyingCache.getDiskStoreSize(); - } - - /** - * {@inheritDoc} - */ - public String getGuid() { - return underlyingCache.getGuid(); - } - - /** - * {@inheritDoc} - */ - public Object getInternalContext() { - return underlyingCache.getInternalContext(); - } - - /** - * {@inheritDoc} - */ - public List getKeys() throws IllegalStateException, CacheException { - return underlyingCache.getKeys(); - } - - /** - * {@inheritDoc} - */ - public List getKeysNoDuplicateCheck() throws IllegalStateException { - return underlyingCache.getKeysNoDuplicateCheck(); - } - - /** - * {@inheritDoc} - */ - public List getKeysWithExpiryCheck() throws IllegalStateException, CacheException { - return underlyingCache.getKeysWithExpiryCheck(); - } - - /** - * {@inheritDoc} - */ - @Deprecated public long getMemoryStoreSize() throws IllegalStateException { - return underlyingCache.getMemoryStoreSize(); - } - - /** - * {@inheritDoc} - */ - public String getName() { - return underlyingCache.getName(); - } - - /** - * {@inheritDoc} - */ - public List getRegisteredCacheExtensions() { - return underlyingCache.getRegisteredCacheExtensions(); - } - - /** - * {@inheritDoc} - */ - public List getRegisteredCacheLoaders() { - return underlyingCache.getRegisteredCacheLoaders(); - } - - /** - * {@inheritDoc} - */ - public CacheWriter getRegisteredCacheWriter() { - return underlyingCache.getRegisteredCacheWriter(); - } - - /** - * {@inheritDoc} - */ - public int getSize() throws IllegalStateException, CacheException { - return underlyingCache.getSize(); - } - - /** - * {@inheritDoc} - */ - public Status getStatus() { - return underlyingCache.getStatus(); - } - - /** - * {@inheritDoc} - */ - public CacheWriterManager getWriterManager() { - return underlyingCache.getWriterManager(); - } - - /** - * {@inheritDoc} - */ - public void initialise() { - underlyingCache.initialise(); - } - - /** - * {@inheritDoc} - * - * @deprecated Use {@link #isClusterBulkLoadEnabled()} instead - */ - @Deprecated - public boolean isClusterCoherent() { - return underlyingCache.isClusterCoherent(); - } - - /** - * {@inheritDoc} - */ - public boolean isDisabled() { - return underlyingCache.isDisabled(); - } - - /** - * {@inheritDoc} - */ - public boolean isElementInMemory(Object key) { - return underlyingCache.isElementInMemory(key); - } - - /** - * {@inheritDoc} - */ - public boolean isElementInMemory(Serializable key) { - return underlyingCache.isElementInMemory(key); - } - - /** - * {@inheritDoc} - */ - public boolean isElementOnDisk(Object key) { - return underlyingCache.isElementOnDisk(key); - } - - /** - * {@inheritDoc} - */ - public boolean isElementOnDisk(Serializable key) { - return underlyingCache.isElementOnDisk(key); - } - - /** - * {@inheritDoc} - */ - public boolean isExpired(Element element) throws IllegalStateException, NullPointerException { - return underlyingCache.isExpired(element); - } - - /** - * {@inheritDoc} - */ - public boolean isKeyInCache(Object key) { - return underlyingCache.isKeyInCache(key); - } - - /** - * {@inheritDoc} - * - * @deprecated Use {@link #isNodeBulkLoadEnabled()} instead - */ - @Deprecated - public boolean isNodeCoherent() { - return underlyingCache.isNodeCoherent(); - } - - /** - * {@inheritDoc} - */ - public boolean isValueInCache(Object value) { - return underlyingCache.isValueInCache(value); - } - - /** - * {@inheritDoc} - */ - public void registerCacheExtension(CacheExtension cacheExtension) { - underlyingCache.registerCacheExtension(cacheExtension); - } - - /** - * {@inheritDoc} - */ - public void registerCacheWriter(CacheWriter cacheWriter) { - underlyingCache.registerCacheWriter(cacheWriter); - } - - - /** - * {@inheritDoc} - */ - public void registerDynamicAttributesExtractor(DynamicAttributesExtractor extractor) { - underlyingCache.registerDynamicAttributesExtractor(extractor); - } - - /** - * {@inheritDoc} - */ - public boolean removeQuiet(Object key) throws IllegalStateException { - return underlyingCache.removeQuiet(key); - } - - /** - * {@inheritDoc} - */ - public boolean removeQuiet(Serializable key) throws IllegalStateException { - return underlyingCache.removeQuiet(key); - } - - /** - * {@inheritDoc} - */ - public boolean removeWithWriter(Object key) throws IllegalStateException, CacheException { - return underlyingCache.removeWithWriter(key); - } - - /** - * {@inheritDoc} - */ - public void setBootstrapCacheLoader(BootstrapCacheLoader bootstrapCacheLoader) throws CacheException { - underlyingCache.setBootstrapCacheLoader(bootstrapCacheLoader); - } - - /** - * {@inheritDoc} - */ - public void setCacheExceptionHandler(CacheExceptionHandler cacheExceptionHandler) { - underlyingCache.setCacheExceptionHandler(cacheExceptionHandler); - } - - /** - * {@inheritDoc} - */ - public void setCacheManager(CacheManager cacheManager) { - underlyingCache.setCacheManager(cacheManager); - } - - /** - * {@inheritDoc} - */ - public void setDisabled(boolean disabled) { - underlyingCache.setDisabled(disabled); - } - - /** - * {@inheritDoc} - */ - public void setName(String name) { - underlyingCache.setName(name); - } - - /** - * {@inheritDoc} - * - * @deprecated Use {@link #setNodeBulkLoadEnabled(boolean)} instead - */ - @Deprecated - public void setNodeCoherent(boolean coherent) throws UnsupportedOperationException { - underlyingCache.setNodeCoherent(coherent); - } - - /** - * {@inheritDoc} - */ - public void setTransactionManagerLookup(TransactionManagerLookup transactionManagerLookup) { - underlyingCache.setTransactionManagerLookup(transactionManagerLookup); - } - - /** - * {@inheritDoc} - */ - public void unregisterCacheExtension(CacheExtension cacheExtension) { - underlyingCache.unregisterCacheExtension(cacheExtension); - } - - /** - * {@inheritDoc} - */ - public void unregisterCacheWriter() { - underlyingCache.unregisterCacheWriter(); - } - - /** - * {@inheritDoc} - * - * @deprecated Use {@link #waitUntilClusterBulkLoadComplete()} instead - */ - @Deprecated - public void waitUntilClusterCoherent() throws UnsupportedOperationException { - underlyingCache.waitUntilClusterCoherent(); - } - - /** - * {@inheritDoc} - */ - @Override - public Object clone() throws CloneNotSupportedException { - return super.clone(); - } - - /** - * {@inheritDoc} - */ - public Element putIfAbsent(Element element) throws NullPointerException { - return underlyingCache.putIfAbsent(element); - } - - @Override - public Element putIfAbsent(final Element element, final boolean doNotNotifyCacheReplicators) throws NullPointerException { - return underlyingCache.putIfAbsent(element, doNotNotifyCacheReplicators); - } - - /** - * {@inheritDoc} - */ - public boolean removeElement(Element element) throws NullPointerException { - return underlyingCache.removeElement(element); - } - - /** - * {@inheritDoc} - */ - public boolean replace(Element old, Element element) throws NullPointerException, IllegalArgumentException { - return underlyingCache.replace(old, element); - } - - /** - * {@inheritDoc} - */ - public Element replace(Element element) throws NullPointerException { - return underlyingCache.replace(element); - } - - /** - * {@inheritDoc} - * - * @see net.sf.ehcache.Ehcache#addPropertyChangeListener(java.beans.PropertyChangeListener) - */ - public void addPropertyChangeListener(PropertyChangeListener listener) { - underlyingCache.addPropertyChangeListener(listener); - } - - /** - * {@inheritDoc} - * - * @see net.sf.ehcache.Ehcache#removePropertyChangeListener(java.beans.PropertyChangeListener) - */ - public void removePropertyChangeListener(PropertyChangeListener listener) { - underlyingCache.addPropertyChangeListener(listener); - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return underlyingCache.toString(); - } - - /** - * {@inheritDoc} - */ - public Query createQuery() { - return underlyingCache.createQuery(); - } - - /** - * {@inheritDoc} - */ - public Attribute getSearchAttribute(String attributeName) throws CacheException { - return underlyingCache.getSearchAttribute(attributeName); - } - - @Override - public Set getSearchAttributes() throws CacheException { - return underlyingCache.getSearchAttributes(); - } - - /** - * {@inheritDoc} - */ - public boolean isSearchable() { - return underlyingCache.isSearchable(); - } - - /** - * {@inheritDoc} - */ - public void acquireReadLockOnKey(Object key) { - underlyingCache.acquireReadLockOnKey(key); - } - - /** - * {@inheritDoc} - */ - public void acquireWriteLockOnKey(Object key) { - underlyingCache.acquireWriteLockOnKey(key); - } - - /** - * {@inheritDoc} - */ - public void releaseReadLockOnKey(Object key) { - underlyingCache.releaseReadLockOnKey(key); - } - - /** - * {@inheritDoc} - */ - public void releaseWriteLockOnKey(Object key) { - underlyingCache.releaseWriteLockOnKey(key); - } - - /** - * {@inheritDoc} - */ - public boolean tryReadLockOnKey(Object key, long timeout) throws InterruptedException { - return underlyingCache.tryReadLockOnKey(key, timeout); - } - - /** - * {@inheritDoc} - */ - public boolean tryWriteLockOnKey(Object key, long timeout) throws InterruptedException { - return underlyingCache.tryWriteLockOnKey(key, timeout); - } - - /** - * {@inheritDoc} - */ - public boolean isReadLockedByCurrentThread(Object key) { - return underlyingCache.isReadLockedByCurrentThread(key); - } - - /** - * {@inheritDoc} - */ - public boolean isWriteLockedByCurrentThread(Object key) { - return underlyingCache.isWriteLockedByCurrentThread(key); - } - - /** - * {@inheritDoc} - */ - public boolean isClusterBulkLoadEnabled() throws UnsupportedOperationException, TerracottaNotRunningException { - return underlyingCache.isClusterBulkLoadEnabled(); - } - - /** - * {@inheritDoc} - */ - public boolean isNodeBulkLoadEnabled() throws UnsupportedOperationException, TerracottaNotRunningException { - return underlyingCache.isNodeBulkLoadEnabled(); - } - - /** - * {@inheritDoc} - */ - public void setNodeBulkLoadEnabled(boolean enabledBulkLoad) throws UnsupportedOperationException, TerracottaNotRunningException { - underlyingCache.setNodeBulkLoadEnabled(enabledBulkLoad); - } - - /** - * {@inheritDoc} - */ - public void waitUntilClusterBulkLoadComplete() throws UnsupportedOperationException, TerracottaNotRunningException { - underlyingCache.waitUntilClusterBulkLoadComplete(); - } - - private InternalEhcache asInternalEhcache() { - return (InternalEhcache) underlyingCache; - } - - /** - * {@inheritDoc} - */ - public Element removeAndReturnElement(Object key) throws IllegalStateException { - if (underlyingCache instanceof InternalEhcache) { - return asInternalEhcache().removeAndReturnElement(key); - } else { - throw new UnsupportedOperationException(); - } - } - - /** - * {@inheritDoc} - */ - public void recalculateSize(Object key) { - if (underlyingCache instanceof InternalEhcache) { - asInternalEhcache().recalculateSize(key); - } else { - throw new UnsupportedOperationException(); - } - } - - @Override - public StatisticsGateway getStatistics() throws IllegalStateException { - return underlyingCache.getStatistics(); - } -} Index: rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/store/DefaultElementValueComparator.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/store/DefaultElementValueComparator.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/store/DefaultElementValueComparator.java (revision 0) @@ -1,68 +0,0 @@ -/** - * Copyright Terracotta, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package net.sf.ehcache.store; - -import net.sf.ehcache.Element; -import net.sf.ehcache.config.CacheConfiguration; - -import java.util.Arrays; - -/** - * DefaultElementValueComparator does compare the values on the two elements - * based on their {@link Object#equals(Object) equals} contract - * - * @author Ludovic Orban - */ -public class DefaultElementValueComparator implements ElementValueComparator { - - /** - * Constructor - * - * @param cacheConfiguration the cache configuration - */ - public DefaultElementValueComparator(CacheConfiguration cacheConfiguration) { - } - - /** - * {@inheritDoc} - */ - public boolean equals(Element e1, Element e2) { - if (e1 == null && e2 == null) { - return true; - } else if (e1 != null && e1.equals(e2)) { - if (e1.getObjectValue() == null) { - return e2.getObjectValue() == null; - } else { - return compareValues(e1.getObjectValue(), e2.getObjectValue()); - } - } else { - return false; - } - } - - private static boolean compareValues(Object objectValue1, Object objectValue2) { - if (objectValue1 != null && objectValue2 != null && objectValue1.getClass().isArray() && objectValue2.getClass().isArray()) { - return Arrays.deepEquals(new Object[] {objectValue1}, new Object[] {objectValue2}); - } else { - if (objectValue1 == null) { - return objectValue2 == null; - } else { - return objectValue1.equals(objectValue2); - } - } - } - -} Index: rctags/ehcache-2.10.9.0.411/ehcache-core/src/test/java/net/sf/ehcache/DiskStoreLimitTest.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-core/src/test/java/net/sf/ehcache/DiskStoreLimitTest.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-core/src/test/java/net/sf/ehcache/DiskStoreLimitTest.java (revision 0) @@ -1,55 +0,0 @@ -package net.sf.ehcache; - -import net.sf.ehcache.config.CacheConfiguration; -import net.sf.ehcache.config.Configuration; -import net.sf.ehcache.config.DiskStoreConfiguration; -import net.sf.ehcache.config.MemoryUnit; -import net.sf.ehcache.config.PersistenceConfiguration; -import net.sf.ehcache.store.disk.DiskStoreHelper; - -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.TemporaryFolder; - -import java.io.File; - -import static org.hamcrest.Matchers.lessThan; -import static org.junit.Assert.assertThat; - -public class DiskStoreLimitTest { - - @Rule - public TemporaryFolder tempFolder = new TemporaryFolder(); - - @Test - public void testDiskSizeWhenOversizedDueToPinning() throws Exception { - long maxBytesLocalDisk = 10000L; - File storeFolder = tempFolder.newFolder(); - - CacheManager cm = CacheManager.create(new Configuration() - .diskStore(new DiskStoreConfiguration().path(storeFolder.getAbsolutePath()))); - CacheConfiguration config = new CacheConfiguration() - .name("disk-over-size") - .maxEntriesLocalHeap(35) - .maxBytesLocalDisk(maxBytesLocalDisk, MemoryUnit.BYTES) - .persistence(new PersistenceConfiguration().strategy(PersistenceConfiguration.Strategy.LOCALTEMPSWAP)); - Cache cache = new Cache(config); - cm.addCache(cache); - - for (int i = 0; i < 200; i++) { - Element element = new Element(i, "Object" + i); - cache.put(element); - DiskStoreHelper.flushAllEntriesToDisk(cache).get(); - } - - int cacheSize = cache.getSize(); - File cacheFile = new File(storeFolder, cache.getName() + ".data"); - long onDiskLength = cacheFile.length(); - - DiskStoreHelper.flushAllEntriesToDisk(cache).get(); - System.out.println("Num elements in cache = " + cacheSize); - System.out.println("Disk store size (bytes):" + cache.getStatistics().getLocalDiskSizeInBytes()); - assertThat(onDiskLength, lessThan((long) (maxBytesLocalDisk * 1.15))); - cm.shutdown(); - } -} Index: rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/transaction/manager/package.html =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/transaction/manager/package.html (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/transaction/manager/package.html (revision 0) @@ -1,7 +0,0 @@ - - - - - This package contains the ehcache lookup interface for the supported JTA transaction managers. - - Index: rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/bootstrap/BootstrapCacheLoaderFactory.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/bootstrap/BootstrapCacheLoaderFactory.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/bootstrap/BootstrapCacheLoaderFactory.java (revision 0) @@ -1,92 +0,0 @@ -/** - * Copyright Terracotta, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package net.sf.ehcache.bootstrap; - -import net.sf.ehcache.util.PropertyUtil; - -import java.util.Properties; - -/** - * An abstract factory for creating BootstrapCacheLoader instances. Implementers should provide their own - * concrete factory extending this factory. It can then be configured in ehcache.xml. - * - * @param The BootstrapCacheLoader type this Factory will create - * @author Greg Luck - * @version $Id: BootstrapCacheLoaderFactory.java 5594 2012-05-07 16:04:31Z cdennis $ - */ -public abstract class BootstrapCacheLoaderFactory { - - /** - * The property name expected in ehcache.xml for the bootstrap asyncrhonously switch. - */ - public static final String BOOTSTRAP_ASYNCHRONOUSLY = "bootstrapAsynchronously"; - - /** - * Create a BootstrapCacheLoader - * - * @param properties implementation specific properties. These are configured as comma - * separated name value pairs in ehcache.xml - * @return a constructed BootstrapCacheLoader - */ - public abstract T createBootstrapCacheLoader(Properties properties); - - /** - * Extracts the value of bootstrapAsynchronously from the properties - * - * @param properties the properties passed by the CacheManager, read from the configuration file - * @return true if to be bootstrapped asynchronously, false otherwise - */ - protected boolean extractBootstrapAsynchronously(Properties properties) { - return extractBoolean(properties, BOOTSTRAP_ASYNCHRONOUSLY, true); - } - - /** - * Will retrieve the boolean value from the properties, defaulting if property isn't present - * @param properties the properties to use - * @param prop the property name to look for - * @param defaultValue the default value if property is missing - * @return the value, or it's default, for the property - */ - protected boolean extractBoolean(final Properties properties, final String prop, final boolean defaultValue) { - boolean value; - String propString = PropertyUtil.extractAndLogProperty(prop, properties); - if (propString != null) { - value = PropertyUtil.parseBoolean(propString); - } else { - value = defaultValue; - } - return value; - } - - /** - * Will retrieve the boolean value from the properties, defaulting if property isn't present - * @param properties the properties to use - * @param prop the property name to look for - * @param defaultValue the default value if property is missing - * @return the value, or it's default, for the property - */ - protected long extractLong(final Properties properties, final String prop, final long defaultValue) { - long value; - String propString = PropertyUtil.extractAndLogProperty(prop, properties); - if (propString != null) { - value = Long.parseLong(propString); - } else { - value = defaultValue; - } - return value; - } -} Index: rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/util/lang/VicariousThreadLocal.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/util/lang/VicariousThreadLocal.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/util/lang/VicariousThreadLocal.java (revision 0) @@ -1,218 +0,0 @@ -/** - * Copyright 2006 Thomas Hawtin - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package net.sf.ehcache.util.lang; - -import java.lang.ref.ReferenceQueue; -import java.lang.ref.WeakReference; -import java.util.concurrent.atomic.AtomicReferenceFieldUpdater; - -/** - * A drop-in replacement {@code ThreadLocal} implementation that does not leak - * when thread-local values reference the {@code ThreadLocal} object. - * The code is optimised to cope with frequently changing values. - *

- * In comparison to plain {@code ThreadLocal}, this implementation:

    - *
  • from the point of view of a single thread, - * each thread-local - * {code #get} requires access to four objects instead of two - *
  • is fractionally slower in terms of CPU cycles for {code #get} - *
  • uses around twice the memory for each thead-local value - *
  • uses around four times the memory for each {@code ThreadLocal} - *
  • may release thread-local values for garbage collection more promptly - *
- */ -public class VicariousThreadLocal extends ThreadLocal { - /** - * Maps a unique WeakReference onto each Thread. - */ - private static final ThreadLocal> weakThread = - new ThreadLocal>(); - - /** - * Returns a unique object representing the current thread. - * Although we use a weak-reference to the thread, - * we could use practically anything - * that does not reference our class-loader. - */ - static WeakReference currentThreadRef() { - WeakReference ref = weakThread.get(); - if (ref == null) { - ref = new WeakReference(Thread.currentThread()); - weakThread.set(ref); - } - return ref; - } - - /** - * Object representing an uninitialised value. - */ - private static final Object UNINITIALISED = new Object(); - - /** - * Actual ThreadLocal implementation object. - */ - private final ThreadLocal> local = - new ThreadLocal>(); - - /** - * Maintains a strong reference to value for each thread, - * so long as the Thread has not been collected. - * Note, alive Threads strongly references the WeakReference<Thread> - * through weakThread. - */ - private volatile Holder strongRefs; - - /** - * Compare-and-set of {@link #strongRefs}. - */ - private static final AtomicReferenceFieldUpdater strongRefsUpdater = - AtomicReferenceFieldUpdater.newUpdater(VicariousThreadLocal.class, Holder.class, "strongRefs"); - - /** - * Queue of Holders belonging to exited threads. - */ - private final ReferenceQueue queue = new ReferenceQueue(); - - /** - * Creates a new {@code VicariousThreadLocal}. - */ - public VicariousThreadLocal() { - // - } - - @SuppressWarnings("unchecked") - @Override - public T get() { - final Holder holder; - WeakReference ref = local.get(); - if (ref != null) { - holder = ref.get(); - Object value = holder.value; - if (value != UNINITIALISED) { - return (T)value; - } - } else { - holder = createHolder(); - } - T value = initialValue(); - holder.value = value; - return value; - } - - @Override - public void set(T value) { - WeakReference ref = local.get(); - final Holder holder = - ref != null ? ref.get() : createHolder(); - holder.value = value; - } - - /** - * Creates a new holder object, and registers it appropriately. - * Also polls for thread-exits. - */ - private Holder createHolder() { - poll(); - Holder holder = new Holder(queue); - WeakReference ref = new WeakReference(holder); - - Holder old; - do { - old = strongRefs; - holder.next = old; - } while (!strongRefsUpdater.compareAndSet(this, old, holder)); - - local.set(ref); - return holder; - } - - @Override - public void remove() { - WeakReference ref = local.get(); - if (ref != null) { - ref.get().value = UNINITIALISED; - } - } - - /** - * Check if any strong references need should be removed due to thread exit. - */ - public void poll() { - synchronized (queue) { - // Remove queued references. - // (Is this better inside or out?) - if (queue.poll() == null) { - // Nothing to do. - return; - } - while (queue.poll() != null) { - // Discard. - } - - // Remove any dead holders. - Holder first = strongRefs; - if (first == null) { - // Unlikely... - return; - } - Holder link = first; - Holder next = link.next; - while (next != null) { - if (next.get() == null) { - next = next.next; - link.next = next; - } else { - link = next; - next = next.next; - } - } - - // Remove dead head, possibly. - if (first.get() == null) { - if (!strongRefsUpdater.weakCompareAndSet( - this, first, first.next - )) { - // Something else has come along. - // Just null out - next search will remove it. - first.value = null; - } - } - } - } - - /** - * Holds strong reference to a thread-local value. - * The WeakReference is to a thread-local representing the current thread. - */ - private static class Holder extends WeakReference { - /** - * Construct a new holder for the current thread. - */ - Holder(ReferenceQueue queue) { - super(currentThreadRef(), queue); - } - - /** - * Next holder in chain for this thread-local. - */ - Holder next; - /** - * Current thread-local value. - * {@link #UNINITIALISED} represents an uninitialised value. - */ - Object value = UNINITIALISED; - } -} Index: rctags/ehcache-2.10.9.0.411/ehcache-core/src/test/resources/hibernate-config/domain/HolidayCalendar.hbm.xml =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-core/src/test/resources/hibernate-config/domain/HolidayCalendar.hbm.xml (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-core/src/test/resources/hibernate-config/domain/HolidayCalendar.hbm.xml (revision 0) @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - Index: rctags/ehcache-2.10.9.0.411/terracotta/bootstrap/src/main/java/org/terracotta/modules/ehcache/event/ClusteredEventReplicatorFactory.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/terracotta/bootstrap/src/main/java/org/terracotta/modules/ehcache/event/ClusteredEventReplicatorFactory.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/terracotta/bootstrap/src/main/java/org/terracotta/modules/ehcache/event/ClusteredEventReplicatorFactory.java (revision 0) @@ -1,45 +0,0 @@ -/* - * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved. - */ -package org.terracotta.modules.ehcache.event; - -import net.sf.ehcache.Ehcache; -import net.sf.ehcache.config.NonstopConfiguration; -import net.sf.ehcache.event.CacheEventListener; - -import org.terracotta.modules.ehcache.ToolkitInstanceFactory; - -import java.util.HashMap; -import java.util.Map; - -public class ClusteredEventReplicatorFactory { - private final Map eventReplicators = new HashMap(); - private final ToolkitInstanceFactory toolkitInstanceFactory; - - public ClusteredEventReplicatorFactory(ToolkitInstanceFactory toolkitInstanceFactory) { - this.toolkitInstanceFactory = toolkitInstanceFactory; - } - - public synchronized CacheEventListener getOrCreateClusteredEventReplicator(Ehcache cache) { - String fullyQualifiedCacheName = toolkitInstanceFactory.getFullyQualifiedCacheName(cache); - CacheEventListener replicator = eventReplicators.get(fullyQualifiedCacheName); - if (replicator == null) { - NonstopConfiguration nonStopConfiguration = cache.getCacheConfiguration().getTerracottaConfiguration() - .getNonstopConfiguration(); - CacheEventListener clusteredEventReplicator = new ClusteredEventReplicator( - cache, - fullyQualifiedCacheName, - toolkitInstanceFactory - .getOrCreateCacheEventNotifier(cache), - this); - replicator = new NonStopEventReplicator(clusteredEventReplicator, toolkitInstanceFactory, nonStopConfiguration); - eventReplicators.put(fullyQualifiedCacheName, replicator); - } - return replicator; - } - - public synchronized void disposeClusteredEventReplicator(String fullyQualifiedCacheName) { - eventReplicators.remove(fullyQualifiedCacheName); - } - -} Index: rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/transaction/xa/package.html =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/transaction/xa/package.html (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/transaction/xa/package.html (revision 0) @@ -1,17 +0,0 @@ - - - - - This package contains the functionality to provide XA support to a transactional Cache. -

- As of now, only READ_COMMITED isolation level is provided. This is being handled by both - {@link net.sf.ehcache.transaction.xa.XATransactionContext XATransactionContext} (being the local transactional data) and - {@link net.sf.ehcache.transaction.xa.XATransactionStore XATransactionStore} (wrapping the underlying - {@link net.sf.ehcache.store.Store Store} instance and keeping the "in-transaction operations" on the cache in sync with - the {@link net.sf.ehcache.transaction.xa.XATransactionContext XATransactionContext} XA implementation. -

-

- It also contains Ehcache support for JTA XAResource: {@link net.sf.ehcache.transaction.xa.EhcacheXAResourceImpl}. -

- - Index: rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/config/generator/model/elements/FactoryConfigurationElement.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/config/generator/model/elements/FactoryConfigurationElement.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/config/generator/model/elements/FactoryConfigurationElement.java (revision 0) @@ -1,66 +0,0 @@ -/** - * Copyright Terracotta, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package net.sf.ehcache.config.generator.model.elements; - -import net.sf.ehcache.config.FactoryConfiguration; -import net.sf.ehcache.config.generator.model.NodeElement; -import net.sf.ehcache.config.generator.model.SimpleNodeAttribute; -import net.sf.ehcache.config.generator.model.SimpleNodeElement; - -/** - * {@link NodeElement} representing the {@link FactoryConfiguration} - * - * @author Abhishek Sanoujam - * - */ -public class FactoryConfigurationElement extends SimpleNodeElement { - - private final FactoryConfiguration factoryConfiguration; - - /** - * Constructor accepting the parent, the name and the {@link FactoryConfiguration} - * - * @param parent - * @param name - * @param factoryConfiguration - */ - public FactoryConfigurationElement(NodeElement parent, String name, - FactoryConfiguration factoryConfiguration) { - super(parent, name); - this.factoryConfiguration = factoryConfiguration; - init(); - } - - private void init() { - if (factoryConfiguration == null) { - return; - } - addAttribute(new SimpleNodeAttribute("class", factoryConfiguration.getFullyQualifiedClassPath()).optional(false)); - addAttribute(new SimpleNodeAttribute("properties", factoryConfiguration.getProperties()).optional(true)); - addAttribute(new SimpleNodeAttribute("propertySeparator", factoryConfiguration.getPropertySeparator()).optional(true)); - } - - /** - * Returns the {@link FactoryConfiguration} associated with this element - * - * @return the {@link FactoryConfiguration} associated with this element - */ - public FactoryConfiguration getFactoryConfiguration() { - return factoryConfiguration; - } - -} Index: rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/concurrent/Sync.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/concurrent/Sync.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/concurrent/Sync.java (revision 0) @@ -1,327 +0,0 @@ -/** - * Copyright Terracotta, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package net.sf.ehcache.concurrent; - -/** - * @version $Id: Sync.java 10789 2018-04-26 02:08:13Z adahanne $ - * @author Doug Lea - * Main interface for locks, gates, and conditions. - *

- * Sync objects isolate waiting and notification for particular - * logical states, resource availability, events, and the like that are - * shared across multiple threads. Use of Syncs sometimes - * (but by no means always) adds flexibility and efficiency - * compared to the use of plain java monitor methods - * and locking, and are sometimes (but by no means always) - * simpler to program with. - *

- * Most Syncs are intended to be used primarily (although - * not exclusively) in before/after constructions such as: - *

{@code
- * class X {
- *   Sync gate;
- *   // ...
- *
- *   public void m() {
- *     try {
- *       gate.acquire();  // block until condition holds
- *       try {
- *         // ... method body
- *       }
- *       finally {
- *         gate.release()
- *       }
- *     }
- *     catch (InterruptedException ex) {
- *       // ... evasive action
- *     }
- *   }
- *
- *   public void m2(Sync cond) { // use supplied condition
- *     try {
- *       if (cond.attempt(10)) {         // try the condition for 10 ms
- *         try {
- *           // ... method body
- *         }
- *         finally {
- *           cond.release()
- *         }
- *       }
- *     }
- *     catch (InterruptedException ex) {
- *       // ... evasive action
- *     }
- *   }
- * }
- * }
- * Syncs may be used in somewhat tedious but more flexible replacements - * for built-in Java synchronized blocks. For example: - *
{@code
- * class HandSynched {
- *   private double state_ = 0.0;
- *   private final Sync lock;  // use lock type supplied in constructor
- *   public HandSynched(Sync l) { lock = l; }
- *
- *   public void changeState(double d) {
- *     try {
- *       lock.acquire();
- *       try     { state_ = updateFunction(d); }
- *       finally { lock.release(); }
- *     }
- *     catch(InterruptedException ex) { }
- *   }
- *
- *   public double getState() {
- *     double d = 0.0;
- *     try {
- *       lock.acquire();
- *       try     { d = accessFunction(state_); }
- *       finally { lock.release(); }
- *     }
- *     catch(InterruptedException ex){}
- *     return d;
- *   }
- *   private double updateFunction(double d) { ... }
- *   private double accessFunction(double d) { ... }
- * }
- * }
- * If you have a lot of such methods, and they take a common - * form, you can standardize this using wrappers. Some of these - * wrappers are standardized in LockedExecutor, but you can make others. - * For example: - *
{@code
- * class HandSynchedV2 {
- *   private double state_ = 0.0;
- *   private final Sync lock;  // use lock type supplied in constructor
- *   public HandSynchedV2(Sync l) { lock = l; }
- *
- *   protected void runSafely(Runnable r) {
- *     try {
- *       lock.acquire();
- *       try { r.run(); }
- *       finally { lock.release(); }
- *     }
- *     catch (InterruptedException ex) { // propagate without throwing
- *       Thread.currentThread().interrupt();
- *     }
- *   }
- *
- *   public void changeState(double d) {
- *     runSafely(new Runnable() {
- *       public void run() { state_ = updateFunction(d); }
- *     });
- *   }
- *   // ...
- * }
- * }
- * - * One reason to bother with such constructions is to use deadlock- - * avoiding back-offs when dealing with locks involving multiple objects. - * For example, here is a Cell class that uses attempt to back-off - * and retry if two Cells are trying to swap values with each other - * at the same time. - *
{@code
- * class Cell {
- *   long value;
- *   Sync lock = ... // some sync implementation class
- *   void swapValue(Cell other) {
- *     for (;;) {
- *       try {
- *         lock.acquire();
- *         try {
- *           if (other.lock.attempt(100)) {
- *             try {
- *               long t = value;
- *               value = other.value;
- *               other.value = t;
- *               return;
- *             }
- *             finally { other.lock.release(); }
- *           }
- *         }
- *         finally { lock.release(); }
- *       }
- *       catch (InterruptedException ex) { return; }
- *     }
- *   }
- * }
- * }
- * - * Here is an even fancier version, that uses lock re-ordering - * upon conflict: - *
{@code
- * class Cell {
- *   long value;
- *   Sync lock = ...;
- *   private static boolean trySwap(Cell a, Cell b) {
- *     a.lock.acquire();
- *     try {
- *       if (!b.lock.attempt(0))
- *         return false;
- *       try {
- *         long t = a.value;
- *         a.value = b.value;
- *         b.value = t;
- *         return true;
- *       }
- *       finally { other.lock.release(); }
- *     }
- *     finally { lock.release(); }
- *     return false;
- *   }
- *
- *  void swapValue(Cell other) {
- *    try {
- *      while (!trySwap(this, other) &&
- *            !tryswap(other, this))
- *        Thread.sleep(1);
- *    }
- *    catch (InterruptedException ex) { return; }
- *  }
- * }
- * }
- * - * Interruptions are in general handled as early as possible. - * Normally, InterruptionExceptions are thrown - * in acquire and attempt(msec) if interruption - * is detected upon entry to the method, as well as in any - * later context surrounding waits. - * However, interruption status is ignored in release(); - *

- * Timed versions of attempt report failure via return value. - * If so desired, you can transform such constructions to use exception - * throws via - *

- *   if (!c.attempt(timeval)) throw new TimeoutException(timeval);
- * 
- * The TimoutSync wrapper class can be used to automate such usages. - *

- * All time values are expressed in milliseconds as longs, which have a maximum - * value of Long.MAX_VALUE, or almost 300,000 centuries. It is not - * known whether JVMs actually deal correctly with such extreme values. - * For convenience, some useful time values are defined as static constants. - *

- * All implementations of the three Sync methods guarantee to - * somehow employ Java synchronized methods or blocks, - * and so entail the memory operations described in JLS - * chapter 17 which ensure that variables are loaded and flushed - * within before/after constructions. - *

- * Syncs may also be used in spinlock constructions. Although - * it is normally best to just use acquire(), various forms - * of busy waits can be implemented. For a simple example - * (but one that would probably never be preferable to using acquire()): - *

{@code
- * class X {
- *   Sync lock = ...
- *   void spinUntilAcquired() throws InterruptedException {
- *     // Two phase.
- *     // First spin without pausing.
- *     int purespins = 10;
- *     for (int i = 0; i < purespins; ++i) {
- *       if (lock.attempt(0))
- *         return true;
- *     }
- *     // Second phase - use timed waits
- *     long waitTime = 1; // 1 millisecond
- *     for (;;) {
- *       if (lock.attempt(waitTime))
- *         return true;
- *       else
- *         waitTime = waitTime * 3 / 2 + 1; // increase 50%
- *     }
- *   }
- * }
- * }
- * In addition pure synchronization control, Syncs - * may be useful in any context requiring before/after methods. - * For example, you can use an ObservableSync - * (perhaps as part of a LayeredSync) in order to obtain callbacks - * before and after each method invocation for a given class. - *

- * [ Introduction to this package. ] - */ -public interface Sync { - /** - * One second, in milliseconds; convenient as a time-out value * - */ - long ONE_SECOND = 1000; - - /** - * One minute, in milliseconds; convenient as a time-out value * - */ - long ONE_MINUTE = 60 * ONE_SECOND; - - /** - * One hour, in milliseconds; convenient as a time-out value * - */ - long ONE_HOUR = 60 * ONE_MINUTE; - - /** - * One day, in milliseconds; convenient as a time-out value * - */ - long ONE_DAY = 24 * ONE_HOUR; - - /** - * One week, in milliseconds; convenient as a time-out value * - */ - long ONE_WEEK = 7 * ONE_DAY; - - /** - * One year in milliseconds; convenient as a time-out value - * Not that it matters, but there is some variation across - * standard sources about value at msec precision. - * The value used is the same as in java.util.GregorianCalendar - */ - long ONE_YEAR = (long) (365.2425 * ONE_DAY); - - /** - * One century in milliseconds; convenient as a time-out value - */ - long ONE_CENTURY = 100 * ONE_YEAR; - - /** - * Acquire lock of LockType.READ or WRITE - * @param type the lock type to acquire - */ - void lock(LockType type); - - /** - * Tries to acquire a LockType.READ or WRITE for a certain period - * @param type the lock type to acquire - * @param msec timeout - * @return true if the lock got acquired, false otherwise - * @throws InterruptedException Should the thread be interrupted - */ - boolean tryLock(LockType type, long msec) throws InterruptedException; - - /** - * Releases the lock held by the current Thread. - * In case of a LockType.WRITE, should the lock not be held by the current Thread, nothing happens - * @param type the lock type to acquire - */ - void unlock(LockType type); - - /** - * Returns true is this is lock is held at given level by the current thread. - * - * @param type the lock type to test - * @return true if the lock is held - */ - boolean isHeldByCurrentThread(LockType type); -} - Index: rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/config/DiskStoreConfiguration.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/config/DiskStoreConfiguration.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/config/DiskStoreConfiguration.java (revision 0) @@ -1,159 +0,0 @@ -/** - * Copyright Terracotta, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package net.sf.ehcache.config; - -import java.io.File; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * A class to represent DiskStore configuration - * e.g. {@code } - * - * @author Greg Luck - * @version $Id: DiskStoreConfiguration.java 10789 2018-04-26 02:08:13Z adahanne $ - */ -public final class DiskStoreConfiguration { - - private static final Pattern PROPERTY_SUBSTITUTION_PATTERN = Pattern.compile("\\$\\{(.+?)\\}"); - - private static final Logger LOG = LoggerFactory.getLogger(DiskStoreConfiguration.class.getName()); - - /** - * The path as specified in the config - */ - private String originalPath; - - /** - * The path to the directory where .data and .index files will be created. - */ - private String path; - - /** - * A constants class for environment variables used in disk store paths - */ - private static enum Env { - USER_HOME("user.home"), - USER_DIR("user.dir"), - JAVA_IO_TMPDIR("java.io.tmpdir"), - EHCACHE_DISK_STORE_DIR("ehcache.disk.store.dir"); - - private final String variable; - - Env(String variable) { - this.variable = variable; - } - - String substitute(String string) { - String substitution = System.getProperty(variable); - if (substitution == null) { - return string; - } else { - return string.replaceFirst(Pattern.quote(variable), Matcher.quoteReplacement(substitution)); - } - } - } - - /** - * The diskStore path - */ - public final String getPath() { - return path; - } - - /** - * The diskStore default path, which is the system environment variable - * available on all Java virtual machines java.io.tmpdir - */ - public static String getDefaultPath() { - return Env.JAVA_IO_TMPDIR.substitute(Env.JAVA_IO_TMPDIR.variable); - } - - /** - * Builder method to set the disk store path, see {@link #setPath(String)} - * - * @return this configuration instance - */ - public final DiskStoreConfiguration path(final String path) { - setPath(path); - return this; - } - - /** - * Translates and sets the path. - *

- * Two forms of path substitution are supported: - *

    - *
  1. To support legacy configurations, four explicit string tokens are replaced with their associated Java system property values. - * This substitution happens for the first matching token only (e.g. java.io.tmpdir/ehcache/java.io.tmpdir → - * /var/tmp/ehcache/java.io.tmpdir). - *
      - *
    • user.home - the user's home directory
    • - *
    • user.dir - the current working directory
    • - *
    • java.io.tmpdir - the default temp file path
    • - *
    • ehcache.disk.store.dir - a system property you would normally specify on the command line, e.g. - * java -Dehcache.disk.store.dir=/u01/myapp/diskdir
    • - *
    - *
  2. - *
  3. These, and all other system properties can also be substituted using the familiar syntax: ${property-name}. Using - * this syntax all token instances are replaced (e.g. ${java.io.tmpdir}/ehcache/${java.io.tmpdir} → - * /var/tmp/ehcache/var/tmp).
  4. - *
- * - * @param path disk store path - */ - public final void setPath(final String path) { - this.originalPath = path; - this.path = translatePath(path); - } - - /** - * @return the originalPath - */ - public String getOriginalPath() { - return originalPath; - } - - private static String translatePath(String path) { - String translatedPath = substituteProperties(path); - for (Env e : Env.values()) { - translatedPath = e.substitute(translatedPath); - } - // Remove duplicate separators: Windows and Solaris - translatedPath = translatedPath.replace(File.separator + File.separator, File.separator); - LOG.debug("Disk Store Path: " + translatedPath); - return translatedPath; - } - - private static String substituteProperties(String string) { - Matcher matcher = PROPERTY_SUBSTITUTION_PATTERN.matcher(string); - - StringBuffer eval = new StringBuffer(); - while (matcher.find()) { - String substitution = System.getProperty(matcher.group(1)); - if (substitution != null) { - matcher.appendReplacement(eval, Matcher.quoteReplacement(substitution)); - } - } - matcher.appendTail(eval); - - return eval.toString(); - } -} Index: rctags/ehcache-2.10.9.0.411/system-tests/src/test/java/org/terracotta/modules/ehcache/event/EhcacheTerracottaEventListener.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/system-tests/src/test/java/org/terracotta/modules/ehcache/event/EhcacheTerracottaEventListener.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/system-tests/src/test/java/org/terracotta/modules/ehcache/event/EhcacheTerracottaEventListener.java (revision 0) @@ -1,78 +0,0 @@ -/* - * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved. - */ -package org.terracotta.modules.ehcache.event; - -import net.sf.ehcache.CacheException; -import net.sf.ehcache.Ehcache; -import net.sf.ehcache.Element; -import net.sf.ehcache.event.CacheEventListener; - -import java.util.List; -import java.util.concurrent.CopyOnWriteArrayList; - -public class EhcacheTerracottaEventListener implements CacheEventListener { - private final List put = new CopyOnWriteArrayList(); - private final List update = new CopyOnWriteArrayList(); - private final List remove = new CopyOnWriteArrayList(); - private final List expired = new CopyOnWriteArrayList(); - private final List evicted = new CopyOnWriteArrayList(); - private int removeAll = 0; - - public List getPut() { - return put; - } - - public List getUpdate() { - return update; - } - - public List getRemove() { - return remove; - } - - public List getExpired() { - return expired; - } - - public List getEvicted() { - return evicted; - } - - public int getRemoveAll() { - return removeAll; - } - - public void notifyElementPut(Ehcache cache, Element element) throws CacheException { - put.add(element); - } - - public void notifyElementUpdated(Ehcache cache, Element element) throws CacheException { - update.add(element); - } - - public void notifyElementRemoved(Ehcache cache, Element element) throws CacheException { - remove.add(element); - } - - public void notifyElementExpired(Ehcache cache, Element element) { - expired.add(element); - } - - public void notifyElementEvicted(Ehcache cache, Element element) { - evicted.add(element); - } - - public void notifyRemoveAll(Ehcache cache) { - removeAll++; - } - - public void dispose() { - // no-op - } - - @Override - public EhcacheTerracottaEventListener clone() { - throw new UnsupportedOperationException(); - } -} Index: rctags/ehcache-2.10.9.0.411/terracotta/bootstrap/src/main/java/org/terracotta/modules/ehcache/store/ValueModeHandlerSerialization.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/terracotta/bootstrap/src/main/java/org/terracotta/modules/ehcache/store/ValueModeHandlerSerialization.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/terracotta/bootstrap/src/main/java/org/terracotta/modules/ehcache/store/ValueModeHandlerSerialization.java (revision 0) @@ -1,59 +0,0 @@ -/* - * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved. - */ -package org.terracotta.modules.ehcache.store; - -import net.sf.ehcache.Element; -import net.sf.ehcache.ElementData; -import net.sf.ehcache.EternalElementData; -import net.sf.ehcache.NonEternalElementData; - -import org.terracotta.modules.ehcache.collections.SerializationHelper; - -import java.io.IOException; -import java.io.Serializable; - -public class ValueModeHandlerSerialization implements ValueModeHandler { - - @Override - public Object getRealKeyObject(String portableKey) { - try { - return SerializationHelper.deserializeFromString(portableKey, null); - } catch (IOException e) { - return null; - } catch (ClassNotFoundException e) { - return null; - } - } - - @Override - public Object getRealKeyObject(String portableKey, ClassLoader loader) { - try { - return SerializationHelper.deserializeFromString(portableKey, loader); - } catch (IOException e) { - return null; - } catch (ClassNotFoundException e) { - return null; - } - } - - @Override - public String createPortableKey(Object key) throws IOException { - return SerializationHelper.serializeToString(key); - } - - @Override - public ElementData createElementData(Element element) { - if(element.isEternal()) { - return new EternalElementData(element); - } else { - return new NonEternalElementData(element); - } - } - - @Override - public Element createElement(Object key, Serializable value) { - return value == null ? null : ((ElementData) value).createElement(key); - } - -} Index: rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/writer/writebehind/AbstractWriteBehindQueue.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/writer/writebehind/AbstractWriteBehindQueue.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/writer/writebehind/AbstractWriteBehindQueue.java (revision 0) @@ -1,610 +0,0 @@ -/** - * Copyright Terracotta, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package net.sf.ehcache.writer.writebehind; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.concurrent.atomic.AtomicLong; -import java.util.concurrent.locks.Condition; -import java.util.concurrent.locks.ReentrantReadWriteLock; -import java.util.logging.Level; -import java.util.logging.Logger; - -import net.sf.ehcache.CacheEntry; -import net.sf.ehcache.CacheException; -import net.sf.ehcache.Element; -import net.sf.ehcache.config.CacheConfiguration; -import net.sf.ehcache.config.CacheWriterConfiguration; -import net.sf.ehcache.writer.CacheWriter; -import net.sf.ehcache.writer.writebehind.operations.DeleteOperation; -import net.sf.ehcache.writer.writebehind.operations.SingleOperation; -import net.sf.ehcache.writer.writebehind.operations.WriteOperation; - -/** - * Abstract implementation of a WriteBehindQueue. - * - * @author tim - */ -public abstract class AbstractWriteBehindQueue implements WriteBehind { - - private static final Logger LOGGER = Logger.getLogger(WriteBehindQueue.class.getName()); - - private static final int MS_IN_SEC = 1000; - - private final String cacheName; - private final long minWriteDelayMs; - private final long maxWriteDelayMs; - private final int rateLimitPerSecond; - private final int maxQueueSize; - private final boolean writeBatching; - private final int writeBatchSize; - private final int retryAttempts; - private final int retryAttemptDelaySeconds; - private final Thread processingThread; - - private final ReentrantReadWriteLock queueLock = new ReentrantReadWriteLock(); - private final ReentrantReadWriteLock.ReadLock queueReadLock = queueLock.readLock(); - private final ReentrantReadWriteLock.WriteLock queueWriteLock = queueLock.writeLock(); - private final Condition queueIsFull = queueWriteLock.newCondition(); - private final Condition queueIsEmpty = queueWriteLock.newCondition(); - private final Condition queueIsStopped = queueWriteLock.newCondition(); - - private final AtomicLong lastProcessing = new AtomicLong(System.currentTimeMillis()); - private final AtomicLong lastWorkDone = new AtomicLong(System.currentTimeMillis()); - private final AtomicBoolean busyProcessing = new AtomicBoolean(false); - - private volatile OperationsFilter filter; - - private CacheWriter cacheWriter; - private boolean stopping; - private boolean stopped; - - /** - * Create a new write behind queue. - * - * @param config the configuration for the queue - */ - public AbstractWriteBehindQueue(CacheConfiguration config) { - this.stopping = false; - this.stopped = true; - - this.cacheName = config.getName(); - - // making a copy of the configuration locally to ensure that it will not be changed at runtime - final CacheWriterConfiguration cacheWriterConfig = config.getCacheWriterConfiguration(); - this.minWriteDelayMs = cacheWriterConfig.getMinWriteDelay() * MS_IN_SEC; - this.maxWriteDelayMs = cacheWriterConfig.getMaxWriteDelay() * MS_IN_SEC; - this.rateLimitPerSecond = cacheWriterConfig.getRateLimitPerSecond(); - this.maxQueueSize = cacheWriterConfig.getWriteBehindMaxQueueSize(); - this.writeBatching = cacheWriterConfig.getWriteBatching(); - this.writeBatchSize = cacheWriterConfig.getWriteBatchSize(); - this.retryAttempts = cacheWriterConfig.getRetryAttempts(); - this.retryAttemptDelaySeconds = cacheWriterConfig.getRetryAttemptDelaySeconds(); - - this.processingThread = new Thread(new ProcessingThread(), cacheName + " write-behind"); - this.processingThread.setDaemon(true); - } - - /** - * Quarantine items to be processed. - * - * @return list of operations - */ - protected abstract List quarantineItems(); - - /** - * Add an item to the write behind queue - * - * @param operation operation to be done - */ - protected abstract void addItem(SingleOperation operation); - - /** - * Reinsert any unfinished operations into the queue. - * - * @param operations list of unfinished operations - */ - protected abstract void reinsertUnprocessedItems(List operations); - - /** - * {@inheritDoc} - */ - public void start(CacheWriter writer) { - queueWriteLock.lock(); - try { - if (!stopped) { - throw new CacheException("The write-behind queue for cache '" + cacheName + "' can't be started more than once"); - } - - if (processingThread.isAlive()) { - throw new CacheException("The thread with name " + processingThread.getName() + " already exists and is still running"); - } - - this.stopping = false; - this.stopped = false; - this.cacheWriter = writer; - - processingThread.start(); - } finally { - queueWriteLock.unlock(); - } - } - - /** - * {@inheritDoc} - */ - public void setOperationsFilter(OperationsFilter filter) { - this.filter = filter; - } - - private long getLastProcessing() { - return lastProcessing.get(); - } - - /** - * Thread this will continuously process the items in the queue. - */ - private final class ProcessingThread implements Runnable { - public void run() { - try { - while (!isStopped()) { - - processItems(); - - queueWriteLock.lock(); - try { - queueIsFull.signal(); - // Wait for new items or until the min write delay has expired. - // Do not continue if the actual min write delay wasn't at least the one specified in the config - // otherwise it's possible to create a new work list for just a couple of items in case - // the item processor is very fast, causing a large amount of data churn. - // However, if the write delay is expired, the processing should start immediately. - try { - if (minWriteDelayMs != 0) { - long delay = minWriteDelayMs; - do { - queueIsEmpty.await(delay, TimeUnit.MILLISECONDS); - long actualDelay = System.currentTimeMillis() - getLastProcessing(); - if (actualDelay < minWriteDelayMs) { - delay = minWriteDelayMs - actualDelay; - } else { - delay = 0; - } - } while (delay > 0); - } else { - while (!stopping && getQueueSize() == 0) { - queueIsEmpty.await(); - } - } - } catch (final InterruptedException e) { - // if the wait for items is interrupted, act as if the bucket was cancelled - stop(); - Thread.currentThread().interrupt(); - } - - // If the queue is stopping and no more work is outstanding, perform the actual stop operation - if (stopping && getQueueSize() == 0) { - stopTheQueueThread(); - } - } finally { - queueWriteLock.unlock(); - } - } - } finally { - stopTheQueueThread(); - } - } - - private void stopTheQueueThread() { - // Perform the actual stop operation and wake up everyone that is waiting for it. - queueWriteLock.lock(); - try { - stopped = true; - stopping = false; - queueIsStopped.signalAll(); - } finally { - queueWriteLock.unlock(); - } - } - } - - private void processItems() throws CacheException { - // ensure that the items aren't already being processed - if (busyProcessing.get()) { - throw new CacheException("The write behind queue for cache '" + cacheName + "' is already busy processing."); - } - - // set some state related to this processing run - busyProcessing.set(true); - lastProcessing.set(System.currentTimeMillis()); - - try { - final int workSize; - final List quarantined; - - queueWriteLock.lock(); - try { - // quarantine local work - if (getQueueSize() > 0) { - quarantined = quarantineItems(); - } else { - quarantined = null; - } - - // check if work was quarantined - if (quarantined != null) { - workSize = quarantined.size(); - } else { - workSize = 0; - } - } finally { - queueWriteLock.unlock(); - } - - // if there's no work that needs to be done, stop the processing - if (0 == workSize) { - if (LOGGER.isLoggable(Level.FINER)) { - LOGGER.finer(getThreadName() + " : processItems() : nothing to process"); - } - return; - } - - try { - filterQuarantined(quarantined); - - // if the batching is enabled and work size is smaller than batch size, don't process anything as long as the - // max allowed delay hasn't expired - if (writeBatching && writeBatchSize > 0) { - // wait for another round if the batch size hasn't been filled up yet and the max write delay - // hasn't expired yet - if (workSize < writeBatchSize && maxWriteDelayMs > lastProcessing.get() - lastWorkDone.get()) { - waitUntilEnoughWorkItemsAvailable(quarantined, workSize); - return; - } - // enforce the rate limit and wait for another round if too much would be processed compared to - // the last time when a batch was executed - if (rateLimitPerSecond > 0) { - final long secondsSinceLastWorkDone = (System.currentTimeMillis() - lastWorkDone.get()) / MS_IN_SEC; - final long maxBatchSizeSinceLastWorkDone = rateLimitPerSecond * secondsSinceLastWorkDone; - final int batchSize = determineBatchSize(quarantined); - if (batchSize > maxBatchSizeSinceLastWorkDone) { - waitUntilEnoughTimeHasPassed(quarantined, batchSize, secondsSinceLastWorkDone); - return; - } - } - } - - // set some state related to this processing run - lastWorkDone.set(System.currentTimeMillis()); - - if (LOGGER.isLoggable(Level.FINER)) { - LOGGER.finer(getThreadName() + " : processItems() : processing started"); - } - - // process the quarantined items and remove them as they're processed - processQuarantinedItems(quarantined); - } catch (final RuntimeException e) { - reassemble(quarantined); - throw e; - } catch (final Error e) { - reassemble(quarantined); - throw e; - } - } finally { - busyProcessing.set(false); - - if (LOGGER.isLoggable(Level.FINER)) { - LOGGER.finer(getThreadName() + " : processItems() : processing finished"); - } - } - } - - private void waitUntilEnoughWorkItemsAvailable(List quarantined, int workSize) { - if (LOGGER.isLoggable(Level.FINER)) { - LOGGER.finer(getThreadName() + " : processItems() : only " + workSize + " work items available, waiting for " - + writeBatchSize + " items to fill up a batch"); - } - reassemble(quarantined); - } - - private void waitUntilEnoughTimeHasPassed(List quarantined, int batchSize, long secondsSinceLastWorkDone) { - if (LOGGER.isLoggable(Level.FINER)) { - LOGGER.finer(getThreadName() + " : processItems() : last work was done " + secondsSinceLastWorkDone - + " seconds ago, processing " + batchSize + " batch items would exceed the rate limit of " - + rateLimitPerSecond + ", waiting for a while."); - } - reassemble(quarantined); - } - - private int determineBatchSize(List quarantined) { - int batchSize = writeBatchSize; - if (quarantined.size() < batchSize) { - batchSize = quarantined.size(); - } - return batchSize; - } - - private void filterQuarantined(List quarantined) { - OperationsFilter operationsFilter = this.filter; - if (operationsFilter != null) { - operationsFilter.filter(quarantined, CastingOperationConverter.getInstance()); - } - } - - private void processQuarantinedItems(List quarantined) { - if (LOGGER.isLoggable(Level.CONFIG)) { - LOGGER.config(getThreadName() + " : processItems() : processing " + quarantined.size() + " quarantined items"); - } - - if (writeBatching && writeBatchSize > 0) { - processBatchedOperations(quarantined); - } else { - processSingleOperation(quarantined); - - } - } - - private void processBatchedOperations(List quarantined) { - final int batchSize = determineBatchSize(quarantined); - - // create batches that are separated by operation type - List> batches = createMonomorphicBatches(quarantined.subList(0, batchSize)); - - // execute the batch operations - for (List batch : batches) { - int executionsLeft = retryAttempts + 1; - while (executionsLeft-- > 0) { - try { - batch.get(0).createBatchOperation(batch).performBatchOperation(cacheWriter); - break; - } catch (final RuntimeException e) { - if (executionsLeft <= 0) { - for (SingleOperation singleOperation : batch) { - singleOperation.throwAway(cacheWriter, e); - } - } else { - LOGGER.warning("Exception while processing write behind queue, retrying in " + retryAttemptDelaySeconds - + " seconds, " + executionsLeft + " retries left : " + e.getMessage()); - try { - Thread.sleep(retryAttemptDelaySeconds * MS_IN_SEC); - } catch (InterruptedException e1) { - Thread.currentThread().interrupt(); - throw e; - } - } - } - } - } - - // remove the batched items - for (int i = 0; i < batchSize; i++) { - quarantined.remove(0); - } - - if (!quarantined.isEmpty()) { - reassemble(quarantined); - } - } - - private List> createMonomorphicBatches(List batch) { - - final List> closedBatches = new ArrayList>(); - - Set deletedKeys = new HashSet(); - Set writtenKeys = new HashSet(); - List deleteBatch = new ArrayList(); - List writeBatch = new ArrayList(); - - for (SingleOperation item : batch) { - if (LOGGER.isLoggable(Level.CONFIG)) { - LOGGER.config(getThreadName() + " : processItems() : adding " + item + " to next batch"); - } - - if (item instanceof WriteOperation) { - if (deletedKeys.contains(item.getKey())) { - //close the current delete batch - closedBatches.add(deleteBatch); - deleteBatch = new ArrayList(); - deletedKeys = new HashSet(); - } - writeBatch.add((WriteOperation) item); - writtenKeys.add(item.getKey()); - } else if (item instanceof DeleteOperation) { - if (writtenKeys.contains(item.getKey())) { - //close the current write batch - closedBatches.add(writeBatch); - writeBatch = new ArrayList(); - writtenKeys = new HashSet(); - } - deleteBatch.add((DeleteOperation) item); - deletedKeys.add(item.getKey()); - } else { - throw new AssertionError(); - } - } - - if (!writeBatch.isEmpty()) { - closedBatches.add(writeBatch); - } - if (!deleteBatch.isEmpty()) { - closedBatches.add(deleteBatch); - } - return closedBatches; - } - - private void processSingleOperation(List quarantined) { - while (!quarantined.isEmpty()) { - // process the next item - final SingleOperation item = quarantined.get(0); - if (LOGGER.isLoggable(Level.CONFIG)) { - LOGGER.config(getThreadName() + " : processItems() : processing " + item); - } - - int executionsLeft = retryAttempts + 1; - while (executionsLeft-- > 0) { - try { - item.performSingleOperation(cacheWriter); - break; - } catch (final RuntimeException e) { - if (executionsLeft <= 0) { - try { - item.throwAway(cacheWriter, e); - } catch (RuntimeException runtimeException) { - // TODO Really only log ?! - // LOGGER.warning("Throwing key '" + item.getKey() + "' away triggered an Exception!", runtimeException); - } - } else { - LOGGER.warning("Exception while processing write behind queue, retrying in " + retryAttemptDelaySeconds - + " seconds, " + executionsLeft + " retries left : " + e.getMessage()); - try { - Thread.sleep(retryAttemptDelaySeconds * MS_IN_SEC); - } catch (InterruptedException e1) { - Thread.currentThread().interrupt(); - throw e; - } - } - } - } - - quarantined.remove(0); - } - } - - /** - * {@inheritDoc} - */ - public void write(Element element) { - queueWriteLock.lock(); - try { - waitForQueueSizeToDrop(); - if (stopping || stopped) { - throw new CacheException("The element '" + element + "' couldn't be added through the write-behind queue for cache '" - + cacheName + "' since it's not started."); - } - addItem(new WriteOperation(element)); - if (getQueueSize() + 1 < maxQueueSize) { - queueIsFull.signal(); - } - queueIsEmpty.signal(); - } finally { - queueWriteLock.unlock(); - } - } - - private void waitForQueueSizeToDrop() { - if (maxQueueSize > 0) { - while (getQueueSize() >= maxQueueSize) { - try { - queueIsFull.await(); - } catch (InterruptedException e) { - stop(); - Thread.currentThread().interrupt(); - } - } - } - } - - /** - * {@inheritDoc} - */ - public void delete(CacheEntry entry) { - queueWriteLock.lock(); - try { - waitForQueueSizeToDrop(); - if (stopping || stopped) { - throw new CacheException("The entry for key '" + entry.getKey() + "' couldn't be deleted through the write-behind " - + "queue for cache '" + cacheName + "' since it's not started."); - } - addItem(new DeleteOperation(entry)); - if (getQueueSize() + 1 < maxQueueSize) { - queueIsFull.signal(); - } - queueIsEmpty.signal(); - } finally { - queueWriteLock.unlock(); - } - } - - /** - * {@inheritDoc} - */ - public void stop() throws CacheException { - queueWriteLock.lock(); - try { - if (stopped) { - return; - } - - stopping = true; - queueIsEmpty.signal(); - while (!stopped) { - queueIsStopped.await(); - } - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new CacheException(e); - } finally { - queueWriteLock.unlock(); - } - } - - /** - * Gets the best estimate for items in the queue still awaiting processing. - * Not including elements currently processed - * @return the amount of elements still awaiting processing. - */ - public abstract long getQueueSize(); - - private boolean isStopped() { - queueReadLock.lock(); - try { - return stopped; - } finally { - queueReadLock.unlock(); - } - } - - private String getThreadName() { - return processingThread.getName(); - } - - private void reassemble(List quarantined) { - queueWriteLock.lock(); - try { - if (null == quarantined) { - return; - } - - reinsertUnprocessedItems(quarantined); - - queueIsEmpty.signal(); - } finally { - queueWriteLock.unlock(); - } - } - - /** - * Backdoor to allow killing the processing thread for testing purposes. - */ - protected Thread getProcessingThread() { - return processingThread; - } -} Index: rctags/ehcache-2.10.9.0.411/ehcache-core/src/test/java/org/terracotta/test/categories/CheckShorts.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-core/src/test/java/org/terracotta/test/categories/CheckShorts.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-core/src/test/java/org/terracotta/test/categories/CheckShorts.java (revision 0) @@ -1,21 +0,0 @@ -/** - * Copyright Terracotta, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.terracotta.test.categories; - -public class CheckShorts { - -} Index: rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/util/LargeCollection.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/util/LargeCollection.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/util/LargeCollection.java (revision 0) @@ -1,124 +0,0 @@ -/** - * Copyright Terracotta, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package net.sf.ehcache.util; - -import java.util.AbstractCollection; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; - -/** - * Collection for large set. The general purpose is not to iterator through - * all the keys for add and remove operations. - * @author Nabib El-Rahman - * @param - */ -public abstract class LargeCollection < E > extends AbstractCollection < E > { - - /** - * Set that keeps tabs on add add() to collection. - */ - private final Collection < E > addSet; - - /** - * Set that keeps tabs of all remove() to collection. - */ - private final Collection < Object > removeSet; - - /** - * default constructor. - */ - public LargeCollection() { - this.addSet = new HashSet(); - this.removeSet = new HashSet(); - } - - /** - * {@inheritDoc} - */ - @Override - public final boolean add(final E obj) { - return this.addSet.add(obj); - } - - /** - * {@inheritDoc} - */ - @Override - public final boolean contains(final Object obj) { - return !removeSet.contains(obj) ? addSet.contains(obj) - || super.contains(obj) : false; - } - - /** - * {@inheritDoc} - */ - @Override - public final boolean remove(final Object obj) { - return removeSet.add(obj); - } - - /** - * {@inheritDoc} - */ - public final boolean removeAll(final Collection < ? > removeCandidates) { - boolean remove = true; - for (Iterator iter = removeCandidates.iterator(); iter.hasNext();) { - remove = remove(iter.next()) & remove; - } - return remove; - } - - /** - * Iterator for addSet. - * @return Iterator < E > - */ - private Iterator < E > additionalIterator() { - return addSet.iterator(); - } - - /** - * {@inheritDoc} - */ - public final Iterator < E > iterator() { - List < Iterator < E > > iterators = new ArrayList(); - iterators.add(sourceIterator()); - iterators.add(additionalIterator()); - return new AggregateIterator(removeSet, iterators); - } - - /** - * {@inheritDoc} - */ - public final int size() { - return Math.max(0, sourceSize() + addSet.size() - removeSet.size()); - } - - /** - * Iterator of initial set of entries. - * @return {@code Iterator} - */ - public abstract Iterator < E > sourceIterator(); - - /** - * Initial set of entries size. - * @return integer - */ - public abstract int sourceSize(); - -} Index: rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/config/Configuration.java =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/config/Configuration.java (revision 11412) +++ rctags/ehcache-2.10.9.0.411/ehcache-core/src/main/java/net/sf/ehcache/config/Configuration.java (revision 0) @@ -1,1351 +0,0 @@ -/** - * Copyright Terracotta, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package net.sf.ehcache.config; - -import net.sf.ehcache.Cache; -import net.sf.ehcache.CacheException; -import net.sf.ehcache.CacheManager; -import net.sf.ehcache.EhcacheDefaultClassLoader; -import net.sf.ehcache.FeaturesManager; -import net.sf.ehcache.ObjectExistsException; -import net.sf.ehcache.Status; -import net.sf.ehcache.config.generator.ConfigurationSource; -import net.sf.ehcache.store.Store; -import net.sf.ehcache.transaction.manager.DefaultTransactionManagerLookup; -import net.sf.ehcache.transaction.manager.TransactionManagerLookup; -import net.sf.ehcache.util.PropertyUtil; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.Set; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.CopyOnWriteArrayList; - -/** - * A bean, used by BeanUtils, to set configuration from an XML configuration file. - * - * @author Greg Luck - * @version $Id: Configuration.java 10789 2018-04-26 02:08:13Z adahanne $ - */ -public final class Configuration { - - /** - * Default value for dynamicConfig - */ - public static final boolean DEFAULT_DYNAMIC_CONFIG = true; - /** - * Default value for defaultTransactionTimeoutInSeconds - */ - public static final int DEFAULT_TRANSACTION_TIMEOUT = 15; - /** - * Default value for maxBytesLocalHeap when not explicitly set - */ - public static final long DEFAULT_MAX_BYTES_ON_HEAP = 0; - /** - * Default value for maxBytesLocalOffHeap when not explicitly set - */ - public static final long DEFAULT_MAX_BYTES_OFF_HEAP = 0; - /** - * Default value for maxBytesLocalDisk when not explicitly set - */ - public static final long DEFAULT_MAX_BYTES_ON_DISK = 0; - /** - * Default value for monitoring - */ - public static final Monitoring DEFAULT_MONITORING = Monitoring.AUTODETECT; - /** - * Default sizeOfPolicy configuration - */ - public static final SizeOfPolicyConfiguration DEFAULT_SIZEOF_POLICY_CONFIGURATION = new SizeOfPolicyConfiguration(); - - /** - * Default transactionManagerLookupConfiguration - */ - public static final FactoryConfiguration DEFAULT_TRANSACTION_MANAGER_LOOKUP_CONFIG = getDefaultTransactionManagerLookupConfiguration(); - private static final int HUNDRED = 100; - private static final Logger LOG = LoggerFactory.getLogger(Configuration.class); - - private volatile RuntimeCfg cfg; - private final List propertyChangeListeners = new CopyOnWriteArrayList(); - - /** - * Represents whether monitoring should be enabled or not. - * - * @author amiller - */ - public enum Monitoring { - /** When possible, notice the use of Terracotta and auto register the SampledCacheMBean. */ - AUTODETECT, - - /** Always auto register the SampledCacheMBean */ - ON, - - /** Never auto register the SampledCacheMBean */ - OFF; - } - - /** - * Enum of all properties that can change once the Configuration is being used by a CacheManager - */ - private static enum DynamicProperty { - - defaultCacheConfiguration { - @Override - void applyChange(final PropertyChangeEvent evt, final RuntimeCfg config) { - LOG.debug("Default Cache Configuration has changed, previously created caches remain untouched"); - } - }, - maxBytesLocalHeap { - @Override - void applyChange(final PropertyChangeEvent evt, final RuntimeCfg config) { - - Long newValue = (Long)evt.getNewValue(); - Long oldValue = (Long) evt.getOldValue(); - if (oldValue > newValue) { - // Double check for over-allocation again - validateOverAllocation(config, newValue); - } - // Recalculate % based caches - long cacheAllocated = 0; - for (Cache cache : getAllActiveCaches(config.cacheManager)) { - cache.getCacheConfiguration().configCachePools(config.getConfiguration()); - long bytesLocalHeap = cache.getCacheConfiguration().getMaxBytesLocalHeap(); - cacheAllocated += bytesLocalHeap; - } - config.cacheManager.getOnHeapPool().setMaxSize(newValue - cacheAllocated); - } - }, - maxBytesLocalDisk { - @Override - void applyChange(final PropertyChangeEvent evt, final RuntimeCfg config) { - Long newValue = (Long) evt.getNewValue(); - Long oldValue = (Long) evt.getOldValue(); - if (oldValue > newValue) { - // Double check for over-allocation again - validateOverAllocation(config, newValue); - } - long diskAllocated = 0; - //Recalculating final free space available at global level - for (Cache cache : getAllActiveCaches(config.cacheManager)) { - cache.getCacheConfiguration().configCachePools(config.getConfiguration()); - long bytesOnDiskPool = cache.getCacheConfiguration().getMaxBytesLocalDisk(); - diskAllocated += bytesOnDiskPool; - } - config.cacheManager.getOnDiskPool().setMaxSize(newValue - diskAllocated); - } - }; - - - private static void validateOverAllocation(RuntimeCfg config, Long newValue) { - ArrayList errors = new ArrayList(); - - for (Cache cache : getAllActiveCaches(config.cacheManager)) { - CacheConfiguration cacheConfiguration = cache.getCacheConfiguration(); - errors.addAll(cacheConfiguration.validateCachePools(config.getConfiguration())); - errors.addAll(cacheConfiguration.verifyPoolAllocationsBeforeAddingTo(config.cacheManager, - newValue, config.getConfiguration().getMaxBytesLocalOffHeap(), - config.getConfiguration().getMaxBytesLocalDisk(), null)); - } - if (!errors.isEmpty()) { - throw new InvalidConfigurationException("Can't reduce CacheManager byte tuning by so much", errors); - } - } - - abstract void applyChange(PropertyChangeEvent evt, RuntimeCfg config); - } - - private String cacheManagerName; - private int defaultTransactionTimeoutInSeconds = DEFAULT_TRANSACTION_TIMEOUT; - private Monitoring monitoring = DEFAULT_MONITORING; - private DiskStoreConfiguration diskStoreConfiguration; - private CacheConfiguration defaultCacheConfiguration; - private final List cacheManagerPeerProviderFactoryConfiguration = new ArrayList(); - private final List cacheManagerPeerListenerFactoryConfiguration = new ArrayList(); - private SizeOfPolicyConfiguration sizeOfPolicyConfiguration; - private FactoryConfiguration transactionManagerLookupConfiguration; - private FactoryConfiguration cacheManagerEventListenerFactoryConfiguration; - private TerracottaClientConfiguration terracottaConfigConfiguration; - private ManagementRESTServiceConfiguration managementRESTService; - private final Map cacheConfigurations = new ConcurrentHashMap(); - private ConfigurationSource configurationSource; - private boolean dynamicConfig = DEFAULT_DYNAMIC_CONFIG; - private Long maxBytesLocalHeap; - private String maxBytesLocalHeapInput; - private Long maxBytesLocalOffHeap; - private String maxBytesLocalOffHeapInput; - private Long maxBytesLocalDisk; - private String maxBytesLocalDiskInput; - private volatile ClassLoader classLoader = EhcacheDefaultClassLoader.getInstance(); - - /** - * Empty constructor, which is used by {@link ConfigurationFactory}, and can be also used programmatically. - *

- * If you are using it programmtically you need to call the relevant add and setter methods in this class to populate everything. - */ - public Configuration() { - } - - /** - * Returns all active caches managed by the Manager - * @param cacheManager The cacheManager - * @return the Set of all active caches - */ - static Set getAllActiveCaches(CacheManager cacheManager) { - final Set caches = new HashSet(); - for (String cacheName : cacheManager.getCacheNames()) { - final Cache cache = cacheManager.getCache(cacheName); - if (cache != null) { - caches.add(cache); - } - } - return caches; - } - - /** - * Freezes part of the configuration that need to be, and runs validation checks on the Configuration. - * - * @param cacheManager the CacheManager instance being configured - * @throws InvalidConfigurationException With all the associated errors - */ - public RuntimeCfg setupFor(final CacheManager cacheManager, final String fallbackName) throws InvalidConfigurationException { - if (cfg != null) { - if (cfg.cacheManager == cacheManager) { - return cfg; - } else if (cfg.cacheManager.getStatus() != Status.STATUS_SHUTDOWN) { - throw new IllegalStateException("You cannot share a Configuration instance across multiple running CacheManager instances"); - } - } - final Collection errors = validate(); - if (!errors.isEmpty()) { - throw new InvalidConfigurationException(errors); - } - cfg = new Configuration.RuntimeCfg(cacheManager, fallbackName); - return cfg; - } - - /** - * Validates the current configuration - * @return the list of errors withing that configuration - */ - public Collection validate() { - final Collection errors = new ArrayList(); - - for (CacheConfiguration cacheConfiguration : cacheConfigurations.values()) { - errors.addAll(cacheConfiguration.validate(this)); - } - return errors; - } - - /** - * Checks whether the user explicitly set the maxBytesOnDisk - * @return true if set by user, false otherwise - * @see #setMaxBytesLocalDisk(Long) - */ - public boolean isMaxBytesLocalDiskSet() { - return maxBytesLocalDisk != null; - } - - /** - * Checks whether the user explicitly set the maxBytesOffHeat - * @return true if set by user, false otherwise - * @see #setMaxBytesLocalOffHeap(Long) - */ - public boolean isMaxBytesLocalOffHeapSet() { - return maxBytesLocalOffHeap != null; - } - - /** - * Checks whether the user explicitly set the maxBytesOnHeap - * @return true if set by user, false otherwise - * @see #setMaxBytesLocalHeap(Long) - */ - public boolean isMaxBytesLocalHeapSet() { - return maxBytesLocalHeap != null; - } - - - private static FactoryConfiguration getDefaultTransactionManagerLookupConfiguration() { - FactoryConfiguration configuration = new FactoryConfiguration(); - configuration.setClass(DefaultTransactionManagerLookup.class.getName()); - return configuration; - } - - /** - * Builder to set the cache manager name. - *

- * Cache manager names have constraints on the characters they can use: - *

    - *
  • cache managers that are registered as MBeans must obey the {@link javax.management.ObjectName} rules for unquoted value. - * This means the following characters are illegal: ',', '=', ':', '"', '*' and '?'.
  • - *
- * Note that a clustered cache manager is by default registered as MBean. - * - * @see #setName(String) - * @param name - * the name to set - * @return this configuration instance - */ - public final Configuration name(String name) { - setName(name); - return this; - } - - /** - * Allows BeanHandler to set the CacheManager name. - *

- * Cache manager names have constraints on the characters they can use: - *

    - *
  • cache managers that are registered as MBeans must obey the {@link javax.management.ObjectName} rules for unquoted value. - * This means the following characters are illegal: ',', '=', ':', '"', '*' and '?'.
  • - *
- * Note that a clustered cache manager is by default registered as MBean. - */ - public final void setName(String name) { - assertArgumentNotNull("name", name); - final String prop = "cacheManagerName"; - final boolean publishChange = checkDynChange(prop); - String oldValue = this.cacheManagerName; - this.cacheManagerName = name; - if (publishChange) { - firePropertyChange(prop, oldValue, name); - } - } - - private void assertArgumentNotNull(String name, Object object) { - if (object == null) { - throw new IllegalArgumentException(name + " cannot be null"); - } - } - - /** - * CacheManager name - */ - public final String getName() { - return this.cacheManagerName; - } - - /** - * Builder to set the state of the automated update check. - * - * @param updateCheck - * {@code true} if the update check should be turned on; or {@code false} otherwise - * @return this configuration instance - */ - @Deprecated - public final Configuration updateCheck(boolean updateCheck) { - return this; - } - - /** - * Allows BeanHandler to set the updateCheck flag. - */ - @Deprecated - public final void setUpdateCheck(boolean updateCheck) { - // no-op - } - - /** - * Get flag for updateCheck - */ - @Deprecated - public final boolean getUpdateCheck() { - return false; - } - - /** - * Builder to set the default transaction timeout. - * - * @param defaultTransactionTimeoutInSeconds the default transaction timeout in seconds - * @return this configuration instance - */ - public final Configuration defaultTransactionTimeoutInSeconds(int defaultTransactionTimeoutInSeconds) { - setDefaultTransactionTimeoutInSeconds(defaultTransactionTimeoutInSeconds); - return this; - } - - /** - * Allows BeanHandler to set the default transaction timeout. - */ - public final void setDefaultTransactionTimeoutInSeconds(int defaultTransactionTimeoutInSeconds) { - final String prop = "defaultTransactionTimeoutInSeconds"; - final boolean publish = checkDynChange(prop); - final int oldValue = this.defaultTransactionTimeoutInSeconds; - this.defaultTransactionTimeoutInSeconds = defaultTransactionTimeoutInSeconds; - if (publish) { - firePropertyChange(prop, oldValue, defaultTransactionTimeoutInSeconds); - } - } - - /** - * Get default transaction timeout - * @return default transaction timeout in seconds - */ - public final int getDefaultTransactionTimeoutInSeconds() { - return defaultTransactionTimeoutInSeconds; - } - - /** - * Builder to set the monitoring approach - * - * @param monitoring - * an non-null instance of {@link Monitoring} - * @return this configuration instance - */ - public final Configuration monitoring(Monitoring monitoring) { - if (null == monitoring) { - throw new IllegalArgumentException("Monitoring value must be non-null"); - } - final String prop = "monitoring"; - final boolean publish = checkDynChange(prop); - final Monitoring oldValue = this.monitoring; - this.monitoring = monitoring; - if (publish) { - firePropertyChange(prop, oldValue, monitoring); - } - return this; - } - - /** - * Allows BeanHandler to set the monitoring flag - */ - public final void setMonitoring(String monitoring) { - assertArgumentNotNull("Monitoring", monitoring); - monitoring(Monitoring.valueOf(Monitoring.class, monitoring.toUpperCase())); - } - - /** - * Get monitoring type, should not be null - */ - public final Monitoring getMonitoring() { - return this.monitoring; - } - - /** - * Builder to set the dynamic config capability - * - * @param dynamicConfig - * {@code true} if dynamic config should be enabled; or {@code false} otherwise. - * @return this configuration instance - */ - public final Configuration dynamicConfig(boolean dynamicConfig) { - setDynamicConfig(dynamicConfig); - return this; - } - - /** - * Allows BeanHandler to set the dynamic configuration flag - */ - public final void setDynamicConfig(boolean dynamicConfig) { - final String prop = "dynamicConfig"; - final boolean publish = checkDynChange(prop); - final boolean oldValue = this.dynamicConfig; - this.dynamicConfig = dynamicConfig; - if (publish) { - firePropertyChange(prop, oldValue, dynamicConfig); - } - } - - /** - * Get flag for dynamicConfig - */ - public final boolean getDynamicConfig() { - return this.dynamicConfig; - } - - /** - * Maximum amount of bytes the CacheManager will use on the heap - * @return amount of bytes, 0 is unbound - */ - public long getMaxBytesLocalHeap() { - return maxBytesLocalHeap == null ? DEFAULT_MAX_BYTES_ON_HEAP : maxBytesLocalHeap; - } - - /** - * Sets maximum amount of bytes the CacheManager will use on the Disk Tier. - * @param maxBytesOnHeap String representation of the size. - * @see MemoryUnit#parseSizeInBytes(String) - */ - public void setMaxBytesLocalHeap(final String maxBytesOnHeap) { - assertArgumentNotNull("MaxBytesLocalHeap", maxBytesOnHeap); - - final String origInput = maxBytesLocalHeapInput; - try { - maxBytesLocalHeapInput = maxBytesOnHeap; - if (isPercentage(maxBytesOnHeap)) { - long maxMemory = Runtime.getRuntime().maxMemory(); - long mem = maxMemory / HUNDRED * parsePercentage(maxBytesOnHeap); - setMaxBytesLocalHeap(mem); - } else { - setMaxBytesLocalHeap(MemoryUnit.parseSizeInBytes(maxBytesOnHeap)); - } - } catch (RuntimeException rte) { - maxBytesLocalHeapInput = origInput; - throw rte; - } - } - - /** - * @return Original input for maxBytesLocalHeap - */ - public String getMaxBytesLocalHeapAsString() { - return maxBytesLocalHeapInput != null ? maxBytesLocalHeapInput : Long.toString(getMaxBytesLocalHeap()); - } - - private int parsePercentage(final String stringValue) { - String trimmed = stringValue.trim(); - int percentage = Integer.parseInt(trimmed.substring(0, trimmed.length() - 1)); - if (percentage > HUNDRED || percentage < 0) { - throw new IllegalArgumentException("Percentage need values need to be between 0 and 100 inclusive, but got : " + percentage); - } - return percentage; - } - - private boolean isPercentage(final String stringValue) { - String trimmed = stringValue.trim(); - return trimmed.charAt(trimmed.length() - 1) == '%'; - } - - /** - * Sets the maximum amount of bytes the cache manager being configured will use on the OnHeap tier - * @param maxBytesOnHeap amount of bytes - */ - public void setMaxBytesLocalHeap(final Long maxBytesOnHeap) { - final String prop = "maxBytesLocalHeap"; - verifyGreaterThanZero(maxBytesOnHeap, prop); - final boolean publish = checkDynChange(prop); - Long oldValue = this.maxBytesLocalHeap; - this.maxBytesLocalHeap = maxBytesOnHeap; - if (publish) { - firePropertyChange(prop, oldValue, maxBytesOnHeap); - } - } - - /** - * Sets the maxOnHeap size for the cache being configured - * @param amount the amount of unit - * @param memoryUnit the actual unit - * @return this - * @see #setMaxBytesLocalHeap(Long) - */ - public Configuration maxBytesLocalHeap(final long amount, final MemoryUnit memoryUnit) { - setMaxBytesLocalHeap(memoryUnit.toBytes(amount)); - return this; - } - - /** - * Maximum amount of bytes the CacheManager will use on the OffHeap Tier. - * @return amount in bytes - */ - public long getMaxBytesLocalOffHeap() { - return maxBytesLocalOffHeap == null ? DEFAULT_MAX_BYTES_OFF_HEAP : maxBytesLocalOffHeap; - } - - /** - * Sets maximum amount of bytes the CacheManager will use on the OffHeap Tier. - * @param maxBytesOffHeap String representation of the size. - * @see MemoryUnit#parseSizeInBytes(String) - */ - public void setMaxBytesLocalOffHeap(final String maxBytesOffHeap) { - assertArgumentNotNull("MaxBytesLocalOffHeap", maxBytesOffHeap); - - final String origInput = maxBytesLocalOffHeapInput; - try { - maxBytesLocalOffHeapInput = maxBytesOffHeap; - if (isPercentage(maxBytesOffHeap)) { - long maxMemory = getOffHeapLimit(); - long mem = maxMemory / HUNDRED * parsePercentage(maxBytesOffHeap); - setMaxBytesLocalOffHeap(mem); - } else { - setMaxBytesLocalOffHeap(MemoryUnit.parseSizeInBytes(maxBytesOffHeap)); - } - } catch (RuntimeException rte) { - maxBytesLocalOffHeapInput = origInput; - throw rte; - } - } - - /** - * @return Original input for maxBytesLocalOffHeap - */ - public String getMaxBytesLocalOffHeapAsString() { - return maxBytesLocalOffHeapInput != null ? maxBytesLocalOffHeapInput : Long.toString(getMaxBytesLocalOffHeap()); - } - - /** - * @return Total amount offheap configured by current caches - */ - public long getTotalConfiguredOffheap() { - long total = getMaxBytesLocalOffHeap(); - for (String cacheName : getCacheConfigurationsKeySet()) { - CacheConfiguration config = getCacheConfigurations().get(cacheName); - total += config.getMaxBytesLocalOffHeap(); - } - return total; - } - - private long getOffHeapLimit() { - try { - Class enterpriseFmClass = (Class) Class.forName(FeaturesManager.ENTERPRISE_FM_CLASSNAME); - - try { - return (Long)enterpriseFmClass.getMethod("getMaxBytesAllocatable").invoke(null); - } catch (NoSuchMethodException e) { - throw new CacheException("Cache: " + getName() + " cannot find static factory" - + " method create(Ehcache, String)" + " in store class " + FeaturesManager.ENTERPRISE_FM_CLASSNAME, e); - } catch (InvocationTargetException e) { - Throwable cause = e.getCause(); - throw new CacheException("Cache: " + getName() + " cannot instantiate store " - + FeaturesManager.ENTERPRISE_FM_CLASSNAME, cause); - } catch (IllegalAccessException e) { - throw new CacheException("Cache: " + getName() + " cannot instantiate store " - + FeaturesManager.ENTERPRISE_FM_CLASSNAME, e); - } - } catch (ClassNotFoundException e) { - throw new CacheException("Cache " + getName() - + " cannot be configured because the off-heap store class could not be found. " - + "You must use an enterprise version of Ehcache to successfully enable overflowToOffHeap."); - } - } - - /** - * Sets maximum amount of bytes the CacheManager will use on the OffHeap Tier. - * @param maxBytesOffHeap max bytes on disk in bytes. Needs be be greater than 0 - */ - public void setMaxBytesLocalOffHeap(final Long maxBytesOffHeap) { - String prop = "maxBytesLocalOffHeap"; - verifyGreaterThanZero(maxBytesOffHeap, prop); - boolean publish = checkDynChange(prop); - Long oldValue = this.maxBytesLocalOffHeap; - this.maxBytesLocalOffHeap = maxBytesOffHeap; - if (publish) { - firePropertyChange(prop, oldValue, maxBytesOffHeap); - } - } - - /** - * Sets the maximum size for the OffHeap tier for all the caches this CacheManagers holds. - * @param amount the amount of unit - * @param memoryUnit the actual unit - * @return this - */ - public Configuration maxBytesLocalOffHeap(final long amount, final MemoryUnit memoryUnit) { - setMaxBytesLocalOffHeap(memoryUnit.toBytes(amount)); - return this; - } - - /** - * Maximum amount of bytes the CacheManager will use on the Disk Tier. - * @return amount in bytes - */ - public long getMaxBytesLocalDisk() { - return maxBytesLocalDisk == null ? DEFAULT_MAX_BYTES_ON_DISK : maxBytesLocalDisk; - } - - /** - * Sets maximum amount of bytes the CacheManager will use on the Disk Tier. - * @param maxBytesOnDisk String representation of the size. - * @see MemoryUnit#parseSizeInBytes(String) - */ - public void setMaxBytesLocalDisk(final String maxBytesOnDisk) { - assertArgumentNotNull("MaxBytesLocalDisk", maxBytesOnDisk); - - final String origInput = maxBytesLocalDiskInput; - try { - maxBytesLocalDiskInput = maxBytesOnDisk; - setMaxBytesLocalDisk(MemoryUnit.parseSizeInBytes(maxBytesOnDisk)); - } catch (RuntimeException rte) { - maxBytesLocalDiskInput = origInput; - throw rte; - } - } - - /** - * @return Original input for maxBytesLocalDisk - */ - public String getMaxBytesLocalDiskAsString() { - return maxBytesLocalDiskInput != null ? maxBytesLocalDiskInput : Long.toString(getMaxBytesLocalDisk()); - } - - /** - * Sets maximum amount of bytes the CacheManager will use on the Disk Tier. - * @param maxBytesOnDisk max bytes on disk in bytes. Needs be be greater than 0 - */ - public void setMaxBytesLocalDisk(final Long maxBytesOnDisk) { - String prop = "maxBytesLocalDisk"; - verifyGreaterThanZero(maxBytesOnDisk, prop); - boolean publish = checkDynChange(prop); - Long oldValue = this.maxBytesLocalDisk; - this.maxBytesLocalDisk = maxBytesOnDisk; - if (publish) { - firePropertyChange(prop, oldValue, maxBytesOnDisk); - } - } - - /** - * Sets the maxOnDisk size - * @param amount the amount of unit - * @param memoryUnit the actual unit - * @return this - * @see #setMaxBytesLocalDisk(Long) - */ - public Configuration maxBytesLocalDisk(final long amount, final MemoryUnit memoryUnit) { - setMaxBytesLocalDisk(memoryUnit.toBytes(amount)); - return this; - } - - private void verifyGreaterThanZero(final Long maxBytesOnHeap, final String field) { - if (maxBytesOnHeap != null && maxBytesOnHeap < 1) { - throw new IllegalArgumentException(field + " has to be larger than 0"); - } - } - - /** - * Builder to add a disk store to the cache manager, only one disk store can be added. - * - * @param diskStoreConfigurationParameter - * the disk store configuration to use - * @return this configuration instance - * @throws ObjectExistsException - * if the disk store has already been configured - */ - public final Configuration diskStore(DiskStoreConfiguration diskStoreConfigurationParameter) throws ObjectExistsException { - addDiskStore(diskStoreConfigurationParameter); - return this; - } - - /** - * Allows BeanHandler to add disk store location to the configuration. - */ - public final void addDiskStore(DiskStoreConfiguration diskStoreConfigurationParameter) throws ObjectExistsException { - if (diskStoreConfiguration != null) { - throw new ObjectExistsException("The Disk Store has already been configured"); - } - final String prop = "diskStoreConfiguration"; - boolean publish = checkDynChange(prop); - DiskStoreConfiguration oldValue = diskStoreConfiguration; - diskStoreConfiguration = diskStoreConfigurationParameter; - if (publish) { - firePropertyChange(prop, oldValue, diskStoreConfiguration); - } - } - - /** - * Builder to set the default SizeOfPolicyConfiguration for this cache manager. - * - * @param sizeOfPolicyConfiguration the SizeOfPolicy Configuration - * @return this configuration instance - */ - public final Configuration sizeOfPolicy(SizeOfPolicyConfiguration sizeOfPolicyConfiguration) { - addSizeOfPolicy(sizeOfPolicyConfiguration); - return this; - } - - /** - * Sets the default SizeOfPolicyConfiguration for this cache manager. - * - * @param sizeOfPolicy the SizeOfPolicy Configuration - */ - public final void addSizeOfPolicy(SizeOfPolicyConfiguration sizeOfPolicy) { - if (sizeOfPolicyConfiguration != null) { - throw new ObjectExistsException("The SizeOfPolicy class has already been configured"); - } - sizeOfPolicyConfiguration = sizeOfPolicy; - } - - /** - * Builder to add a transaction manager lookup class to the cache manager, only one of these can be added. - * - * @param transactionManagerLookupParameter - * the transaction manager lookup class to use - * @return this configuration instance - * @throws ObjectExistsException - * if the transaction manager lookup has already been configured - */ - public final Configuration transactionManagerLookup(FactoryConfiguration transactionManagerLookupParameter) - throws ObjectExistsException { - addTransactionManagerLookup(transactionManagerLookupParameter); - return this; - } - - /** - * Allows BeanHandler to add transaction manager lookup to the configuration. - */ - public final void addTransactionManagerLookup(FactoryConfiguration transactionManagerLookupParameter) throws ObjectExistsException { - if (transactionManagerLookupConfiguration != null) { - throw new ObjectExistsException("The TransactionManagerLookup class has already been configured"); - } - final String prop = "transactionManagerLookupConfiguration"; - boolean publish = checkDynChange(prop); - FactoryConfiguration oldValue = this.transactionManagerLookupConfiguration; - transactionManagerLookupConfiguration = transactionManagerLookupParameter; - if (publish) { - firePropertyChange(prop, oldValue, transactionManagerLookupParameter); - } - } - - /** - * Builder to set the event lister through a factory, only one of these can be added and subsequent calls are ignored. - * - * @return this configuration instance - */ - public final Configuration cacheManagerEventListenerFactory(FactoryConfiguration cacheManagerEventListenerFactoryConfiguration) { - addCacheManagerEventListenerFactory(cacheManagerEventListenerFactoryConfiguration); - return this; - } - - /** - * Allows BeanHandler to add the CacheManagerEventListener to the configuration. - */ - public final void addCacheManagerEventListenerFactory(FactoryConfiguration cacheManagerEventListenerFactoryConfiguration) { - final String prop = "cacheManagerEventListenerFactoryConfiguration"; - boolean publish = checkDynChange(prop); - if (this.cacheManagerEventListenerFactoryConfiguration == null) { - this.cacheManagerEventListenerFactoryConfiguration = cacheManagerEventListenerFactoryConfiguration; - if (publish) { - firePropertyChange(prop, null, cacheManagerEventListenerFactoryConfiguration); - } - } - } - - /** - * Builder method to add a peer provider through a factory. - * - * @return this configuration instance - */ - public final Configuration cacheManagerPeerProviderFactory(FactoryConfiguration factory) { - addCacheManagerPeerProviderFactory(factory); - return this; - } - - /** - * Adds a CacheManagerPeerProvider through FactoryConfiguration. - */ - public final void addCacheManagerPeerProviderFactory(FactoryConfiguration factory) { - final String prop = "cacheManagerPeerProviderFactoryConfiguration"; - boolean publish = checkDynChange(prop); - List oldValue = null; - if (publish) { - oldValue = new ArrayList(cacheManagerPeerProviderFactoryConfiguration); - } - cacheManagerPeerProviderFactoryConfiguration.add(factory); - if (publish) { - firePropertyChange(prop, oldValue, cacheManagerPeerProviderFactoryConfiguration); - } - } - - /** - * Builder method to add a peer listener through a factory. - * - * @return this configuration instance - */ - public final Configuration cacheManagerPeerListenerFactory(FactoryConfiguration factory) { - addCacheManagerPeerListenerFactory(factory); - return this; - } - - /** - * Adds a CacheManagerPeerListener through FactoryConfiguration. - */ - public final void addCacheManagerPeerListenerFactory(FactoryConfiguration factory) { - final String prop = "cacheManagerPeerListenerFactoryConfiguration"; - boolean publish = checkDynChange(prop); - List oldValue = null; - if (publish) { - oldValue = new ArrayList(cacheManagerPeerListenerFactoryConfiguration); - } - cacheManagerPeerListenerFactoryConfiguration.add(factory); - if (publish) { - firePropertyChange(prop, oldValue, cacheManagerPeerListenerFactoryConfiguration); - } - } - - /** - * Builder method to Terracotta capabilities to the cache manager through a dedicated configuration, this can only be used once. - * - * @return this configuration instance - * @throws ObjectExistsException - * if the Terracotta config has already been configured - */ - public final Configuration terracotta(TerracottaClientConfiguration terracottaConfiguration) throws ObjectExistsException { - addTerracottaConfig(terracottaConfiguration); - return this; - } - - /** - * Allows BeanHandler to add a Terracotta configuration to the configuration - */ - public final void addTerracottaConfig(TerracottaClientConfiguration terracottaConfiguration) throws ObjectExistsException { - if (this.terracottaConfigConfiguration != null && terracottaConfiguration != null) { - throw new ObjectExistsException("The TerracottaConfig has already been configured"); - } - final String prop = "terracottaConfigConfiguration"; - final boolean publish = checkDynChange(prop); - final TerracottaClientConfiguration oldValue = this.terracottaConfigConfiguration; - this.terracottaConfigConfiguration = terracottaConfiguration; - if (publish) { - firePropertyChange(prop, oldValue, terracottaConfiguration); - } - } - - /** - * Builder method to REST management capabilities to the cache manager through a dedicated configuration, this can only be used once. - * - * @return this configuration instance - * @throws ObjectExistsException - * if the REST management config has already been configured - */ - public final Configuration managementRESTService(ManagementRESTServiceConfiguration cfg) throws ObjectExistsException { - addManagementRESTService(cfg); - return this; - } - - /** - * Allows BeanHandler to add a ManagementRESTService configuration to the configuration - */ - public final void addManagementRESTService(ManagementRESTServiceConfiguration managementRESTServiceConfiguration) throws ObjectExistsException { - if (this.managementRESTService != null) { - throw new ObjectExistsException("The ManagementRESTService has already been configured"); - } - - final String prop = "managementRESTService"; - final boolean publish = checkDynChange(prop); - final ManagementRESTServiceConfiguration oldValue = this.managementRESTService; - this.managementRESTService = managementRESTServiceConfiguration; - if (publish) { - firePropertyChange(prop, oldValue, managementRESTServiceConfiguration); - } - } - - /** - * Builder method to set the default cache configuration, this can only be used once. - * - * @return this configuration instance - * @throws ObjectExistsException - * if the default cache config has already been configured - */ - public final Configuration defaultCache(CacheConfiguration defaultCacheConfiguration) throws ObjectExistsException { - setDefaultCacheConfiguration(defaultCacheConfiguration); - return this; - } - - /** - * Allows BeanHandler to add a default configuration to the configuration. - */ - public final void addDefaultCache(CacheConfiguration defaultCacheConfiguration) throws ObjectExistsException { - if (this.defaultCacheConfiguration != null) { - throw new ObjectExistsException("The Default Cache has already been configured"); - } - setDefaultCacheConfiguration(defaultCacheConfiguration); - } - - /** - * Builder to add a new cache through its config - * - * @return this configuration instance - * @throws ObjectExistsException - * if a cache with the same name already exists, or if the name conflicts with the name of the default cache - */ - public final Configuration cache(CacheConfiguration cacheConfiguration) throws ObjectExistsException { - addCache(cacheConfiguration); - return this; - } - - /** - * Allows BeanHandler to add Cache Configurations to the configuration. - */ - public final void addCache(CacheConfiguration cacheConfiguration) throws ObjectExistsException { - addCache(cacheConfiguration, true); - } - - /** - * Maintains the known Cache's configuration map in this Configuration - * @param cacheConfiguration the CacheConfiguration - * @param strict true if added regularly, validation dyn config constraints, false if added through the cache being added - */ - void addCache(CacheConfiguration cacheConfiguration, final boolean strict) throws ObjectExistsException { - final String prop = "cacheConfigurations"; - Object oldValue = null; - boolean publishChange = strict && checkDynChange(prop); - if (publishChange) { - oldValue = new HashMap(cacheConfigurations); - } - if (cacheConfigurations.get(cacheConfiguration.name) != null) { - throw new ObjectExistsException("Cannot create cache: " + cacheConfiguration.name + " with the same name as an existing one."); - } - if (cacheConfiguration.name.equalsIgnoreCase(net.sf.ehcache.Cache.DEFAULT_CACHE_NAME)) { - throw new ObjectExistsException("The Default Cache has already been configured"); - } - - cacheConfigurations.put(cacheConfiguration.name, cacheConfiguration); - if (publishChange) { - firePropertyChange(prop, oldValue, cacheConfigurations); - } - } - - private boolean checkDynChange(final String prop) { - if (!propertyChangeListeners.isEmpty()) { - try { - if (cfg != null) { - DynamicProperty.valueOf(prop); - } - } catch (IllegalArgumentException e) { - throw new IllegalStateException(this.getClass().getName() + "." + prop + " can't be changed dynamically"); - } - return true; - } else { - return false; - } - } - - /** - * Gets a Map of cacheConfigurations. - */ - public final Set getCacheConfigurationsKeySet() { - return cacheConfigurations.keySet(); - } - - /** - * @return the configuration's default cache configuration - */ - public final CacheConfiguration getDefaultCacheConfiguration() { - return defaultCacheConfiguration; - } - - /** - * @param defaultCacheConfiguration - */ - public final void setDefaultCacheConfiguration(CacheConfiguration defaultCacheConfiguration) { - final String prop = "defaultCacheConfiguration"; - final boolean publish = checkDynChange(prop); - final CacheConfiguration oldValue = this.defaultCacheConfiguration; - this.defaultCacheConfiguration = defaultCacheConfiguration; - if (publish) { - firePropertyChange(prop, oldValue, defaultCacheConfiguration); - } - } - - /** - * Gets the disk store configuration. - */ - public final DiskStoreConfiguration getDiskStoreConfiguration() { - return diskStoreConfiguration; - } - - /** - * Gets the SizeOf policy configuration. - */ - public final SizeOfPolicyConfiguration getSizeOfPolicyConfiguration() { - if (sizeOfPolicyConfiguration == null) { - return DEFAULT_SIZEOF_POLICY_CONFIGURATION; - } - return sizeOfPolicyConfiguration; - } - - /** - * Gets the transaction manager lookup configuration. - */ - public final FactoryConfiguration getTransactionManagerLookupConfiguration() { - if (transactionManagerLookupConfiguration == null) { - return getDefaultTransactionManagerLookupConfiguration(); - } - return transactionManagerLookupConfiguration; - } - - /** - * Gets the CacheManagerPeerProvider factory configuration. - */ - public final List getCacheManagerPeerProviderFactoryConfiguration() { - return cacheManagerPeerProviderFactoryConfiguration; - } - - /** - * Gets the CacheManagerPeerListener factory configuration. - */ - public final List getCacheManagerPeerListenerFactoryConfigurations() { - return cacheManagerPeerListenerFactoryConfiguration; - } - - /** - * Gets the ManagementRESTServiceConfiguration - */ - public final ManagementRESTServiceConfiguration getManagementRESTService() { - return managementRESTService; - } - - /** - * Gets the CacheManagerEventListener factory configuration. - */ - public final FactoryConfiguration getCacheManagerEventListenerFactoryConfiguration() { - return cacheManagerEventListenerFactoryConfiguration; - } - - /** - * Gets the TerracottaClientConfiguration - */ - public final TerracottaClientConfiguration getTerracottaConfiguration() { - return this.terracottaConfigConfiguration; - } - - /** - * Gets a Map of cache configurations, keyed by name. - */ - public final Map getCacheConfigurations() { - return cacheConfigurations; - } - - /** - * Builder to set the configuration source. - * - * @return this configuration instance - */ - public final Configuration source(ConfigurationSource configurationSource) { - setSource(configurationSource); - return this; - } - - /** - * Sets the configuration source. - * - * @param configurationSource - * an informative description of the source, preferably - * including the resource name and location. - */ - public final void setSource(ConfigurationSource configurationSource) { - final String prop = "configurationSource"; - final boolean publish = checkDynChange(prop); - final ConfigurationSource oldValue = this.configurationSource; - this.configurationSource = configurationSource; - if (publish) { - firePropertyChange(prop, oldValue, configurationSource); - } - } - - /** - * Gets a description of the source from which this configuration was created. - */ - public final ConfigurationSource getConfigurationSource() { - return configurationSource; - } - - /** - * Adds a {@link PropertyChangeListener} for this configuration - * @param listener the listener instance - * @return true if added, false otherwise - */ - public boolean addPropertyChangeListener(final PropertyChangeListener listener) { - return this.propertyChangeListeners.add(listener); - } - - /** - * Removes a {@link PropertyChangeListener} for this configuration - * @param listener the listener to be removed - * @return true if removed, false otherwise - */ - public boolean removePropertyChangeListener(final PropertyChangeListener listener) { - return this.propertyChangeListeners.remove(listener); - } - - private void firePropertyChange(final String prop, final T oldValue, final T newValue) { - if ((oldValue != null && !oldValue.equals(newValue)) || newValue != null) { - for (PropertyChangeListener propertyChangeListener : propertyChangeListeners) { - propertyChangeListener.propertyChange(new PropertyChangeEvent(Configuration.this, prop, oldValue, newValue)); - } - } - } - - /** - * Runtime configuration as being used by the CacheManager - */ - public class RuntimeCfg implements PropertyChangeListener { - - private final CacheManager cacheManager; - private volatile String cacheManagerName; - private final boolean named; - private TransactionManagerLookup transactionManagerLookup; - private boolean allowsSizeBasedTunings; - - /** - * Constructor - * @param cacheManager the cacheManager instance using this config - * @param fallbackName the fallbackName in case the configuration doesn't declare an explicit name - */ - public RuntimeCfg(final CacheManager cacheManager, final String fallbackName) { - if (Configuration.this.cacheManagerName != null) { - this.cacheManagerName = Configuration.this.cacheManagerName; - named = true; - } else if (hasTerracottaClusteredCaches()) { - this.cacheManagerName = CacheManager.DEFAULT_NAME; - named = false; - } else { - this.cacheManagerName = fallbackName; - named = false; - } - FactoryConfiguration lookupConfiguration = getTransactionManagerLookupConfiguration(); - try { - Properties properties = PropertyUtil.parseProperties(lookupConfiguration.getProperties(), - lookupConfiguration.getPropertySeparator()); - - ClassLoader loader = getClassLoader(); - - // when loading the default impl use the same loader as ehcache itself - if (DEFAULT_TRANSACTION_MANAGER_LOOKUP_CONFIG.getFullyQualifiedClassPath().equals(lookupConfiguration.getFullyQualifiedClassPath())) { - loader = getClass().getClassLoader(); - } - - Class transactionManagerLookupClass = (Class) loader - .loadClass(lookupConfiguration.getFullyQualifiedClassPath()); - this.transactionManagerLookup = transactionManagerLookupClass.newInstance(); - this.transactionManagerLookup.setProperties(properties); - } catch (Exception e) { - LOG.error("could not instantiate transaction manager lookup class: {}", lookupConfiguration.getFullyQualifiedClassPath(), e); - } - this.cacheManager = cacheManager; - propertyChangeListeners.add(this); - allowsSizeBasedTunings = defaultCacheConfiguration == null || !defaultCacheConfiguration.isCountBasedTuned(); - for (CacheConfiguration cacheConfiguration : cacheConfigurations.values()) { - if (cacheConfiguration.isCountBasedTuned()) { - allowsSizeBasedTunings = false; - break; - } - } - } - - /** - * @return the CacheManager's name - */ - public String getCacheManagerName() { - return cacheManagerName; - } - - /** - * @return Whether dynamic config changes are available - */ - public boolean allowsDynamicCacheConfig() { - return getDynamicConfig(); - } - - /** - * @return Whether the CacheManager is explicitly named - */ - public boolean isNamed() { - return named; - } - - /** - * @return the underlying Configuration instance - */ - public Configuration getConfiguration() { - return Configuration.this; - } - - /** - * @return Whether terracotta clustering is being used and rejoin is enabled - */ - public boolean isTerracottaRejoin() { - TerracottaClientConfiguration terracottaConfiguration = getTerracottaConfiguration(); - return terracottaConfiguration != null && terracottaConfiguration.isRejoin(); - } - - private boolean hasTerracottaClusteredCaches() { - if (defaultCacheConfiguration != null - && defaultCacheConfiguration.isTerracottaClustered()) { - return true; - } else { - for (CacheConfiguration config : cacheConfigurations.values()) { - if (config.isTerracottaClustered()) { - return true; - } - } - } - return false; - } - - /** - * @return The transactionManagerLookup instance - */ - public TransactionManagerLookup getTransactionManagerLookup() { - return transactionManagerLookup; - } - - /** - * Removes a cache from the known list - * @param cacheConfiguration the cacheConfiguration to be removed - */ - public void removeCache(final CacheConfiguration cacheConfiguration) { - if (cacheManager.getOnHeapPool() != null) { - cacheManager.getOnHeapPool().setMaxSize(cacheManager.getOnHeapPool() - .getMaxSize() + cacheConfiguration.getMaxBytesLocalHeap()); - } - if (cacheManager.getOnDiskPool() != null) { - cacheManager.getOnDiskPool().setMaxSize(cacheManager.getOnDiskPool() - .getMaxSize() + cacheConfiguration.getMaxBytesLocalDisk()); - } - getConfiguration().getCacheConfigurations().remove(cacheConfiguration.getName()); - } - - /** - * Handles changes to the Configuration this RuntimeCfg backs - * @param evt the PropertyChangeEvent - */ - public void propertyChange(final PropertyChangeEvent evt) { - try { - DynamicProperty.valueOf(evt.getPropertyName()).applyChange(evt, this); - } catch (IllegalArgumentException e) { - throw new IllegalStateException(evt.getPropertyName() + " can't be changed dynamically"); - } - } - - /** - * Checks whether the CacheManager uses a OffHeapPool - * @return true if using one, false otherwise - */ - public boolean hasOffHeapPool() { - return isMaxBytesLocalOffHeapSet(); - } - } - - public ClassLoader getClassLoader() { - return this.classLoader; - } - - /** - * Set the classloader for the cache manager (and it's associated caches) to use when creating application objects (eg. cache values, - * event listeners, etc). The default classloading behavior is to prefer Thread.currentThread().getContextClassLoader() and fallback - * to the classloader that loaded ehcache itself. - * - * @param loader the classloader to use - */ - public void setClassLoader(ClassLoader loader) { - this.classLoader = loader; - } - - public void cleanup() { - propertyChangeListeners.remove(cfg); - cfg = null; - } -} Index: rctags/ehcache-2.10.9.0.411/distribution/.settings/org.eclipse.jdt.ui.prefs =================================================================== diff -u -N --- rctags/ehcache-2.10.9.0.411/distribution/.settings/org.eclipse.jdt.ui.prefs (revision 11412) +++ rctags/ehcache-2.10.9.0.411/distribution/.settings/org.eclipse.jdt.ui.prefs (revision 0) @@ -1,67 +0,0 @@ -# -eclipse.preferences.version=1 -editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true -formatter_profile=_Terracotta profile -formatter_settings_version=11 -org.eclipse.jdt.ui.exception.name=e -org.eclipse.jdt.ui.gettersetter.use.is=true -org.eclipse.jdt.ui.ignorelowercasenames=true -org.eclipse.jdt.ui.importorder=org;com;java;javax; -org.eclipse.jdt.ui.javadoc=false -org.eclipse.jdt.ui.keywordthis=false -org.eclipse.jdt.ui.ondemandthreshold=99 -org.eclipse.jdt.ui.overrideannotation=true -org.eclipse.jdt.ui.staticondemandthreshold=99 -org.eclipse.jdt.ui.text.custom_code_templates=