[
  {
    "path": ".gitignore",
    "content": "*.iml\n*.ipr\n*.iws\n.idea\ntarget\n/.settings\n/.project\n/.classpath\n/.checkstyle\n"
  },
  {
    "path": "LICENSE.txt",
    "content": "\n                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License."
  },
  {
    "path": "README.md",
    "content": "JSR107 (JCache)\n===============\n\nAbout\n-----\n\n*JCache* is the Java caching API. It was defined by JSR107. It defines a standard Java Caching API for use by developers and a standard SPI (\"Service\n Provider Interface\") for use by implementers. \n\n\n## Releases\n\n* 10 May 2019: 1.1.1 Maintenance Release.\n* 16 December 2017: 1.1.0 Maintenance Release. \n* 18 March 2014:  1.0.0. Final Release. Unchanged from 1.0.0-RC1.\n* 16 December 2013:  1.0.0-RC1. This is the version matching the final specification and is what is up on https://jcp.org/aboutJava/communityprocess/final/jsr107/index.html.\n* 21 October 2013:  1.0.0-PFD for the cache-api and 0.11 for other artifacts.Proposed Final Draft\n* 26 August 2013:   0.10 Third Public Review Draft\n* 25 June 2013:     0.9 Second Public Review Draft\n* 25 June 2013:     0.8 Public Review Draft\n* 17 April 2013     0.7\n* 12 February 2013  0.6\n* 13 March 2012:    0.5 Early Draft Submission uses this release.\n* December 2011:    0.4\n* 12 October 2011:  0.3\n* 16 August 2011:   0.2 Initial release\n\nMaven snippet:\n\n    <dependency>\n      <groupId>javax.cache</groupId>\n      <artifactId>cache-api</artifactId>\n      <version>1.0.0</version>\n    </dependency>\n\n\nMaven Central Releases\n----------------------\n\nReleases of jars for binaries, source and javadoc are available on Maven central.\n\nDownload the cache-api from <https://oss.sonatype.org/index.html#nexus-search;quick~javax-cache>\n\nor use the following Maven snippet:\n\n    <dependency>\n      <groupId>javax.cache</groupId>\n      <artifactId>cache-api</artifactId>\n      <version>1.1.1</version>\n    </dependency>\n\nJavadoc\n-------\n\nThe JavaDoc is available as a jar with the releases. You can also find the JavaDoc [online](http://www.javadoc.io/doc/javax.cache/cache-api/1.1.1).\n\nSpecification\n-------------\n\nThe specification is available online as a [Google Doc](https://docs.google.com/document/d/1ijduF_tmHvBaUS7VBBU2ZN8_eEBiFaXXg9OI0_ZxCrA/edit?usp=sharing).\n\nReference Implementation\n------------------------\n\nThe reference implementation (\"RI\") source is available on [GitHub](https://github.com/jsr107/RI).\n\nThis implementation is not meant for production use. For that we would refer you\nto one of the many high quality open source and commercial implementations of JCache. See the [official list of compatible implementions](https://jcp.org/aboutJava/communityprocess/implementations/jsr107/index.html),\nand also the community maintained [JSR107 Test Zoo](https://github.com/cruftex/jsr107-test-zoo/blob/master/report.md).\n\nThe RI is there to ensure that the specification and API works as its only purpose.\n\nFor example, some things that we leave out:\n\n- tiered storage. A simple on-heap store is used.\n- replicated or distributed caching\n\nWhy did we do this? Because a much greater engineering effort, which gets put into the open source and commercial caches\nwhich implement this API, is required to accomplish these things.\n\nHaving said that, the RI is Apache 2 and is a correct implementation of the spec. It can be used to create new cache\nimplementations.\n\nBuilding From Source\n--------------------\n\nBuilding uses Maven in all modules. Maven 3.3.9 - 3.5.4 have been tested.\n\nJCache is compatible with Java 6 to Java 11. We have tested building from Java 8 and Java 11.\n\nSee each module's README.md for build instructions.\n\nPlease add the following to your settings.xml to enable the CDI RI to be sucked down from JBoss.\n\n    <profiles>\n            <profile>\n                <id>jboss-public-repository</id>\n                <repositories>\n                    <repository>\n                        <id>jboss-public-repository-group</id>\n                        <name>JBoss Public Maven Repository Group</name>\n                        <url>https://repository.jboss.org/nexus/content/groups/public-jboss/</url>\n                        <layout>default</layout>\n                        <releases>\n                            <enabled>true</enabled>\n                            <updatePolicy>never</updatePolicy>\n                        </releases>\n                        <snapshots>\n                            <enabled>true</enabled>\n                            <updatePolicy>never</updatePolicy>\n                        </snapshots>\n                    </repository>\n                </repositories>\n                <pluginRepositories>\n                    <pluginRepository>\n                        <id>jboss-public-repository-group</id>\n                        <name>JBoss Public Maven Repository Group</name>\n                        <url>https://repository.jboss.org/nexus/content/groups/public-jboss/</url>\n                        <layout>default</layout>\n                        <releases>\n                            <enabled>true</enabled>\n                            <updatePolicy>never</updatePolicy>\n                        </releases>\n                        <snapshots>\n                            <enabled>true</enabled>\n                            <updatePolicy>never</updatePolicy>\n                        </snapshots>\n                    </pluginRepository>\n                </pluginRepositories>\n            </profile>\n    </profiles>\n\n\n\nTesting Implementions of JSR107\n-------------------------------\n\nSee the [TCK User Guide](https://docs.google.com/document/d/1w3Ugj_oEqjMlhpCkGQOZkd9iPf955ZWHAVdZzEwYYdU/edit?usp=sharing)\nfor instructions on how to use this TCK.\n\nMailing list\n------------\n\nPlease join the mailing list if you're interested in using or developing the software: <http://groups.google.com/group/jsr107>\n\n\nIssue tracker\n-------------\n\nPlease log issues to: <https://github.com/jsr107/jsr107spec/issues>\n\n\nUser Questions\n--------------\n\nSome of the expert group monitor the tags \"jcache\" and \"jsr107\" on [stackoverflow](http://stackoverflow.com).\n\n\nContributing\n------------\n\nAdmission to the Expert Group is closed, but please feel free to post to the mailing list.\n\n\nLicense\n-------\n\nThe API is available under the Apache 2.0 license.\n\nThe TCK is available under a restricted Standalone TCK (SATCK) license and must be \nlicensed from Oracle as is the usual case with JSRs.\n\nThe reference implementation is available under an Apache 2.0 license.\n\nFor details please read the license in each source code file.\n\nContributors\n------------\n\nThis free, open source software was made possible by the JSR107 Expert Group who put many hours of hard work into it.\n\n\nCopyright\n---------\n\nCopyright (c) JSR107 Expert Group\n"
  },
  {
    "path": "bnd.bnd",
    "content": "Export-Package: javax.cache;\\\n\tjavax.cache.annotation;\\\n\tjavax.cache.configuration;\\\n\tjavax.cache.event;\\\n\tjavax.cache.expiry;\\\n\tjavax.cache.integration;\\\n\tjavax.cache.management;\\\n\tjavax.cache.processor;\\\n\tjavax.cache.spi;\\\nBundle-SymbolicName: javax.cache\nBundle-Version: ${project.version}\n\n"
  },
  {
    "path": "checkstyle/ClassHeader.txt",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */"
  },
  {
    "path": "checkstyle/checkstyle.xml",
    "content": "<?xml version=\"1.0\"?>\n<!DOCTYPE module PUBLIC\n        \"-//Puppy Crawl//DTD Check Configuration 1.2//EN\"\n        \"http://www.puppycrawl.com/dtds/configuration_1_2.dtd\">\n\n<module name=\"Checker\">\n    <property name=\"severity\" value=\"error\"/>\n\n    <module name=\"Translation\">\n        <property name=\"severity\" value=\"error\"/>\n    </module>\n\n    <module name=\"JavadocPackage\">\n        <property name=\"allowLegacy\" value=\"true\"/>\n    </module>\n\n    <!-- Header \n    <module name=\"Header\">\n        <property name=\"headerFile\" value=\"${basedir}/checkstyle/ClassHeader.txt\"/>\n    </module>-->\n\n    <module name=\"FileLength\">\n        <property name=\"max\" value=\"1400\"/>\n    </module>\n\n    <!-- Duplicate Code -->\n    <module name=\"StrictDuplicateCode\">\n        <property name=\"min\" value=\"30\"/>\n    </module>\n\n    <module name=\"NewlineAtEndOfFile\">\n        <property name=\"lineSeparator\" value=\"lf\"/>\n        <property name=\"severity\" value=\"warning\"/>\n    </module>\n\n    <module name=\"FileTabCharacter\"/>\n\n    <!-- Miscellaneous -->\n    <module name=\"RegexpSingleline\">\n        <!-- . matches any character, so we need to escape it and use \\. to match dots. -->\n        <property name=\"format\" value=\"System\\.out\\.println\"/>\n    </module>\n    <!-- Make sure commons logging is not used -->\n    <module name=\"RegexpSingleline\">\n        <property name=\"format\"\n                  value=\"import org\\.apache\\.commons\\.logging\\.Log;\"/>\n    </module>\n    <!-- Make sure we are using safe element.get methods everywhere -->\n    <module name=\"RegexpSingleline\">\n        <!-- . matches any character, so we need to escape it and use \\. to match dots. -->\n        <property name=\"format\" value=\"[^entry]\\\\.getKey\\\\(\\\\)\"/>\n    </module>\n    <module name=\"RegexpSingleline\">\n        <!-- . matches any character, so we need to escape it and use \\. to match dots. -->\n        <property name=\"format\" value=\"[^entry]\\\\.getValue\\\\(\\\\)\"/>\n    </module>\n\n    <module name=\"TreeWalker\">\n        <!--<property name=\"cacheFile\" value=\"checkstyle.cache}\"/>-->\n\n        <!--Java 5 checks-->\n        <module name=\"MissingDeprecated\">\n            <property name=\"severity\" value=\"warning\"/>\n        </module>\n\n        <!-- javadoc -->\n        <module name=\"JavadocType\"/>\n        <module name=\"JavadocMethod\">\n            <property name=\"scope\" value=\"package\"/>\n            <property name=\"allowMissingParamTags\" value=\"true\"/>\n            <property name=\"allowMissingThrowsTags\" value=\"true\"/>\n            <property name=\"allowMissingReturnTag\" value=\"true\"/>\n            <property name=\"allowUndeclaredRTE\" value=\"true\"/>\n        </module>\n        <module name=\"JavadocVariable\">\n            <property name=\"scope\" value=\"package\"/>\n        </module>\n        <module name=\"JavadocStyle\">\n            <property name=\"scope\" value=\"public\"/>\n            <property name=\"checkFirstSentence\" value=\"false\"/>\n        </module>\n\n        <!-- Naming Conventions -->\n        <module name=\"ConstantName\"/>\n        <module name=\"MethodName\"/>\n        <module name=\"StaticVariableName\"/>\n        <module name=\"LocalFinalVariableName\"/>\n        <module name=\"LocalVariableName\"/>\n        <module name=\"MemberName\"/>\n        <module name=\"PackageName\">\n            <property name=\"format\" value=\"^[a-z]+(\\.[a-z][a-z0-9]*)*$\"/>\n        </module>\n        <module name=\"ParameterName\"/>\n        <module name=\"TypeName\"/>\n\n\n        <!-- Imports -->\n        <module name=\"AvoidStarImport\"/>\n        <module name=\"IllegalImport\"/>\n        <module name=\"RedundantImport\"/>\n        <module name=\"UnusedImports\">\n            <property name=\"processJavadoc\" value=\"true\"/>\n        </module>\n\n        <!-- Size Violations -->\n        <module name=\"LineLength\">\n            <property name=\"max\" value=\"150\"/>\n            <property name=\"ignorePattern\" value=\"^ *\\* *\"/>\n        </module>\n        <module name=\"MethodLength\">\n            <property name=\"max\" value=\"200\"/>\n            <property name=\"tokens\" value=\"METHOD_DEF\"/>\n        </module>\n        <module name=\"MethodLength\">\n            <property name=\"max\" value=\"60\"/>\n            <property name=\"tokens\" value=\"CTOR_DEF\"/>\n        </module>\n        <module name=\"ParameterNumber\">\n            <property name=\"max\" value=\"8\"/>\n            <property name=\"tokens\" value=\"METHOD_DEF\"/>\n        </module>\n        <module name=\"ParameterNumber\">\n            <property name=\"max\" value=\"12\"/>\n            <property name=\"tokens\" value=\"CTOR_DEF\"/>\n        </module>\n        <module name=\"AnonInnerLength\">\n            <property name=\"max\" value=\"25\"/>\n        </module>\n        <module name=\"ExecutableStatementCount\">\n            <property name=\"max\" value=\"20\"/>\n            <property name=\"tokens\" value=\"CTOR_DEF, INSTANCE_INIT, STATIC_INIT\"/>\n        </module>\n\n        <!-- Whitespace -->\n        <module name=\"EmptyForInitializerPad\"/>\n        <module name=\"EmptyForIteratorPad\"/>\n        <module name=\"MethodParamPad\"/>\n        <module name=\"NoWhitespaceAfter\">\n            <property name=\"allowLineBreaks\" value=\"false\"/>\n        </module>\n        <module name=\"NoWhitespaceBefore\">\n            <property name=\"allowLineBreaks\" value=\"false\"/>\n        </module>\n        <module name=\"ParenPad\"/>\n        <module name=\"GenericWhitespace\"/>\n        <module name=\"WhitespaceAfter\">\n            <property name=\"tokens\" value=\"COMMA, SEMI\"/>\n        </module>\n        <module name=\"WhitespaceAround\">\n            <property name=\"tokens\"\n                      value=\"ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN, EQUAL, GE, GT, LAND, LCURLY, LE, LITERAL_ASSERT, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, LOR, LT, MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN, NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION, RCURLY, SL, SLIST, SL_ASSIGN, SR, SR_ASSIGN, STAR, STAR_ASSIGN\"/>\n            <property name=\"allowEmptyConstructors\" value=\"true\"/>\n            <property name=\"allowEmptyMethods\" value=\"true\"/>\n        </module>\n        <module name=\"OperatorWrap\">\n            <property name=\"tokens\"\n                      value=\"ASSIGN, DIV_ASSIGN, PLUS_ASSIGN, MINUS_ASSIGN, STAR_ASSIGN, MOD_ASSIGN, SR_ASSIGN, BSR_ASSIGN, SL_ASSIGN, BXOR_ASSIGN, BOR_ASSIGN, BAND_ASSIGN\"/>\n            <property name=\"option\" value=\"eol\"/>\n        </module>\n\n        <!-- Modifiers -->\n        <module name=\"ModifierOrder\">\n            <property name=\"severity\" value=\"warning\"/>\n        </module>\n        <module name=\"RedundantModifier\">\n            <property name=\"severity\" value=\"warning\"/>\n        </module>\n\n        <!-- Blocks -->\n        <module name=\"EmptyBlock\">\n            <property name=\"option\" value=\"text\"/>\n            <property name=\"tokens\" value=\"LITERAL_CATCH\"/>\n        </module>\n        <module name=\"EmptyBlock\">\n            <property name=\"tokens\"\n                      value=\"LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_IF, LITERAL_FOR, LITERAL_TRY, LITERAL_WHILE, STATIC_INIT\"/>\n        </module>\n        <module name=\"RightCurly\">\n            <property name=\"option\" value=\"same\"/>\n        </module>\n        <module name=\"LeftCurly\"/>\n        <module name=\"AvoidNestedBlocks\">\n            <property name=\"allowInSwitchCase\" value=\"true\"/>\n        </module>\n\n        <!-- Coding Problems -->\n        <module name=\"ArrayTrailingComma\"/>\n        <module name=\"CovariantEquals\"/>\n        <module name=\"DeclarationOrder\"/>\n        <module name=\"ParameterAssignment\"/>\n        <module name=\"ExplicitInitialization\"/>\n        <module name=\"DefaultComesLast\"/>\n        <module name=\"FallThrough\"/>\n        <module name=\"MultipleVariableDeclarations\"/>\n        <module name=\"EmptyStatement\"/>\n        <module name=\"HiddenField\">\n            <property name=\"tokens\" value=\"VARIABLE_DEF\"/>\n        </module>\n        <module name=\"IllegalInstantiation\">\n            <property name=\"classes\" value=\"java.lang.Boolean\"/>\n        </module>\n        <module name=\"IllegalTokenText\">\n            <property name=\"tokens\" value=\"NUM_INT,NUM_LONG\"/>\n            <property name=\"format\" value=\"^0[^lx]\"/>\n            <property name=\"ignoreCase\" value=\"true\"/>\n        </module>\n        <module name=\"IllegalType\">\n            <property name=\"ignoredMethodNames\" value=\"getInstance\"/>\n            <property name=\"tokens\" value=\"PARAMETER_DEF, METHOD_DEF\"/>\n        </module>\n        <module name=\"InnerAssignment\"/>\n        <module name=\"JUnitTestCase\"/>\n        <module name=\"ReturnCount\">\n            <property name=\"max\" value=\"5\"/>\n        </module>\n        <module name=\"NestedIfDepth\">\n            <property name=\"max\" value=\"2\"/>\n        </module>\n        <module name=\"NestedTryDepth\">\n            <property name=\"max\" value=\"2\"/>\n        </module>\n        <module name=\"PackageDeclaration\"/>\n        <module name=\"RedundantThrows\">\n            <property name=\"severity\" value=\"warning\"/>\n            <property name=\"allowUnchecked\" value=\"true\"/>\n        </module>\n        <module name=\"SimplifyBooleanExpression\"/>\n        <module name=\"SimplifyBooleanReturn\"/>\n        <module name=\"StringLiteralEquality\"/>\n        <module name=\"SuperClone\"/>\n        <module name=\"SuperFinalize\"/>\n        <module name=\"MagicNumber\"/>\n        <module name=\"EqualsHashCode\"/>\n        <module name=\"IllegalInstantiation\"/>\n        <module name=\"InnerAssignment\"/>\n        <module name=\"MissingSwitchDefault\"/>\n\n        <!-- Class Design -->\n        <module name=\"FinalClass\"/>\n        <module name=\"HideUtilityClassConstructor\">\n            <property name=\"severity\" value=\"warning\"/>\n        </module>\n        <module name=\"InterfaceIsType\"/>\n        <module name=\"MutableException\"/>\n        <module name=\"ThrowsCount\">\n            <property name=\"max\" value=\"3\"/>\n        </module>\n        <module name=\"VisibilityModifier\">\n            <property name=\"protectedAllowed\" value=\"true\"/>\n        </module>\n\n        <!-- Metrics -->\n        <module name=\"BooleanExpressionComplexity\">\n            <property name=\"max\" value=\"4\"/>\n        </module>\n        <module name=\"ClassDataAbstractionCoupling\">\n            <property name=\"max\" value=\"15\"/>\n        </module>\n        <module name=\"ClassFanOutComplexity\">\n            <property name=\"max\" value=\"40\"/>\n        </module>\n        <module name=\"CyclomaticComplexity\">\n            <property name=\"severity\" value=\"error\"/>\n            <property name=\"max\" value=\"12\"/>\n        </module>\n        <module name=\"NPathComplexity\">\n            <property name=\"max\" value=\"50\"/>\n        </module>\n\n        <module name=\"ArrayTypeStyle\"/>\n        <module name=\"TodoComment\">\n            <property name=\"format\" value=\"WARNING\"/>\n        </module>\n        <module name=\"TrailingComment\"/>\n        <module name=\"UpperEll\"/>\n    </module>\n</module>\n"
  },
  {
    "path": "checkstyle/suppressions.xml",
    "content": "<?xml version=\"1.0\"?>\n\n<!DOCTYPE suppressions PUBLIC\n        \"-//Puppy Crawl//DTD Suppressions 1.1//EN\"\n        \"http://www.puppycrawl.com/dtds/suppressions_1_1.dtd\">\n\n<suppressions>\n\n    <!-- Suppress duplicate checking of copyright notice -->\n    <suppress checks=\"StrictDuplicateCode\" files=\".java\" lines=\"1-6\"/>\n\n    <!--Includes Configuration -->\n    <suppress checks=\"StrictDuplicateCode\" files=\"CacheMXBean.java\" lines=\"34-150\"/>\n    <suppress checks=\"StrictDuplicateCode\" files=\"Configuration.java\" lines=\"34-150\"/>\n\n    <suppress checks=\"WhitespaceAround\" files=\"[\\\\/]annotation[\\\\/]\"/>\n    <suppress checks=\"ParenPad\" files=\"[\\\\/]annotation[\\\\/]\"/>\n\n    <suppress checks=\"MagicNumber\" files=\"\"/>\n\n    <suppress checks=\"NPathComplexity\" files=\"MutableCacheEntryListenerConfiguration.java\"/>\n\n    <suppress checks=\"CyclomaticComplexity\" files=\"MutableConfiguration.java\"/>\n    <suppress checks=\"NPathComplexity\" files=\"MutableConfiguration.java\"/>\n\n    <suppress checks=\"IllegalType\" files=\"Caching.java\"/>\n\n    <!--Exclude Clover instrumented sources-->\n    <suppress checks=\"\" files=\"[\\\\/]src-instrumented[\\\\/]\"/>\n</suppressions>\n"
  },
  {
    "path": "findbugs/findbugs-exclude.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<FindBugsFilter>\n    <Match>\n        <!--Two false NO_NOTIFY_NOT_NOTIFYALL errors in CompletionListenerFuture-->\n        <Class name=\"javax.cache.integration.CompletionListenerFuture\" />\n    </Match>\n    <Match>\n        <!--Non problematic SIC_INNER_SHOULD_BE_STATIC_ANON error in anonymous inner class in CachingProviderRegistry -->\n        <Class name=\"javax.cache.Caching$CachingProviderRegistry$1\" />\n    </Match>\n</FindBugsFilter>"
  },
  {
    "path": "pom.xml",
    "content": "<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n         xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\">\n    <modelVersion>4.0.0</modelVersion>\n    <parent>\n        <groupId>org.sonatype.oss</groupId>\n        <artifactId>oss-parent</artifactId>\n        <version>7</version>\n        <!--Fixes broken Maven 3 warning-->\n        <relativePath/>\n    </parent>\n    <groupId>javax.cache</groupId>\n    <artifactId>cache-api</artifactId>\n    <version>1.1.2-SNAPSHOT</version>\n    <packaging>jar</packaging>\n\n    <name>JSR107 API and SPI</name>\n    <url>https://github.com/jsr107/jsr107spec</url>\n    <licenses>\n        <license>\n            <name>Apache License, Version 2.0</name>\n            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>\n            <distribution>repo</distribution>\n            <comments>A business-friendly OSS license</comments>\n        </license>\n    </licenses>\n\n    <properties>\n        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>\n    </properties>\n\n    <dependencies>\n\n        <!--This is only needed if you are using a CDI based implementation of the annotations support.\n            In CDI 1.1. we should be able to remove this dependency completely. -->\n        <dependency>\n            <groupId>javax.enterprise</groupId>\n            <artifactId>cdi-api</artifactId>\n            <version>1.0-SP4</version>\n            <scope>provided</scope>\n            <optional>true</optional>\n            <exclusions>\n                <exclusion>\n                    <artifactId>jsr250-api</artifactId>\n                    <groupId>javax.annotation</groupId>\n                </exclusion>\n                <exclusion>\n                    <artifactId>jboss-interceptors-api_1.1_spec</artifactId>\n                    <groupId>org.jboss.spec.javax.interceptor</groupId>\n                </exclusion>\n                <exclusion>\n                    <artifactId>javax.inject</artifactId>\n                    <groupId>javax.inject</groupId>\n                </exclusion>\n            </exclusions>\n        </dependency>\n\n        <dependency>\n            <groupId>junit</groupId>\n            <artifactId>junit</artifactId>\n            <version>4.11</version>\n            <scope>test</scope>\n        </dependency>\n\n    </dependencies>\n\n    <build>\n        <plugins>\n            <plugin>\n                <artifactId>maven-compiler-plugin</artifactId>\n                <version>3.7.0</version>\n                <configuration>\n                    <source>1.6</source>\n                    <target>1.6</target>\n                </configuration>\n            </plugin>\n\n            <plugin>\n                <groupId>org.apache.maven.plugins</groupId>\n                <artifactId>maven-source-plugin</artifactId>\n                <version>3.0.1</version>\n                <executions>\n                    <execution>\n                        <id>attach-sources</id>\n                        <phase>package</phase>\n                        <goals>\n                            <goal>jar</goal>\n                        </goals>\n                    </execution>\n                </executions>\n            </plugin>\n\n            <plugin>\n                <groupId>org.apache.maven.plugins</groupId>\n                <artifactId>maven-javadoc-plugin</artifactId>\n                <version>3.0.1</version>\n                <executions>\n                    <execution>\n                        <id>attach-javadocs</id>\n                        <goals>\n                            <goal>jar</goal>\n                        </goals>\n                    </execution>\n\n                </executions>\n                <configuration>\n                    <failOnError>false</failOnError>\n                </configuration>\n            </plugin>\n\n            <plugin>\n                <groupId>org.apache.maven.plugins</groupId>\n                <artifactId>maven-checkstyle-plugin</artifactId>\n                <version>2.12</version>\n                <executions>\n                    <execution>\n                        <phase>install</phase>\n                        <goals>\n                            <goal>checkstyle</goal>\n                        </goals>\n                    </execution>\n                </executions>\n                <configuration>\n                    <configLocation>${basedir}/checkstyle/checkstyle.xml\n                    </configLocation>\n                    <suppressionsLocation>${basedir}/checkstyle/suppressions.xml\n                    </suppressionsLocation>\n                    <headerLocation>${basedir}/checkstyle/ClassHeader.txt\n                    </headerLocation>\n                    <enableRSS>false</enableRSS>\n                    <linkXRef>true</linkXRef>\n                    <consoleOutput>true</consoleOutput>\n                    <failsOnError>true</failsOnError>\n                    <failOnViolation>true</failOnViolation>\n                    <includeTestSourceDirectory>false</includeTestSourceDirectory>\n                    <enableRulesSummary>true</enableRulesSummary>\n                </configuration>\n            </plugin>\n\n            <plugin>\n                <artifactId>maven-jar-plugin</artifactId>\n                <version>3.0.2</version>\n                <configuration>\n                    <archive>\n                        <manifestFile>\n                            ${project.build.outputDirectory}/META-INF/MANIFEST.MF\n                        </manifestFile>\n                    </archive>\n                </configuration>\n            </plugin>\n\n            <plugin>\n                <groupId>org.apache.felix</groupId>\n                <artifactId>maven-bundle-plugin</artifactId>\n                <version>2.3.7</version>\n                <extensions>true</extensions>\n                <configuration>\n                    <instructions>\n                        <_include>bnd.bnd</_include>\n                        <Include-Resource>{maven-resources}</Include-Resource>\n                    </instructions>\n                </configuration>\n                <executions>\n                    <execution>\n                        <id>bundle-manifest</id>\n                        <phase>process-classes</phase>\n                        <goals>\n                            <goal>manifest</goal>\n                        </goals>\n                    </execution>\n                </executions>\n            </plugin>\n\n            <plugin>\n                <groupId>org.apache.maven.plugins</groupId>\n                <artifactId>maven-site-plugin</artifactId>\n                <version>3.6</version>\n                <configuration>\n                </configuration>\n            </plugin>\n\n            <!--\n            To run a build with clover instrumentation:\n            mvn clean com.atlassian.maven.plugins:maven-clover2-plugin:setup install\n\n            To run the clover report:\n            mvn com.atlassian.maven.plugins:maven-clover2-plugin:clover\n            -->\n            <plugin>\n                <groupId>com.atlassian.maven.plugins</groupId>\n                <artifactId>maven-clover2-plugin</artifactId>\n                <version>3.2.0</version>\n                <configuration>\n                    <cloverDatabase>${java.io.tmpdir}/clover/clover.db</cloverDatabase>\n                    <singleCloverDatabase>true</singleCloverDatabase>\n                    <license>insert license here</license>\n                    <instrumentation>method</instrumentation>\n                    <includesTestSourceRoots>false</includesTestSourceRoots>\n                </configuration>\n            </plugin>\n\n\n        </plugins>\n    </build>\n\n    <profiles>\n        <profile>\n            <!--Only releases need to be signed. Use mvn -Prelease clean deploy to deploy releases -->\n            <id>release</id>\n            <build>\n                <plugins>\n                    <plugin>\n                        <groupId>org.apache.maven.plugins</groupId>\n                        <artifactId>maven-gpg-plugin</artifactId>\n                        <version>1.5</version>\n                        <executions>\n                            <execution>\n                                <id>sign-artifacts</id>\n                                <phase>verify</phase>\n                                <goals>\n                                    <goal>sign</goal>\n                                </goals>\n                            </execution>\n                        </executions>\n                    </plugin>\n                </plugins>\n            </build>\n        </profile>\n\n        <!-- run doclint on java8.\n             but do not complain if documentation is missing for parameter or return statement.\n             the profile enables automatically on java 8. this is backwards compatible,\n             if someone wants to build on java 7. -->\n        <profile>\n          <id>doclint-java8-all-but-missing</id>\n          <activation>\n            <jdk>[1.8,)</jdk>\n          </activation>\n\n          <build>\n            <plugins>\n              <plugin>\n                <groupId>org.apache.maven.plugins</groupId>\n                <artifactId>maven-javadoc-plugin</artifactId>\n                  <version>3.1.0</version>\n                <configuration>\n                    <doclint>all</doclint>\n                    <doclint>-missing</doclint>\n                </configuration>\n              </plugin>\n            </plugins>\n          </build>\n        </profile>\n\n    </profiles>\n\n    <scm>\n        <connection>scm:git:git@github.com:juven/git-demo.git</connection>\n        <developerConnection>scm:git:git@github.com:juven/git-demo.git\n        </developerConnection>\n        <url>git@github.com:juven/git-demo.git</url>\n    </scm>\n\n\n    <!--Note: site URL repeated here to ensure correct deployment path-->\n    <distributionManagement>\n        <!--\n        The server id here defined must also appear in ~/.m2/settings.xml with username\n        -->\n        <repository>\n            <id>sourceforge-releases</id>\n            <name>Sourceforge Release Repository</name>\n            <url>http://oss.sonatype.org/service/local/staging/deploy/maven2</url>\n        </repository>\n        <snapshotRepository>\n            <id>sourceforge-snapshots</id>\n            <name>Sourceforge Snapshot Repository</name>\n            <url>http://oss.sonatype.org/content/repositories/sourceforge-snapshots</url>\n        </snapshotRepository>\n    </distributionManagement>\n\n    <reporting>\n        <plugins>\n            <plugin>\n                <groupId>org.apache.maven.plugins</groupId>\n                <artifactId>maven-project-info-reports-plugin</artifactId>\n                <version>2.6</version>\n                <reportSets>\n                    <reportSet>\n\n                        <reports><!-- select reports -->\n                            <!--<report>index</report>-->\n                        </reports>\n                    </reportSet>\n                </reportSets>\n            </plugin>\n\n            <!--Use mvn compile site to generate this-->\n            <plugin>\n                <groupId>org.codehaus.mojo</groupId>\n                <artifactId>findbugs-maven-plugin</artifactId>\n                <version>3.0.5</version>\n                <configuration>\n                    <effort>Max</effort>\n                    <threshold>Low</threshold>\n                    <excludeFilterFile>${basedir}/findbugs/findbugs-exclude.xml\n                    </excludeFilterFile>\n                </configuration>\n\n            </plugin>\n            <plugin>\n                <groupId>org.apache.maven.plugins</groupId>\n                <artifactId>maven-jxr-plugin</artifactId>\n                <version>2.5</version>\n            </plugin>\n\n\n        </plugins>\n\n    </reporting>\n\n\n\n</project>\n"
  },
  {
    "path": "src/main/java/javax/cache/Cache.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache;\n\nimport javax.cache.configuration.CacheEntryListenerConfiguration;\nimport javax.cache.configuration.Configuration;\nimport javax.cache.event.CacheEntryListener;\nimport javax.cache.event.CacheEntryRemovedListener;\nimport javax.cache.expiry.ExpiryPolicy;\nimport javax.cache.integration.CacheLoader;\nimport javax.cache.integration.CacheWriter;\nimport javax.cache.integration.CompletionListener;\nimport javax.cache.processor.EntryProcessor;\nimport javax.cache.processor.EntryProcessorException;\nimport javax.cache.processor.EntryProcessorResult;\nimport java.io.Closeable;\nimport java.util.Iterator;\nimport java.util.Map;\nimport java.util.Set;\n\n/**\n * A {@link Cache} is a Map-like data structure that provides temporary storage\n * of application data.\n * <p>\n * Like {@link Map}s, {@link Cache}s\n * <ol>\n * <li>store key-value pairs, each referred to as an {@link Entry}</li>\n * <li>allow use of Java Generics to improve application type-safety</li>\n * <li>are {@link Iterable}</li>\n * </ol>\n * <p>\n * Unlike {@link Map}s, {@link Cache}s\n * <ol>\n * <li>do not allow null keys or values.  Attempts to use <code>null</code>\n * will result in a {@link NullPointerException}</li>\n * <li>provide the ability to read values from a\n * {@link CacheLoader} (read-through-caching)\n * when a value being requested is not in a cache</li>\n * <li>provide the ability to write values to a\n * {@link CacheWriter} (write-through-caching)\n * when a value being created/updated/removed from a cache</li>\n * <li>provide the ability to observe cache entry changes</li>\n * <li>may capture and measure operational statistics</li>\n * </ol>\n * <p>\n * A simple example of how to use a cache is:\n * <pre><code>\n * String cacheName = \"sampleCache\";\n * CachingProvider provider = Caching.getCachingProvider();\n * CacheManager manager = provider.getCacheManager();\n * Cache&lt;Integer, Date&gt; cache = manager.getCache(cacheName, Integer.class,\n *                                                     Date.class);\n * Date value1 = new Date();\n * Integer key = 1;\n * cache.put(key, value1);\n * Date value2 = cache.get(key);\n * </code></pre>\n *\n * @param <K> the type of key\n * @param <V> the type of value\n * @author Greg Luck\n * @author Yannis Cosmadopoulos\n * @author Brian Oliver\n * @since 1.0\n */\npublic interface Cache<K, V> extends Iterable<Cache.Entry<K, V>>, Closeable {\n    /**\n     * Gets an entry from the cache.\n     * <p>\n     * If the cache is configured to use read-through, and get would return null\n     * because the entry is missing from the cache, the Cache's {@link CacheLoader}\n     * is called in an attempt to load the entry.\n     *\n     * @param key the key whose associated value is to be returned\n     * @return the element, or null, if it does not exist.\n     * @throws IllegalStateException if the cache is {@link #isClosed()}\n     * @throws NullPointerException  if the key is null\n     * @throws CacheException        if there is a problem fetching the value\n     * @throws ClassCastException    if the implementation is configured to perform\n     *                               runtime-type-checking, and the key or value\n     *                               types are incompatible with those that have been\n     *                               configured for the {@link Cache}\n     */\n    V get(K key);\n\n    /**\n     * Gets a collection of entries from the {@link Cache}, returning them as\n     * {@link Map} of the values associated with the set of keys requested.\n     * <p>\n     * If the cache is configured read-through, and a get for a key would\n     * return null because an entry is missing from the cache, the Cache's\n     * {@link CacheLoader} is called in an attempt to load the entry. If an\n     * entry cannot be loaded for a given key, the key will not be present in\n     * the returned Map.\n     *\n     * @param keys The keys whose associated values are to be returned.\n     * @return A map of entries that were found for the given keys. Keys not found\n     *         in the cache are not in the returned map.\n     * @throws NullPointerException  if keys is null or if keys contains a null\n     * @throws IllegalStateException if the cache is {@link #isClosed()}\n     * @throws CacheException        if there is a problem fetching the values\n     * @throws ClassCastException    if the implementation is configured to perform\n     *                               runtime-type-checking, and the key or value\n     *                               types are incompatible with those that have been\n     *                               configured for the {@link Cache}\n     */\n    Map<K, V> getAll(Set<? extends K> keys);\n\n    /**\n     * Determines if the {@link Cache} contains an entry for the specified key.\n     * <p>\n     * More formally, returns <tt>true</tt> if and only if this cache contains a\n     * mapping for a key <tt>k</tt> such that <tt>key.equals(k)</tt>.\n     * (There can be at most one such mapping.)</p>\n     * <p>\n     * If the cache is configured read-through the associated {@link CacheLoader}\n     * is not called. Only the cache is checked.\n     * </p>\n     * @param key key whose presence in this cache is to be tested.\n     * @return <tt>true</tt> if this map contains a mapping for the specified key\n     * @throws NullPointerException  if key is null\n     * @throws IllegalStateException if the cache is {@link #isClosed()}\n     * @throws CacheException        it there is a problem checking the mapping\n     * @throws ClassCastException    if the implementation is configured to perform\n     *                               runtime-type-checking, and the key or value\n     *                               types are incompatible with those that have been\n     *                               configured for the {@link Cache}\n     * @see java.util.Map#containsKey(Object)\n     */\n    boolean containsKey(K key);\n\n    /**\n     * Asynchronously loads the specified entries into the cache using the\n     * configured {@link CacheLoader} for the given keys.\n     * <p>\n     * If an entry for a key already exists in the Cache, a value will be loaded\n     * if and only if <code>replaceExistingValues</code> is true.   If no loader\n     * is configured for the cache, no objects will be loaded.  If a problem is\n     * encountered during the retrieving or loading of the objects,\n     * an exception is provided to the {@link CompletionListener}.  Once the\n     * operation has completed, the specified CompletionListener is notified.\n     * <p>\n     * Implementations may choose to load multiple keys from the provided\n     * {@link Set} in parallel.  Iteration however must not occur in parallel,\n     * thus allow for non-thread-safe {@link Set}s to be used.\n     * <p>\n     * The thread on which the completion listener is called is implementation\n     * dependent. An implementation may also choose to serialize calls to\n     * different CompletionListeners rather than use a thread per\n     * CompletionListener.\n     *\n     * @param keys                  the keys to load\n     * @param replaceExistingValues when true existing values in the Cache will\n     *                              be replaced by those loaded from a CacheLoader\n     * @param completionListener    the CompletionListener (may be null)\n     * @throws NullPointerException  if keys is null or if keys contains a null.\n     * @throws IllegalStateException if the cache is {@link #isClosed()}\n     * @throws CacheException        thrown if there is a problem performing the\n     *                               load. This may also be thrown on calling if\n     *                               there are insufficient threads available to\n     *                               perform the load.\n     * @throws ClassCastException    if the implementation is configured to perform\n     *                               runtime-type-checking, and the key or value\n     *                               types are incompatible with those that have been\n     *                               configured for the {@link Cache}\n     */\n    void loadAll(Set<? extends K> keys, boolean replaceExistingValues,\n                 CompletionListener completionListener);\n\n    /**\n     * Associates the specified value with the specified key in the cache.\n     * <p>\n     * If the {@link Cache} previously contained a mapping for the key, the old\n     * value is replaced by the specified value.  (A cache <tt>c</tt> is said to\n     * contain a mapping for a key <tt>k</tt> if and only if {@link\n     * #containsKey(Object) c.containsKey(k)} would return <tt>true</tt>.)\n     * <p>\n     * If the cache is configured write-through the\n     * {@link CacheWriter#write(Cache.Entry)} method will be called.\n     * </p>\n     *\n     * @param key   key with which the specified value is to be associated\n     * @param value value to be associated with the specified key\n     * @throws NullPointerException  if key is null or if value is null\n     * @throws IllegalStateException if the cache is {@link #isClosed()}\n     * @throws CacheException        if there is a problem doing the put\n     * @throws ClassCastException    if the implementation is configured to perform\n     *                               runtime-type-checking, and the key or value\n     *                               types are incompatible with those that have been\n     *                               configured for the {@link Cache}\n     * @see java.util.Map#put(Object, Object)\n     * @see #getAndPut(Object, Object)\n     * @see #getAndReplace(Object, Object)\n     * @see CacheWriter#write\n     */\n    void put(K key, V value);\n\n    /**\n     * Associates the specified value with the specified key in this cache,\n     * returning an existing value if one existed.\n     * <p>\n     * If the cache previously contained a mapping for\n     * the key, the old value is replaced by the specified value.  (A cache\n     * <tt>c</tt> is said to contain a mapping for a key <tt>k</tt> if and only\n     * if {@link #containsKey(Object) c.containsKey(k)} would return\n     * <tt>true</tt>.)\n     * <p>\n     * The previous value is returned, or null if there was no value associated\n     * with the key previously.</p>\n     * <p>\n     * If the cache is configured write-through the associated\n     * {@link CacheWriter#write(Cache.Entry)} method will be called.\n     * </p>\n     *\n     * @param key   key with which the specified value is to be associated\n     * @param value value to be associated with the specified key\n     * @return the value associated with the key at the start of the operation or\n     *         null if none was associated\n     * @throws NullPointerException  if key is null or if value is null\n     * @throws IllegalStateException if the cache is {@link #isClosed()}\n     * @throws CacheException        if there is a problem doing the put\n     * @throws ClassCastException    if the implementation is configured to perform\n     *                               runtime-type-checking, and the key or value\n     *                               types are incompatible with those that have been\n     *                               configured for the {@link Cache}\n     * @see #put(Object, Object)\n     * @see #getAndReplace(Object, Object)\n     * @see CacheWriter#write(Cache.Entry)\n     */\n    V getAndPut(K key, V value);\n\n    /**\n     * Copies all of the entries from the specified map to the {@link Cache}.\n     * <p>\n     * The effect of this call is equivalent to that of calling\n     * {@link #put(Object, Object) put(k, v)} on this cache once for each mapping\n     * from key <tt>k</tt> to value <tt>v</tt> in the specified map.\n     * <p>\n     * The order in which the individual puts occur is undefined.\n     * <p>\n     * The behavior of this operation is undefined if entries in the cache\n     * corresponding to entries in the map are modified or removed while this\n     * operation is in progress. or if map is modified while the operation is in\n     * progress.\n     * <p>\n     * In Default Consistency mode, individual puts occur atomically but not\n     * the entire putAll.  Listeners may observe individual updates.\n     * <p>\n     * If the cache is configured write-through the associated\n     * {@link CacheWriter#writeAll} method will be called.\n     * </p>\n     *\n     * @param map mappings to be stored in this cache\n     * @throws NullPointerException  if map is null or if map contains null keys\n     *                               or values.\n     * @throws IllegalStateException if the cache is {@link #isClosed()}\n     * @throws CacheException        if there is a problem doing the put.\n     * @throws ClassCastException    if the implementation is configured to perform\n     *                               runtime-type-checking, and the key or value\n     *                               types are incompatible with those that have been\n     *                               configured for the {@link Cache}\n     * @see CacheWriter#writeAll\n     */\n    void putAll(java.util.Map<? extends K, ? extends V> map);\n\n    /**\n     * Atomically associates the specified key with the given value if it is\n     * not already associated with a value.\n     * <p>\n     * This is equivalent to:\n     * <pre><code>\n     * if (!cache.containsKey(key)) {}\n     *   cache.put(key, value);\n     *   return true;\n     * } else {\n     *   return false;\n     * }\n     * </code></pre>\n     * except that the action is performed atomically.\n     * <p>\n     * If the cache is configured write-through, and this method returns true,\n     * the associated {@link CacheWriter#write(Cache.Entry)} method will be called.\n     * </p>\n     * @param key   key with which the specified value is to be associated\n     * @param value value to be associated with the specified key\n     * @return true if a value was set.\n     * @throws NullPointerException  if key is null or value is null\n     * @throws IllegalStateException if the cache is {@link #isClosed()}\n     * @throws CacheException        if there is a problem doing the put\n     * @throws ClassCastException    if the implementation is configured to perform\n     *                               runtime-type-checking, and the key or value\n     *                               types are incompatible with those that have been\n     *                               configured for the {@link Cache}\n     * @see CacheWriter#write\n     */\n    boolean putIfAbsent(K key, V value);\n\n    /**\n     * Removes the mapping for a key from this cache if it is present.\n     * <p>\n     * More formally, if this cache contains a mapping from key <tt>k</tt> to\n     * value <tt>v</tt> such that\n     * <code>(key==null ?  k==null : key.equals(k))</code>, that mapping is removed.\n     * (The cache can contain at most one such mapping.)\n     *\n     * <p>Returns <tt>true</tt> if this cache previously associated the key,\n     * or <tt>false</tt> if the cache contained no mapping for the key.\n     * <p>\n     * The cache will not contain a mapping for the specified key once the\n     * call returns.\n     * <p>\n     * If the cache is configured write-through the associated\n     * {@link CacheWriter#delete(Object)} method will be called.\n     * </p>\n     * @param key key whose mapping is to be removed from the cache\n     * @return returns false if there was no matching key\n     * @throws NullPointerException  if key is null\n     * @throws IllegalStateException if the cache is {@link #isClosed()}\n     * @throws CacheException        if there is a problem doing the remove\n     * @throws ClassCastException    if the implementation is configured to perform\n     *                               runtime-type-checking, and the key or value\n     *                               types are incompatible with those that have been\n     *                               configured for the {@link Cache}\n     * @see CacheWriter#delete\n     */\n    boolean remove(K key);\n\n    /**\n     * Atomically removes the mapping for a key only if currently mapped to the\n     * given value.\n     * <p>\n     * This is equivalent to:\n     * <pre><code>\n     * if (cache.containsKey(key) &amp;&amp; equals(cache.get(key), oldValue) {\n     *   cache.remove(key);\n     *   return true;\n     * } else {\n     *   return false;\n     * }\n     * </code></pre>\n     * except that the action is performed atomically.\n     * <p>\n     * If the cache is configured write-through, and this method returns true,\n     * the associated {@link CacheWriter#delete(Object)} method will be called.\n     * </p>\n     * @param key      key whose mapping is to be removed from the cache\n     * @param oldValue value expected to be associated with the specified key\n     * @return returns false if there was no matching key\n     * @throws NullPointerException  if key is null\n     * @throws IllegalStateException if the cache is {@link #isClosed()}\n     * @throws CacheException        if there is a problem doing the remove\n     * @throws ClassCastException    if the implementation is configured to perform\n     *                               runtime-type-checking, and the key or value\n     *                               types are incompatible with those that have been\n     *                               configured for the {@link Cache}\n     * @see CacheWriter#delete\n     */\n    boolean remove(K key, V oldValue);\n\n    /**\n     * Atomically removes the entry for a key only if currently mapped to some\n     * value.\n     * <p>\n     * This is equivalent to:\n     * <pre><code>\n     * if (cache.containsKey(key)) {\n     *   V oldValue = cache.get(key);\n     *   cache.remove(key);\n     *   return oldValue;\n     * } else {\n     *   return null;\n     * }\n     * </code></pre>\n     * except that the action is performed atomically.\n     * <p>\n     * If the cache is configured write-through the associated\n     * {@link CacheWriter#delete(Object)} method will be called.\n     * </p>\n     *\n     * @param key key with which the specified value is associated\n     * @return the value if one existed or null if no mapping existed for this key\n     * @throws NullPointerException  if the specified key or value is null.\n     * @throws IllegalStateException if the cache is {@link #isClosed()}\n     * @throws CacheException        if there is a problem during the remove\n     * @throws ClassCastException    if the implementation is configured to perform\n     *                               runtime-type-checking, and the key or value\n     *                               types are incompatible with those that have been\n     *                               configured for the {@link Cache}\n     * @see CacheWriter#delete\n     */\n    V getAndRemove(K key);\n\n    /**\n     * Atomically replaces the entry for a key only if currently mapped to a\n     * given value.\n     * <p>\n     * This is equivalent to:\n     * <pre><code>\n     * if (cache.containsKey(key) &amp;&amp; equals(cache.get(key), oldValue)) {\n     *  cache.put(key, newValue);\n     * return true;\n     * } else {\n     *  return false;\n     * }\n     * </code></pre>\n     * except that the action is performed atomically.\n     * <p>\n     * If the cache is configured write-through, and this method returns true,\n     * the associated {@link CacheWriter#write(Cache.Entry)} method will be called.\n     * </p>\n     * @param key      key with which the specified value is associated\n     * @param oldValue value expected to be associated with the specified key\n     * @param newValue value to be associated with the specified key\n     * @return <tt>true</tt> if the value was replaced\n     * @throws NullPointerException  if key is null or if the values are null\n     * @throws IllegalStateException if the cache is {@link #isClosed()}\n     * @throws CacheException        if there is a problem during the replace\n     * @throws ClassCastException    if the implementation is configured to perform\n     *                               runtime-type-checking, and the key or value\n     *                               types are incompatible with those that have been\n     *                               configured for the {@link Cache}\n     * @see CacheWriter#write\n     */\n    boolean replace(K key, V oldValue, V newValue);\n\n    /**\n     * Atomically replaces the entry for a key only if currently mapped to some\n     * value.\n     * <p>\n     * This is equivalent to\n     * <pre><code>\n     * if (cache.containsKey(key)) {\n     *   cache.put(key, value);\n     *   return true;\n     * } else {\n     *   return false;\n     * }</code></pre>\n     * except that the action is performed atomically.\n     * <p>\n     * If the cache is configured write-through, and this method returns true,\n     * the associated {@link CacheWriter#write(Cache.Entry)} method will be called.\n     * </p>\n     * @param key  the key with which the specified value is associated\n     * @param value the value to be associated with the specified key\n     * @return <tt>true</tt> if the value was replaced\n     * @throws NullPointerException  if key is null or if value is null\n     * @throws IllegalStateException if the cache is {@link #isClosed()}\n     * @throws CacheException        if there is a problem during the replace\n     * @throws ClassCastException    if the implementation is configured to perform\n     *                               runtime-type-checking, and the key or value\n     *                               types are incompatible with those that have been\n     *                               configured for the {@link Cache}\n     * @see #getAndReplace(Object, Object)\n     * @see CacheWriter#write\n     */\n    boolean replace(K key, V value);\n\n    /**\n     * Atomically replaces the value for a given key if and only if there is a\n     * value currently mapped by the key.\n     * <p>\n     * This is equivalent to\n     * <pre><code>\n     * if (cache.containsKey(key)) {\n     *   V oldValue = cache.get(key);\n     *   cache.put(key, value);\n     *   return oldValue;\n     * } else {\n     *   return null;\n     * }\n     * </code></pre>\n     * except that the action is performed atomically.\n     * <p>\n     * If the cache is configured write-through, and this method returns true,\n     * the associated {@link CacheWriter#write(Cache.Entry)} method will be called.\n     * </p>\n     * @param key   key with which the specified value is associated\n     * @param value value to be associated with the specified key\n     * @return the previous value associated with the specified key, or\n     *         <tt>null</tt> if there was no mapping for the key.\n     * @throws NullPointerException  if key is null or if value is null\n     * @throws IllegalStateException if the cache is {@link #isClosed()}\n     * @throws CacheException        if there is a problem during the replace\n     * @throws ClassCastException    if the implementation is configured to perform\n     *                               runtime-type-checking, and the key or value\n     *                               types are incompatible with those that have been\n     *                               configured for the {@link Cache}\n     * @see java.util.concurrent.ConcurrentMap#replace(Object, Object)\n     * @see CacheWriter#write\n     */\n    V getAndReplace(K key, V value);\n\n    /**\n     * Removes entries for the specified keys.\n     * <p>\n     * The order in which the individual entries are removed is undefined.\n     * <p>\n     * For every entry in the key set, the following are called:\n     * <ul>\n     *   <li>any registered {@link CacheEntryRemovedListener}s</li>\n     *   <li>if the cache is a write-through cache, the {@link CacheWriter}</li>\n     * </ul>\n     *\n     * @param keys the keys to remove\n     * @throws NullPointerException  if keys is null or if it contains a null key\n     * @throws IllegalStateException if the cache is {@link #isClosed()}\n     * @throws CacheException        if there is a problem during the remove\n     * @throws ClassCastException    if the implementation is configured to perform\n     *                               runtime-type-checking, and the key or value\n     *                               types are incompatible with those that have been\n     *                               configured for the {@link Cache}\n     * @see CacheWriter#deleteAll\n     */\n    void removeAll(Set<? extends K> keys);\n\n    /**\n     * Removes all of the mappings from this cache.\n     * <p>\n     * The order that the individual entries are removed is undefined.\n     * <p>\n     * For every mapping that exists the following are called:\n     * <ul>\n     *   <li>any registered {@link CacheEntryRemovedListener}s</li>\n     *   <li>if the cache is a write-through cache, the {@link CacheWriter}</li>\n     * </ul>\n     * If the cache is empty, the {@link CacheWriter} is not called.\n     * <p>\n     * This is potentially an expensive operation as listeners are invoked.\n     * Use {@link #clear()} to avoid this.\n     *\n     * @throws IllegalStateException if the cache is {@link #isClosed()}\n     * @throws CacheException        if there is a problem during the remove\n     * @see #clear()\n     * @see CacheWriter#deleteAll\n     */\n    void removeAll();\n\n    /**\n     * Clears the contents of the cache, without notifying listeners or\n     * {@link CacheWriter}s.\n     *\n     * @throws IllegalStateException if the cache is {@link #isClosed()}\n     * @throws CacheException        if there is a problem during the clear\n     */\n    void clear();\n\n    /**\n     * Provides a standard way to access the configuration of a cache using\n     * JCache configuration or additional proprietary configuration.\n     * <p>\n     * The returned value must be immutable.\n     * <p>\n     * If the provider's implementation does not support the specified class,\n     * the {@link IllegalArgumentException} is thrown.\n     *\n     * @param <C> the type of the Configuration\n     * @param clazz the configuration interface or class to return. This includes\n     *              {@link Configuration}.class and\n     *              {@link javax.cache.configuration.CompleteConfiguration}s.\n     * @return the requested implementation of {@link Configuration}\n     * @throws IllegalArgumentException if the caching provider doesn't support\n     *                                  the specified class.\n     */\n    <C extends Configuration<K, V>> C getConfiguration(Class<C> clazz);\n\n    /**\n     * Invokes an {@link EntryProcessor} against the {@link Entry} specified by\n     * the provided key. \n     *\n     * @param <T>            the type of the return value\n     * @param key            the key to the entry\n     * @param entryProcessor the {@link EntryProcessor} to invoke\n     * @param arguments      additional arguments to pass to the\n     *                       {@link EntryProcessor}\n     * @return the result of the processing, if any, defined by the\n     *         {@link EntryProcessor} implementation\n     * @throws NullPointerException    if key or {@link EntryProcessor} is null\n     * @throws IllegalStateException   if the cache is {@link #isClosed()}\n     * @throws ClassCastException    if the implementation is configured to perform\n     *                               runtime-type-checking, and the key or value\n     *                               types are incompatible with those that have been\n     *                               configured for the {@link Cache}\n     * @throws EntryProcessorException if an exception is thrown by the {@link\n     *                                 EntryProcessor}, a Caching Implementation\n     *                                 must wrap any {@link Exception} thrown\n     *                                 wrapped in an {@link EntryProcessorException}.\n     * @see EntryProcessor\n     */\n    <T> T invoke(K key,\n                 EntryProcessor<K, V, T> entryProcessor,\n                 Object... arguments) throws EntryProcessorException;\n\n    /**\n     * Invokes an {@link EntryProcessor} against the set of {@link Entry}s\n     * specified by the set of keys.\n     * <p>\n     * The order that the entries for the keys are processed is undefined.\n     * Implementations may choose to process the entries in any order, including\n     * concurrently.  Furthermore there is no guarantee implementations will\n     * use the same {@link EntryProcessor} instance to process each entry, as\n     * the case may be in a non-local cache topology.\n     * <p>\n     * The result of executing the {@link EntryProcessor} is returned as a\n     * {@link Map} of {@link EntryProcessorResult}s, one result per key.  Should the\n     * {@link EntryProcessor} or Caching implementation throw an exception, the\n     * exception is wrapped and re-thrown when a call to\n     * {@link javax.cache.processor.EntryProcessorResult#get()} is made.\n     *\n     * @param <T>            the type of the return value\n     * @param keys           the set of keys for entries to process\n     * @param entryProcessor the {@link EntryProcessor} to invoke\n     * @param arguments      additional arguments to pass to the\n     *                       {@link EntryProcessor}\n     * @return the map of {@link EntryProcessorResult}s of the processing per key,\n     * if any, defined by the {@link EntryProcessor} implementation.  No mappings\n     * will be returned for {@link EntryProcessor}s that return a\n     * <code>null</code> value for a key.\n     * @throws NullPointerException    if keys or {@link EntryProcessor} are null\n     * @throws IllegalStateException   if the cache is {@link #isClosed()}\n     * @throws ClassCastException    if the implementation is configured to perform\n     *                               runtime-type-checking, and the key or value\n     *                               types are incompatible with those that have been\n     *                               configured for the {@link Cache}\n     * @see EntryProcessor\n     */\n    <T> Map<K, EntryProcessorResult<T>> invokeAll(Set<? extends K> keys,\n                                                  EntryProcessor<K, V, T>\n                                                          entryProcessor,\n                                                  Object... arguments);\n\n    /**\n     * Return the name of the cache.\n     *\n     * @return the name of the cache.\n     */\n    String getName();\n\n    /**\n     * Gets the {@link CacheManager} that owns and manages the {@link Cache}.\n     *\n     * @return the manager or <code>null</code> if the {@link Cache} is not\n     *         managed\n     */\n    CacheManager getCacheManager();\n\n    /**\n     * Closing a {@link Cache} signals to the {@link CacheManager} that produced or\n     * owns the {@link Cache} that it should no longer be managed. At this\n     * point in time the {@link CacheManager}:\n     * <ul>\n     * <li>must close and release all resources being coordinated on behalf of the\n     * Cache by the {@link CacheManager}. This includes calling the <code>close\n     * </code> method on configured {@link CacheLoader},\n     * {@link CacheWriter}, registered {@link CacheEntryListener}s and\n     * {@link ExpiryPolicy} instances that implement the java.io.Closeable\n     * interface.\n     * <li>prevent events being delivered to configured {@link CacheEntryListener}s\n     * registered on the {@link Cache}\n     * </li>\n     * <li>not return the name of the Cache when the CacheManager getCacheNames()\n     * method is called</li>\n     * </ul>\n     * Once closed any attempt to use an operational method on a Cache will throw an\n     * {@link IllegalStateException}.\n     * <p>\n     * Closing a Cache does not necessarily destroy the contents of a Cache.\n     * It simply signals to the owning CacheManager that the Cache is no longer\n     * required by the application and that future uses of a specific Cache instance\n     * should not be permitted.\n     * <p>\n     * Depending on the implementation and Cache topology,\n     * (e.g. a storage-backed or distributed cache), the contents of a closed Cache\n     * may still be available and accessible by other applications, or, in fact, via\n     * the Cache Manager that previously owned the Cache, if an application calls\n     * getCache at some point in the future.\n     *\n     * @throws SecurityException when the operation could not be performed\n     *                           due to the current security settings\n     */\n    void close();\n\n    /**\n     * Determines whether this Cache instance has been closed. A Cache is\n     * considered closed if;\n     * <ol>\n     * <li>the {@link #close()} method has been called</li>\n     * <li>the associated {@link #getCacheManager()} has been closed, or</li>\n     * <li>the Cache has been removed from the associated\n     * {@link #getCacheManager()}</li>\n     * </ol>\n     * <p>\n     * This method generally cannot be called to determine whether a Cache instance\n     * is valid or invalid. A typical client can determine that a Cache is invalid\n     * by catching any exceptions that might be thrown when an operation is\n     * attempted.\n     *\n     * @return true if this Cache instance is closed; false if it is still open\n     */\n    boolean isClosed();\n\n    /**\n     * Provides a standard way to access the underlying concrete caching\n     * implementation to provide access to further, proprietary features.\n     * <p>\n     * If the provider's implementation does not support the specified class,\n     * the {@link IllegalArgumentException} is thrown.\n     *\n     * @param <T> the type of the underlying {@link Cache} implementation\n     * @param clazz the proprietary class or interface of the underlying concrete\n     *              cache. It is this type that is returned.\n     * @return an instance of the underlying concrete cache\n     * @throws IllegalArgumentException if the caching provider doesn't support\n     *                                  the specified class.\n     * @throws SecurityException        when the operation could not be performed\n     *                                  due to the current security settings\n     */\n    <T> T unwrap(java.lang.Class<T> clazz);\n\n    /**\n     * Registers a {@link CacheEntryListener}. The supplied\n     * {@link CacheEntryListenerConfiguration} is used to instantiate a listener\n     * and apply it to those events specified in the configuration.\n     *\n     * @param cacheEntryListenerConfiguration\n     *         a factory and related configuration\n     *         for creating the listener\n     * @throws IllegalArgumentException is the same CacheEntryListenerConfiguration\n     *                                  is used more than once\n     * @throws IllegalStateException    if the cache is {@link #isClosed()}\n     * @see CacheEntryListener\n     */\n    void registerCacheEntryListener(\n            CacheEntryListenerConfiguration<K, V> cacheEntryListenerConfiguration);\n\n    /**\n     * Deregisters a listener, using the\n     * {@link CacheEntryListenerConfiguration} that was used to register it.\n     * <p>\n     * Both listeners registered at configuration time,\n     * and those created at runtime with {@link #registerCacheEntryListener} can\n     * be deregistered.\n     *\n     * @param cacheEntryListenerConfiguration\n     *         the factory and related configuration\n     *         that was used to create the\n     *         listener\n     * @throws IllegalStateException if the cache is {@link #isClosed()}\n     */\n    void deregisterCacheEntryListener(CacheEntryListenerConfiguration<K, V>\n                                              cacheEntryListenerConfiguration);\n\n    /**\n     * {@inheritDoc}\n     * <p>\n     * The ordering of iteration over entries is undefined.\n     * <p>\n     * During iteration, any entries that are removed will have their appropriate\n     * CacheEntryRemovedListeners notified.\n     * <p>\n     * When iterating over a cache it must be assumed that the underlying\n     * cache may be changing, with entries being added, removed, evicted\n     * and expiring. {@link java.util.Iterator#next()} may therefore return\n     * null.\n     *\n     * @throws IllegalStateException if the cache is {@link #isClosed()}\n     */\n    Iterator<Cache.Entry<K, V>> iterator();\n\n    /**\n     * A cache entry (key-value pair).\n     */\n    interface Entry<K, V> {\n\n        /**\n         * Returns the key corresponding to this entry.\n         *\n         * @return the key corresponding to this entry\n         */\n        K getKey();\n\n        /**\n         * Returns the value stored in the cache when this entry was created.\n         *\n         * @return the value corresponding to this entry\n         */\n        V getValue();\n\n        /**\n         * Provides a standard way to access the underlying concrete cache entry\n         * implementation in order to provide access to further, proprietary features.\n         * <p>\n         * If the provider's implementation does not support the specified class,\n         * the {@link IllegalArgumentException} is thrown.\n         *\n         * @param <T> the type of the underlying {@link Entry} implementation\n         * @param clazz the proprietary class or interface of the underlying\n         *              concrete cache. It is this type that is returned.\n         * @return an instance of the underlying concrete cache\n         * @throws IllegalArgumentException if the caching provider doesn't support\n         *                                  the specified class.\n         */\n        <T> T unwrap(Class<T> clazz);\n    }\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/CacheException.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache;\n\n\n/**\n * Thrown to indicate an exception has occurred in the Cache.\n * <p>\n * This is the base class for all cache exceptions.\n *\n * @author Greg Luck\n * @since 1.0\n */\npublic class CacheException extends RuntimeException {\n  private static final long serialVersionUID = 1L;\n\n  /**\n   * Constructs a new CacheException.\n   *\n   * @since 1.0\n   */\n  public CacheException() {\n    super();\n  }\n\n  /**\n   * Constructs a new CacheException with a message string.\n   *\n   * @param message the detail message. The detail message is saved for\n   *                later retrieval by the {@link #getMessage()} method.\n   * @since 1.0\n   */\n  public CacheException(String message) {\n    super(message);\n  }\n\n  /**\n   * Constructs a CacheException with a message string, and\n   * a base exception\n   *\n   * @param message the detail message. The detail message is saved for\n   *                later retrieval by the {@link #getMessage()} method.\n   * @param cause   the cause (that is saved for later retrieval by the\n   *                {@link #getCause()} method).  (A <tt>null</tt> value is\n   *                permitted, and indicates that the cause is nonexistent or\n   *                unknown.)\n   * @since 1.0\n   */\n  public CacheException(String message, Throwable cause) {\n    super(message, cause);\n  }\n\n  /**\n   * Constructs a new CacheException with the specified cause and a\n   * detail message of <tt>(cause==null ? null : cause.toString())</tt>\n   * (that typically contains the class and detail message of\n   * <tt>cause</tt>).  This constructor is useful for runtime exceptions\n   * that are little more than wrappers for other throwables.\n   *\n   * @param cause the cause (that is saved for later retrieval by the\n   *              {@link #getCause()} method).  (A <tt>null</tt> value is\n   *              permitted, and indicates that the cause is nonexistent or\n   *              unknown.)\n   * @since 1.0\n   */\n  public CacheException(Throwable cause) {\n    super(cause);\n  }\n\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/CacheManager.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache;\n\nimport javax.cache.configuration.Configuration;\nimport javax.cache.management.CacheMXBean;\nimport javax.cache.spi.CachingProvider;\nimport java.io.Closeable;\nimport java.lang.management.ManagementFactory;\nimport java.net.URI;\nimport java.util.Properties;\n\n/**\n * A {@link CacheManager} provides a means of establishing, configuring,\n * acquiring, closing and destroying uniquely named {@link Cache}s.\n * <p>\n * {@link Cache}s produced and owned by a {@link CacheManager} typically share\n * common infrastructure, for example, a common {@link ClassLoader} and\n * implementation specific {@link Properties}.\n * <p>\n * Implementations of {@link CacheManager} may additionally provide and share\n * external resources between the {@link Cache}s being managed, for example,\n * the content of the managed {@link Cache}s may be stored in the same cluster.\n * <p>\n * By default {@link CacheManager} instances are typically acquired through the\n * use of a {@link CachingProvider}.  Implementations however may additionally\n * provide other mechanisms to create, acquire, manage and configure\n * {@link CacheManager}s, including:\n * <ul>\n * <li>making use of {@link java.util.ServiceLoader}s,</li>\n * <li>permitting the use of the <code>new</code> operator to create a\n * concrete implementation, </li>\n * <li>providing the construction through the use of one or more\n * builders, and</li>\n * <li>through the use of dependency injection.</li>\n * </ul>\n * <p>\n * The default {@link CacheManager} however can always be acquired using the\n * default configured {@link CachingProvider} obtained by the {@link Caching}\n * class.  For example:\n * <pre><code>\n * CachingProvider provider = Caching.getCachingProvider();\n * CacheManager manager = provider.getCacheManager();\n * </code></pre>\n * <p>\n * Within a Java process {@link CacheManager}s and the {@link Cache}s they\n * manage are scoped and uniquely identified by a {@link URI},  the meaning of\n * which is implementation specific. To obtain the default {@link URI},\n * {@link ClassLoader} and {@link Properties} for an implementation, consult the\n * {@link CachingProvider} class.\n *\n *\n * @author Greg Luck\n * @author Yannis Cosmadopoulos\n * @author Brian Oliver\n * @see Caching\n * @see CachingProvider\n * @see Cache\n * @since 1.0\n *\n */\npublic interface CacheManager extends Closeable {\n\n  /**\n   * Get the {@link CachingProvider} that created and is responsible for\n   * the {@link CacheManager}.\n   *\n   * @return the CachingProvider or <code>null</code> if the {@link CacheManager}\n   *         was created without using a {@link CachingProvider}\n   */\n  CachingProvider getCachingProvider();\n\n  /**\n   * Get the URI of the {@link CacheManager}.\n   *\n   * @return the URI of the {@link CacheManager}\n   */\n  URI getURI();\n\n  /**\n   * Get the {@link ClassLoader} used by the {@link CacheManager}.\n   *\n   * @return  the {@link ClassLoader} used by the {@link CacheManager}\n   */\n  ClassLoader getClassLoader();\n\n  /**\n   * Get the {@link Properties} that were used to create this\n   * {@link CacheManager}.\n   * <p>\n   * Implementations are not required to re-configure the\n   * {@link CacheManager} should modifications to the returned\n   * {@link Properties} be made.\n   *\n   * @return the Properties used to create the {@link CacheManager}\n   */\n  Properties getProperties();\n\n  /**\n   * Creates a named {@link Cache} at runtime.\n   * <p>\n   * If a {@link Cache} with the specified name is known to the {@link\n   * CacheManager}, a CacheException is thrown.\n   * <p>\n   * If a {@link Cache} with the specified name is unknown the {@link\n   * CacheManager}, one is created according to the provided {@link Configuration}\n   * after which it becomes managed by the {@link CacheManager}.\n   * <p>\n   * Prior to a {@link Cache} being created, the provided {@link Configuration}s is\n   * validated within the context of the {@link CacheManager} properties and\n   * implementation.\n   * <p>\n   * Implementers should be aware that the {@link Configuration} may be used to\n   * configure other {@link Cache}s.\n   * <p>\n   * There's no requirement on the part of a developer to call this method for\n   * each {@link Cache} an application may use.  Implementations may support\n   * the use of declarative mechanisms to pre-configure {@link Cache}s, thus\n   * removing the requirement to configure them in an application.  In such\n   * circumstances a developer may simply call either the\n   * {@link #getCache(String)} or {@link #getCache(String, Class, Class)}\n   * methods to acquire a previously established or pre-configured {@link Cache}.\n   *\n   * @param <K> the type of key\n   * @param <V> the type of value\n   * @param <C> the type of the Configuration\n   * @param cacheName     the name of the {@link Cache}. Names should not use\n   *                      forward slashes(/) or colons(:), or start with\n   *                      java. or javax. These prefixes are reserved.\n   * @param configuration a {@link Configuration} for the {@link Cache}\n   * @throws IllegalStateException         if the {@link CacheManager}\n   *                                       {@link #isClosed()}\n   * @throws CacheException                if there was an error configuring the\n   *                                       {@link Cache}, which includes trying\n   *                                       to create a cache that already exists.\n   * @throws IllegalArgumentException      if the configuration is invalid\n   * @throws UnsupportedOperationException if the configuration specifies\n   *                                       an unsupported feature\n   * @throws NullPointerException          if the cache configuration or name\n   *                                       is null\n   * @throws SecurityException             when the operation could not be performed\n   *                                       due to the current security settings\n   */\n  <K, V, C extends Configuration<K, V>> Cache<K, V> createCache(String cacheName,\n                                                                C configuration)\n      throws IllegalArgumentException;\n\n\n  /**\n   * Looks up a managed {@link Cache} given its name.\n   * <p>\n   * Use this method to check runtime key and value types.\n   * <p>\n   * Use {@link #getCache(String)} where this check is not required.\n   * <p>\n   * Implementations must ensure that the key and value types are the same as\n   * those configured for the {@link Cache} prior to returning from this method.\n   * <p>\n   * Implementations may further perform type checking on mutative cache operations\n   * and throw a {@link ClassCastException} if these checks fail.\n   * <p>\n   * Implementations that support declarative mechanisms for pre-configuring\n   * {@link Cache}s may return a pre-configured {@link Cache} instead of\n   * <code>null</code>.\n   *\n   * @param <K> the type of key\n   * @param <V> the type of value\n   * @param cacheName the name of the managed {@link Cache} to acquire\n   * @param keyType   the expected {@link Class} of the key\n   * @param valueType the expected {@link Class} of the value\n   * @return the Cache or null if it does exist or can't be pre-configured\n   * @throws IllegalStateException    if the {@link CacheManager}\n   *                                  is {@link #isClosed()}\n   * @throws ClassCastException       if the specified key and/or value types are\n   *                                  incompatible with the configured cache.\n   * @throws NullPointerException     if either keyType or classType is null.\n   * @throws SecurityException        when the operation could not be performed\n   *                                  due to the current security settings\n   */\n  <K, V> Cache<K, V> getCache(String cacheName, Class<K> keyType,\n                              Class<V> valueType);\n\n  /**\n   * Looks up a managed {@link Cache} given its name.\n   * <p>\n   * This method may only be used to acquire {@link Cache}s that were\n   * configured without runtime key and value types, or were configured\n   * to use Object.class key and value types.\n   * <p>\n   * Use the {@link #getCache(String, Class, Class)} method to acquire\n   * {@link Cache}s with a check that the supplied key and value type parameters\n   * match the runtime types.\n   * <p>\n   * Implementations that support declarative mechanisms for pre-configuring\n   * {@link Cache}s may return a pre-configured {@link Cache} instead of\n   * <code>null</code>.\n   *\n   * @param <K> the type of key\n   * @param <V> the type of value\n   * @param cacheName the name of the cache to look for\n   * @return the Cache or null if it does exist or can't be pre-configured\n   * @throws IllegalStateException    if the CacheManager is {@link #isClosed()}\n   * @throws SecurityException        when the operation could not be performed\n   *                                  due to the current security settings\n   * @see #getCache(String, Class, Class)\n   */\n  <K, V> Cache<K, V> getCache(String cacheName);\n\n  /**\n   * Obtains an {@link Iterable} over the names of {@link Cache}s managed by the\n   * {@link CacheManager}.\n   * <p>\n   * {@link java.util.Iterator}s returned by the {@link Iterable} are immutable.\n   * If the {@link Cache}s managed by the {@link CacheManager} change,\n   * the {@link Iterable} and associated {@link java.util.Iterator}s are not\n   * affected.\n   * <p>\n   * {@link java.util.Iterator}s returned by the {@link Iterable} may not provide\n   * all of the {@link Cache}s managed by the {@link CacheManager}.  For example:\n   * Internally defined or platform specific {@link Cache}s that may be accessible\n   * by a call to {@link #getCache(String)} or {@link #getCache(String, Class,\n   * Class)} may not be present in an iteration.\n   *\n   * @return an {@link Iterable} over the names of managed {@link Cache}s.\n   * @throws IllegalStateException if the {@link CacheManager}\n   *                               is {@link #isClosed()}\n   * @throws SecurityException     when the operation could not be performed\n   *                               due to the current security settings\n   */\n  Iterable<String> getCacheNames();\n\n  /**\n   * Destroys a specifically named and managed {@link Cache}.  Once destroyed\n   * a new {@link Cache} of the same name but with a different {@link\n   * Configuration} may be configured.\n   * <p>\n   * This is equivalent to the following sequence of method calls:\n   * <ol>\n   * <li>{@link Cache#clear()}</li>\n   * <li>{@link Cache#close()}</li>\n   * </ol>\n   * followed by allowing the name of the {@link Cache} to be used for other\n   * {@link Cache} configurations.\n   * <p>\n   * From the time this method is called, the specified {@link Cache} is not\n   * available for operational use. An attempt to call an operational method on\n   * the {@link Cache} will throw an {@link IllegalStateException}.\n   *\n   * @param cacheName the cache to destroy\n   * @throws IllegalStateException if the {@link CacheManager}\n   *                               {@link #isClosed()}\n   * @throws NullPointerException  if cacheName is null\n   * @throws SecurityException     when the operation could not be performed\n   *                               due to the current security settings\n   */\n  void destroyCache(String cacheName);\n\n  /**\n   * Controls whether management is enabled. If enabled the {@link CacheMXBean}\n   * for each cache is registered in the platform MBean server. The platform\n   * MBeanServer is obtained using\n   * {@link ManagementFactory#getPlatformMBeanServer()}.\n   * <p>\n   * Management information includes the name and configuration information for\n   * the cache.\n   * <p>\n   * Each cache's management object must be registered with an ObjectName that\n   * is unique and has the following type and attributes:\n   * <p>\n   * Type:\n   * <code>javax.cache:type=CacheConfiguration</code>\n   * <p>\n   * Required Attributes:\n   * <ul>\n   * <li>CacheManager the URI of the CacheManager\n   * <li>Cache the name of the Cache\n   * </ul>\n   *\n   * @param cacheName the name of the cache to register\n   * @param enabled   true to enable management, false to disable.\n   * @throws IllegalStateException if the {@link CacheManager} or\n   *                               {@link Cache} {@link #isClosed()}\n   * @throws SecurityException     when the operation could not be performed\n   *                               due to the current security settings\n   */\n  void enableManagement(String cacheName, boolean enabled);\n\n  /**\n   * Enables or disables statistics gathering for a managed {@link Cache} at\n   * runtime.\n   * <p>\n   * Each cache's statistics object must be registered with an ObjectName that\n   * is unique and has the following type and attributes:\n   * <p>\n   * Type:\n   * <code>javax.cache:type=CacheStatistics</code>\n   * <p>\n   * Required Attributes:\n   * <ul>\n   * <li>CacheManager the URI of the CacheManager\n   * <li>Cache the name of the Cache\n   * </ul>\n   *\n   * @param cacheName the name of the cache to register\n   * @param enabled   true to enable statistics, false to disable.\n   * @throws IllegalStateException if the {@link CacheManager} or\n   *                               {@link Cache} {@link #isClosed()}\n   * @throws NullPointerException  if cacheName is null\n   * @throws SecurityException when the operation could not be performed\n   *                           due to the current security settings\n   */\n  void enableStatistics(String cacheName, boolean enabled);\n\n  /**\n   * Closes the {@link CacheManager}.\n   * <p>\n   * For each {@link Cache} managed by the {@link CacheManager}, the\n   * {@link Cache#close()} method will be invoked, in no guaranteed order.\n   * <p>\n   * If a {@link Cache#close()} call throws an exception, the exception will be\n   * ignored.\n   * <p>\n   * After executing this method, the {@link #isClosed()} method will return\n   * <code>true</code>.\n   * <p>\n   * All attempts to close a previously closed {@link CacheManager} will be\n   * ignored.\n   *\n   * Closing a CacheManager does not necessarily destroy the contents of the\n   * Caches in the CacheManager.\n   * <p>\n   * It simply signals that the CacheManager is no longer required by the application\n   * and that future uses of a specific CacheManager instance should not be permitted.\n   * <p>\n   * Depending on the implementation and Cache topology,\n   * (e.g. a storage-backed or distributed cache), the contents of closed Caches\n   * previously referenced by the CacheManager, may still be available and accessible\n   * by other applications.\n   *\n   * @throws SecurityException when the operation could not be performed due to the\n   *         current security settings\n   */\n  void close();\n\n  /**\n   * Determines whether the {@link CacheManager} instance has been closed. A\n   * {@link CacheManager} is considered closed if;\n   * <ol>\n   * <li>the {@link #close()} method has been called</li>\n   * <li>the associated {@link #getCachingProvider()} has been closed, or</li>\n   * <li>the {@link CacheManager} has been closed using the associated\n   * {@link #getCachingProvider()}</li>\n   * </ol>\n   * <p>\n   * This method generally cannot be called to determine whether the\n   * {@link CacheManager} is valid or invalid. A typical client can determine\n   * that a {@link CacheManager} is invalid by catching any exceptions that\n   * might be thrown when an operation is attempted.\n   *\n   * @return true if this {@link CacheManager} instance is closed; false if it\n   *         is still open\n   */\n  boolean isClosed();\n\n  /**\n   * Provides a standard mechanism to access the underlying concrete caching\n   * implementation to provide access to further, proprietary features.\n   * <p>\n   * If the provider's implementation does not support the specified class,\n   * the {@link IllegalArgumentException} is thrown.\n   *\n   * @param <T> the type of the underlying {@link CacheManager}\n   * @param clazz the proprietary class or interface of the underlying concrete\n   *              {@link CacheManager}. It is this type that is returned.\n   * @return an instance of the underlying concrete {@link CacheManager}\n   * @throws IllegalArgumentException if the caching provider doesn't support the\n   *                                  specified class.\n   * @throws SecurityException        when the operation could not be performed\n   *                                  due to the current security settings\n   */\n  <T> T unwrap(java.lang.Class<T> clazz);\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/Caching.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache;\n\nimport javax.cache.spi.CachingProvider;\nimport java.security.AccessController;\nimport java.security.PrivilegedAction;\nimport java.util.Iterator;\nimport java.util.LinkedHashMap;\nimport java.util.ServiceLoader;\nimport java.util.WeakHashMap;\n\n/**\n * The {@link Caching} class provides a convenient means for an application to\n * acquire an appropriate {@link CachingProvider} implementation.\n * <p>\n * While defined as part of the specification, its use is not required.\n * Applications and/or containers may instead choose to directly instantiate a\n * {@link CachingProvider} implementation based on implementation specific\n * instructions.\n * <p>\n * When using the {@link Caching} class, {@link CachingProvider} implementations\n * are automatically discovered when they follow the conventions outlined by the\n * Java Development Kit {@link ServiceLoader} class.\n * <p>\n * Although automatically discovered, applications that choose to use this class\n * should not make assumptions regarding the order in which implementations are\n * returned by the {@link #getCachingProviders()} or\n * {@link #getCachingProviders(ClassLoader)} methods.\n * <p>\n * For a {@link CachingProvider} to be automatically discoverable by the\n * {@link Caching} class, the fully qualified class name of the\n * {@link CachingProvider} implementation must be declared in the following\n * file:\n * <pre>\n *   META-INF/services/javax.cache.spi.CachingProvider\n * </pre>\n * This file must be resolvable via the class path.\n * <p>\n * For example, in the reference implementation the contents of this file are:\n * <code>org.jsr107.ri.RICachingProvider</code>\n * <p>\n * Alternatively when the fully qualified class name of a\n * {@link CachingProvider} implementation is specified using the system property\n * <code>javax.cache.spi.cachingprovider</code>, that implementation will be used\n * as the default {@link CachingProvider}.\n * <p>\n * All {@link CachingProvider}s that are automatically detected or explicitly\n * declared and loaded by the {@link Caching} class are maintained in an\n * internal registry.  Consequently when a previously loaded\n * {@link CachingProvider} is requested, it will be simply returned from the\n * internal registry, without reloading and/or instantiating the said\n * implementation again.\n * <p>\n * As required by some applications and containers, multiple co-existing\n * {@link CachingProvider}s implementations, from the same or different\n * implementors are permitted at runtime.\n * <p>\n * To iterate through those that are currently registered a developer may use\n * the following methods:\n * <ol>\n * <li>{@link #getCachingProviders()}</li>\n * <li>{@link #getCachingProviders(ClassLoader)}</li>\n * </ol>\n * To request a specific {@link CachingProvider} implementation, a developer\n * should use either the {@link #getCachingProvider(String)} or\n * {@link #getCachingProvider(String, ClassLoader)} method.\n * <p>\n * Where multiple {@link CachingProvider}s are present, the\n * {@link CachingProvider} returned by getters {@link #getCachingProvider()} and\n * {@link #getCachingProvider(ClassLoader)} is undefined and as a result a\n * {@link CacheException} will be thrown when attempted.\n *\n * @author Brian Oliver\n * @author Greg Luck\n * @author Yannis Cosmadopoulos\n * @since 1.0\n * @see ServiceLoader\n * @see CachingProvider\n */\npublic final class Caching {\n\n  /**\n   * The <code>javax.cache.spi.cachingprovider</code> constant.\n   */\n  public static final String JAVAX_CACHE_CACHING_PROVIDER = \"javax.cache\" +\n      \".spi.CachingProvider\";\n\n  /**\n   * The {@link CachingProviderRegistry} that tracks the {@link CachingProvider}s.\n   */\n  private static final CachingProviderRegistry CACHING_PROVIDERS =\n      new CachingProviderRegistry();\n\n  /**\n   * No public constructor as all methods are static.\n   */\n  private Caching() {\n  }\n\n  /**\n   * Obtains the {@link ClassLoader} to use for API methods that don't\n   * explicitly require a {@link ClassLoader} but internally require one.\n   * <p>\n   * By default this is the {@link Thread#getContextClassLoader()}.\n   *\n   * @return the default {@link ClassLoader}\n   */\n  public static ClassLoader getDefaultClassLoader() {\n    return CACHING_PROVIDERS.getDefaultClassLoader();\n  }\n\n  /**\n   * Set the {@link ClassLoader} to use for API methods that don't explicitly\n   * require a {@link ClassLoader}, but internally use one.\n   *\n   * @param classLoader the {@link ClassLoader} or <code>null</code> if the\n   *                    calling {@link Thread#getContextClassLoader()} should\n   *                    be used\n   */\n  public static void setDefaultClassLoader(ClassLoader classLoader) {\n    CACHING_PROVIDERS.setDefaultClassLoader(classLoader);\n  }\n\n  /**\n   * Obtains the default {@link CachingProvider} available via the\n   * {@link #getDefaultClassLoader()}.\n   *\n   * @return the {@link CachingProvider}\n   * @throws CacheException    should zero, or more than one\n   *                           {@link CachingProvider} be available on the\n   *                           classpath, or it could not be loaded\n   * @throws SecurityException when the operation could not be performed\n   *                           due to the current security settings\n   */\n  public static CachingProvider getCachingProvider() {\n    return CACHING_PROVIDERS.getCachingProvider();\n  }\n\n  /**\n   * Obtains the single {@link CachingProvider} visible to the specified\n   * {@link ClassLoader}.\n   *\n   * @param classLoader the {@link ClassLoader} to use for loading the\n   *                    {@link CachingProvider}\n   * @return the {@link CachingProvider}\n   * @throws CacheException    should zero, or more than one\n   *                           {@link CachingProvider} be available on the\n   *                           classpath, or it could not be loaded\n   * @throws SecurityException when the operation could not be performed\n   *                           due to the current security settings\n   * @see #getCachingProviders(ClassLoader)\n   */\n  public static CachingProvider getCachingProvider(ClassLoader classLoader) {\n    return CACHING_PROVIDERS.getCachingProvider(classLoader);\n  }\n\n  /**\n   * Obtains the {@link CachingProvider}s that are available via the\n   * {@link #getDefaultClassLoader()}.\n   * <p>\n   * If a <code>javax.cache.spi.cachingprovider</code> system property is defined,\n   * only that {@link CachingProvider} specified by that property is returned.\n   * Otherwise all {@link CachingProvider}s that are available via a\n   * {@link ServiceLoader} for {@link CachingProvider}s using the default\n   * {@link ClassLoader} (including those previously requested via\n   * {@link #getCachingProvider(String)}) are returned.\n   *\n   * @return an {@link Iterable} of {@link CachingProvider}s loaded by the\n   *         specified {@link ClassLoader}\n   */\n  public static Iterable<CachingProvider> getCachingProviders() {\n    return CACHING_PROVIDERS.getCachingProviders();\n  }\n\n  /**\n   * Obtains the {@link CachingProvider}s that are available via the specified\n   * {@link ClassLoader}.\n   * <p>\n   * If a <code>javax.cache.spi.cachingprovider</code> system property is defined,\n   * only that {@link CachingProvider} specified by that property is returned.\n   * Otherwise all {@link CachingProvider}s that are available via a\n   * {@link ServiceLoader} for {@link CachingProvider}s using the specified\n   * {@link ClassLoader} (including those previously requested via\n   * {@link #getCachingProvider(String, ClassLoader)}) are returned.\n   *\n   * @param classLoader the {@link ClassLoader} of the returned\n   *                    {@link CachingProvider}s\n   * @return an {@link Iterable} of {@link CachingProvider}s loaded by the\n   *         specified {@link ClassLoader}\n   */\n  public static Iterable<CachingProvider> getCachingProviders(\n      ClassLoader classLoader) {\n    return CACHING_PROVIDERS.getCachingProviders(classLoader);\n  }\n\n  /**\n   * Obtain the {@link CachingProvider} that is implemented by the specified\n   * fully qualified class name using the {@link #getDefaultClassLoader()}.\n   * Should this {@link CachingProvider} already be loaded it is simply returned,\n   * otherwise an attempt will be made to load and instantiate the specified\n   * class (using a no-args constructor).\n   *\n   * @param fullyQualifiedClassName the fully qualified class name of the\n   *                                {@link CachingProvider}\n   * @return the {@link CachingProvider}\n   * @throws CacheException    if the {@link CachingProvider} cannot be created\n   * @throws SecurityException when the operation could not be performed\n   *                           due to the current security settings\n   */\n  public static CachingProvider getCachingProvider(String fullyQualifiedClassName) {\n    return CACHING_PROVIDERS.getCachingProvider(fullyQualifiedClassName);\n  }\n\n  /**\n   * Obtain the {@link CachingProvider} that is implemented by the specified\n   * fully qualified class name using the provided {@link ClassLoader}.\n   * Should this {@link CachingProvider} already be loaded it is returned,\n   * otherwise an attempt will be made to load and instantiate the specified\n   * class (using a no-args constructor).\n   *\n   * @param fullyQualifiedClassName the fully qualified class name of the\n   *                                {@link CachingProvider}\n   * @param classLoader             the {@link ClassLoader} to load the\n   *                                {@link CachingProvider}\n   * @return the {@link CachingProvider}\n   * @throws CacheException    if the {@link CachingProvider} cannot be created\n   * @throws SecurityException when the operation could not be performed\n   *                           due to the current security settings\n   */\n  public static CachingProvider getCachingProvider(String fullyQualifiedClassName,\n                                                   ClassLoader classLoader) {\n    return CACHING_PROVIDERS.getCachingProvider(fullyQualifiedClassName,\n        classLoader);\n  }\n\n\n  /**\n   * A convenience that method that looks up a managed {@link Cache} given its\n   * name. using the default <code>CachingProvider</code> and <code>CacheManager\n   * </code>. For the full range of <code>Cache</code> look up methods see\n   * {@link CacheManager}.\n   * <p>\n   * This method must be used for {@link Cache}s that were configured with\n   * runtime key and value types. Use {@link CacheManager#getCache(String)} for\n   * {@link Cache}s where these were not specified.\n   * <p>\n   * Implementations must ensure that the key and value types are the same as\n   * those configured for the {@link Cache} prior to returning from this method.\n   * <p>\n   * Implementations may further perform type checking on mutative cache operations\n   * and throw a {@link ClassCastException} if these checks fail.\n   * <p>\n   * Implementations that support declarative mechanisms for pre-configuring\n   * {@link Cache}s may return a pre-configured {@link Cache} instead of\n   * <code>null</code>.\n   * @param <K> the type of key\n   * @param <V> the type of value\n   * @param cacheName the name of the managed {@link Cache} to acquire\n   * @param keyType   the expected {@link Class} of the key\n   * @param valueType the expected {@link Class} of the value\n   * @return the Cache or null if it does exist or can't be pre-configured\n   * @throws IllegalStateException    if the CacheManager is\n   *                                  {@link CacheManager#isClosed()}\n   * @throws IllegalArgumentException if the specified key and/or value types are\n   *                                  incompatible with the configured cache.\n   * @throws SecurityException        when the operation could not be performed\n   *                                  due to the current security settings\n   * @see CacheManager#getCache(String, Class, Class)\n   * @see CacheManager#getCache(String)\n   */\n  public static <K, V> Cache<K, V> getCache(String cacheName, Class<K> keyType,\n                              Class<V> valueType) {\n\n    return getCachingProvider().getCacheManager().getCache(cacheName, keyType,\n        valueType);\n  }\n\n  /**\n   * Maintains a registry of loaded {@link CachingProvider}s scoped by\n   * {@link ClassLoader}.\n   */\n  private static class CachingProviderRegistry {\n\n    /**\n     * The {@link CachingProvider}s by Class Name organized by the\n     * {@link ClassLoader} was used to load them.\n     */\n    private WeakHashMap<ClassLoader, LinkedHashMap<String, CachingProvider>>\n        cachingProviders;\n\n    /**\n     * The default {@link ClassLoader}.  When <code>null</code> the\n     * {@link Thread#getContextClassLoader()} will be used.\n     */\n    private volatile ClassLoader classLoader;\n\n    /**\n     * Constructs a CachingProviderManager.\n     */\n    public CachingProviderRegistry() {\n      this.cachingProviders = new WeakHashMap<ClassLoader, LinkedHashMap<String,\n          CachingProvider>>();\n      this.classLoader = null;\n    }\n\n    /**\n     * Obtains the {@link ClassLoader} to use for API methods that don't\n     * explicitly require a {@link ClassLoader} but internally require one.\n     * <p>\n     * By default this is the {@link Thread#getContextClassLoader()}.\n     * </p>\n     * @return the default {@link ClassLoader}\n     */\n    public ClassLoader getDefaultClassLoader() {\n      ClassLoader loader = classLoader;\n      return loader == null ? Thread.currentThread().getContextClassLoader() : loader;\n    }\n\n    /**\n     * Set the {@link ClassLoader} to use for API methods that don't explicitly\n     * require a {@link ClassLoader}, but internally use one.\n     *\n     * @param classLoader the {@link ClassLoader} or <code>null</code> if the\n     *                    calling {@link Thread#getContextClassLoader()} should\n     *                    be used\n     */\n    public void setDefaultClassLoader(ClassLoader classLoader) {\n      this.classLoader = classLoader;\n    }\n\n    /**\n     * Obtains the only {@link CachingProvider} defined by the\n     * {@link #getDefaultClassLoader()}.\n     * <p>\n     * Should zero or more than one {@link CachingProvider}s be available, a\n     * CacheException is thrown.\n     * </p>\n     * @return the {@link CachingProvider}\n     * @throws CacheException should zero or more than one\n     *                        {@link CachingProvider} be available\n     *                        or a {@link CachingProvider} could not be loaded\n     * @see #getCachingProvider(ClassLoader)\n     * @see #getCachingProviders(ClassLoader)\n     */\n    public CachingProvider getCachingProvider() {\n      return getCachingProvider(getDefaultClassLoader());\n    }\n\n    /**\n     * Obtains the only {@link CachingProvider} defined by the specified\n     * {@link ClassLoader}.\n     * <p>\n     * Should zero or more than one {@link CachingProvider}s be available, a\n     * CacheException is thrown.\n     * </p>\n     * @param classLoader the {@link ClassLoader} to use for loading the\n     *                    {@link CachingProvider}\n     * @return the {@link CachingProvider}\n     * @throws CacheException should zero or more than one\n     *                        {@link CachingProvider} be available\n     *                        or a {@link CachingProvider} could not be loaded\n     * @see #getCachingProviders(ClassLoader)\n     */\n    public CachingProvider getCachingProvider(ClassLoader classLoader) {\n      Iterator<CachingProvider> iterator = getCachingProviders(classLoader).iterator();\n\n      if (iterator.hasNext()) {\n        CachingProvider provider = iterator.next();\n\n        if (iterator.hasNext()) {\n          throw new CacheException(\"Multiple CachingProviders have been configured when only a single CachingProvider is expected\");\n        } else {\n          return provider;\n        }\n      } else {\n        throw new CacheException(\"No CachingProviders have been configured\");\n      }\n    }\n\n    /**\n     * Obtain the {@link CachingProvider}s that are available via the\n     * {@link #getDefaultClassLoader()}.\n     * <p>\n     * If a <code>javax.cache.spi.cachingprovider</code> system property is defined,\n     * only that {@link CachingProvider} specified by that property is returned.\n     * Otherwise all {@link CachingProvider}s that are available via a\n     * {@link ServiceLoader} for {@link CachingProvider}s using the default\n     * {@link ClassLoader} (and those explicitly requested via\n     * {@link #getCachingProvider(String)}) are returned.\n     * </p>\n     * @return an {@link Iterable} of {@link CachingProvider}s loaded by the\n     *         default {@link ClassLoader}\n     */\n    public Iterable<CachingProvider> getCachingProviders() {\n      return getCachingProviders(getDefaultClassLoader());\n    }\n\n    /**\n     * Obtain the {@link CachingProvider}s that are available via the specified\n     * {@link ClassLoader}.\n     * <p>\n     * If a <code>javax.cache.spi.cachingprovider</code> system property is defined,\n     * only that {@link CachingProvider} specified by that property is returned.\n     * Otherwise all {@link CachingProvider}s that are available via a\n     * {@link ServiceLoader} for {@link CachingProvider}s using the specified\n     * {@link ClassLoader} (and those explicitly requested via\n     * {@link #getCachingProvider(String, ClassLoader)}) are returned.\n     * </p>\n     * @param classLoader the {@link ClassLoader} of the returned\n     *                    {@link CachingProvider}s\n     * @return an {@link Iterable} of {@link CachingProvider}s loaded by the\n     *         specified {@link ClassLoader}\n     */\n    public synchronized Iterable<CachingProvider> getCachingProviders(ClassLoader classLoader) {\n\n      final ClassLoader serviceClassLoader = classLoader == null ? getDefaultClassLoader() : classLoader;\n      LinkedHashMap<String, CachingProvider> providers = cachingProviders.get(serviceClassLoader);\n\n      if (providers == null) {\n\n        String className = System.getProperty(JAVAX_CACHE_CACHING_PROVIDER);\n        if (className != null) {\n          providers = new LinkedHashMap<String, CachingProvider>();\n          providers.put(className, loadCachingProvider(className, serviceClassLoader));\n\n        } else {\n          providers = AccessController.doPrivileged(new PrivilegedAction<LinkedHashMap<String, CachingProvider>>() {\n            @Override\n            public LinkedHashMap<String, CachingProvider> run() {\n              LinkedHashMap<String, CachingProvider> result = new LinkedHashMap<String, CachingProvider>();\n\n              ServiceLoader<CachingProvider> serviceLoader = ServiceLoader.load(CachingProvider.class, serviceClassLoader);\n              for (CachingProvider provider : serviceLoader) {\n                result.put(provider.getClass().getName(), provider);\n              }\n              return result;\n            }\n          });\n\n        }\n\n        cachingProviders.put(serviceClassLoader, providers);\n      }\n\n      return providers.values();\n    }\n\n    /**\n     * Obtain the {@link CachingProvider} that is implemented by the specified\n     * fully qualified class name using the {@link #getDefaultClassLoader()}.\n     * Should this {@link CachingProvider} already be loaded it is simply\n     * returned, otherwise an attempt will be made to load and instantiate the\n     * specified class name (using a no-args constructor).\n     *\n     * @param fullyQualifiedClassName the fully qualified class name of the\n     *                                {@link CachingProvider}\n     * @return the {@link CachingProvider}\n     * @throws CacheException when the {@link CachingProvider} can't be created\n     */\n    public CachingProvider getCachingProvider(String fullyQualifiedClassName) {\n      return getCachingProvider(fullyQualifiedClassName, getDefaultClassLoader());\n    }\n\n    /**\n     * Load and instantiate the {@link CachingProvider} with the specified\n     * fully qualified class name using the provided {@link ClassLoader}\n     *\n     * @param fullyQualifiedClassName the name of the {@link CachingProvider}\n     *                                class\n     * @param classLoader             the {@link ClassLoader} to use\n     * @return a new {@link CachingProvider} instance\n     * @throws CacheException if the specified {@link CachingProvider} could not be\n     *                        loaded\n     *                        or the specified class is not a {@link\n     *                        CachingProvider}\n     */\n    protected CachingProvider loadCachingProvider(String fullyQualifiedClassName, ClassLoader classLoader) throws CacheException {\n      synchronized (classLoader) {\n        try {\n          Class<?> clazz = classLoader.loadClass(fullyQualifiedClassName);\n          if (CachingProvider.class.isAssignableFrom(clazz)) {\n            return ((Class<CachingProvider>) clazz).newInstance();\n          } else {\n            throw new CacheException(\"The specified class [\" + fullyQualifiedClassName + \"] is not a CachingProvider\");\n          }\n        } catch (Exception e) {\n          throw new CacheException(\"Failed to load the CachingProvider [\" + fullyQualifiedClassName + \"]\", e);\n        }\n      }\n    }\n\n    /**\n     * Obtain the {@link CachingProvider} that is implemented by the specified\n     * fully qualified class name using the provided {@link ClassLoader}.\n     * Should this {@link CachingProvider} already be loaded it is returned,\n     * otherwise an attempt will be made to load and instantiate the specified\n     * class (using a no-args constructor).\n     *\n     * @param fullyQualifiedClassName the fully qualified class name of the\n     *                                {@link CachingProvider}\n     * @param classLoader             the {@link ClassLoader} to load the\n     *                                {@link CachingProvider}\n     * @return the {@link CachingProvider}\n     * @throws CacheException when the {@link CachingProvider} can't be created\n     */\n    public synchronized CachingProvider getCachingProvider(String fullyQualifiedClassName, ClassLoader classLoader) {\n      ClassLoader serviceClassLoader = classLoader == null ? getDefaultClassLoader() : classLoader;\n\n      LinkedHashMap<String, CachingProvider> providers = cachingProviders.get(serviceClassLoader);\n\n      if (providers == null) {\n        // first load the CachingProviders for the {@link ClassLoader}\n        // this may automatically load the CachingProvider we desire\n        getCachingProviders(serviceClassLoader);\n        providers = cachingProviders.get(serviceClassLoader);\n      }\n\n      CachingProvider provider = providers.get(fullyQualifiedClassName);\n\n      if (provider == null) {\n        provider = loadCachingProvider(fullyQualifiedClassName, serviceClassLoader);\n        providers.put(fullyQualifiedClassName, provider);\n      }\n\n      return provider;\n    }\n  }\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/annotation/CacheDefaults.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache.annotation;\n\nimport javax.cache.CacheManager;\nimport javax.enterprise.util.Nonbinding;\nimport java.lang.annotation.ElementType;\nimport java.lang.annotation.Retention;\nimport java.lang.annotation.RetentionPolicy;\nimport java.lang.annotation.Target;\nimport java.util.Arrays;\n\n\n/**\n * Allows the configuration of defaults for {@link CacheResult}, {@link CachePut},\n * {@link CacheRemove}, and {@link CacheRemoveAll} at the class level. Without\n * the method level annotations this annotation has no effect.\n * <p>\n * Following is an example of specifying a default cache name that is used by\n * the annotations on the getDomain and deleteDomain methods. The annotation for\n * getAllDomains would use the \"allDomains\" cache name specified in the method\n * level annotation.\n * <pre><code>\n * package my.app;\n * \n * &#64;CacheDefaults(cacheName=\"domainCache\")\n * public class DomainDao {\n *   &#64;CacheResult\n *   public Domain getDomain(String domainId, int index) {\n *     ...\n *   }\n * \n *   &#64;CacheRemove\n *   public void deleteDomain(String domainId, int index) {\n *     ...\n *   }\n * \n *   &#64;CacheResult(cacheName=\"allDomains\")\n *   public List&lt;Domain&gt; getAllDomains() {\n *     ...\n *   }\n * }\n * </code></pre>\n *\n * @author Rick Hightower\n * @since 1.0\n */\n@Target({ElementType.TYPE})\n@Retention(RetentionPolicy.RUNTIME)\npublic @interface CacheDefaults {\n\n  /**\n   * The default name of the cache for the annotated class\n   * <p>\n   * If not specified defaults to:\n   * package.name.ClassName.methodName(package.ParameterType,package.ParameterType)\n   * <p>\n   * Applicable for {@link CacheResult}, {@link CachePut}, {@link CacheRemove},\n   * and {@link CacheRemoveAll}\n   */\n  @Nonbinding String cacheName() default \"\";\n\n  /**\n   * The {@link CacheResolverFactory} used to find the {@link CacheResolver} to\n   * use at runtime.\n   * <p>\n   * The default resolver pair will resolve the cache by name from the default\n   * {@link CacheManager}\n   * <p>\n   * Applicable for {@link CacheResult}, {@link CachePut}, {@link CacheRemove},\n   * and {@link CacheRemoveAll}\n   */\n  @Nonbinding Class<? extends CacheResolverFactory> cacheResolverFactory()\n      default CacheResolverFactory.class;\n\n  /**\n   * The {@link CacheKeyGenerator} to use to generate the\n   * {@link GeneratedCacheKey} for interacting with the specified Cache.\n   * <p>\n   * Defaults to a key generator that uses {@link Arrays#deepHashCode(Object[])}\n   * and {@link Arrays#deepEquals(Object[], Object[])} with the array returned by\n   * {@link CacheKeyInvocationContext#getKeyParameters()}\n   * </p>\n   * Applicable for {@link CacheResult}, {@link CachePut}, and {@link CacheRemove}\n   *\n   * @see CacheKey\n   */\n  @Nonbinding Class<? extends CacheKeyGenerator> cacheKeyGenerator()\n      default CacheKeyGenerator.class;\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/annotation/CacheInvocationContext.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache.annotation;\n\nimport java.lang.annotation.Annotation;\n\n/**\n * Runtime information about an intercepted method invocation for a method\n * annotated with {@link CacheResult}, {@link CachePut}, {@link CacheRemove},\n * or {@link CacheRemoveAll}\n * <p>\n * Used with {@link CacheResolver#resolveCache(CacheInvocationContext)} to\n * determine the {@link javax.cache.Cache} to use at runtime for the method\n * invocation.\n *\n * @param <A> The type of annotation this context information is for. One of\n *            {@link CacheResult}, {@link CachePut}, {@link CacheRemove}, or {@link\n *            CacheRemoveAll}.\n * @author Eric Dalquist\n * @see CacheResolver\n */\npublic interface CacheInvocationContext<A extends Annotation>\n    extends CacheMethodDetails<A> {\n\n  /**\n   * @return The object the intercepted method was invoked on.\n   */\n  Object getTarget();\n\n  /**\n   * Returns a clone of the array of all method parameters.\n   *\n   * @return An array of all parameters for the annotated method\n   */\n  CacheInvocationParameter[] getAllParameters();\n\n  /**\n   * Return an object of the specified type to allow access to the\n   * provider-specific API. If the provider's\n   * implementation does not support the specified class, the {@link\n   * IllegalArgumentException} is thrown.\n   *\n   * @param <T> The type of the expected underlying {@link javax.cache.Cache} implementation.\n   * @param cls the class of the object to be returned. This is normally either the\n   *            underlying implementation class or an interface that it implements.\n   * @return an instance of the specified class\n   * @throws IllegalArgumentException if the provider doesn't support the specified\n   *            class.\n   */\n  <T> T unwrap(java.lang.Class<T> cls);\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/annotation/CacheInvocationParameter.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache.annotation;\n\nimport java.lang.annotation.Annotation;\nimport java.util.Set;\n\n/**\n * A parameter to an intercepted method invocation. Contains the parameter value\n * as well static type and annotation information about the parameter.\n *\n * @author Eric Dalquist\n */\npublic interface CacheInvocationParameter {\n\n  /**\n   * The parameter type as declared on the method.\n   */\n  Class<?> getRawType();\n\n  /**\n   * @return The parameter value\n   */\n  Object getValue();\n\n  /**\n   * @return An immutable Set of all Annotations on this method parameter, never\n   * null.\n   */\n  Set<Annotation> getAnnotations();\n\n  /**\n   * The index of the parameter in the original parameter array as returned by\n   * {@link CacheInvocationContext#getAllParameters()}\n   *\n   * @return The index of the parameter in the original parameter array.\n   */\n  int getParameterPosition();\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/annotation/CacheKey.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache.annotation;\n\nimport java.lang.annotation.ElementType;\nimport java.lang.annotation.Retention;\nimport java.lang.annotation.RetentionPolicy;\nimport java.lang.annotation.Target;\n\n\n/**\n * Marks a method argument as part of the cache key.\n * If no arguments are marked all arguments are used. The exception is\n * for a method annotated with {@link CachePut} where the {@link CacheValue}\n * parameter is never included in the key\n *\n * @author Rick Hightower\n * @see CacheResult\n * @see CachePut\n * @see CacheRemove\n * @see CacheKeyInvocationContext#getKeyParameters()\n * @since 1.0\n */\n@Target({ElementType.PARAMETER})\n@Retention(RetentionPolicy.RUNTIME)\npublic @interface CacheKey {\n\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/annotation/CacheKeyGenerator.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache.annotation;\n\nimport java.lang.annotation.Annotation;\n\n/**\n * Generates a {@link GeneratedCacheKey} based on\n * a {@link CacheKeyInvocationContext}.\n * <p>\n * Implementations must be thread-safe.\n *\n * @author Eric Dalquist\n * @since 1.0\n */\npublic interface CacheKeyGenerator {\n\n  /**\n   * Called for each intercepted method invocation to generate a suitable\n   * cache key (as a {@link GeneratedCacheKey}) from the\n   * {@link CacheKeyInvocationContext} data.\n   *\n   * @param cacheKeyInvocationContext Information about the intercepted method invocation\n   * @return A non-null cache key for the invocation.\n   */\n  GeneratedCacheKey generateCacheKey(CacheKeyInvocationContext<? extends Annotation> cacheKeyInvocationContext);\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/annotation/CacheKeyInvocationContext.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache.annotation;\n\nimport java.lang.annotation.Annotation;\n\n/**\n * Runtime information about an intercepted method invocation for a method\n * annotated with {@link CacheResult}, {@link CachePut}, or\n * {@link CacheRemove}.\n * <p>\n * Used with {@link CacheKeyGenerator#generateCacheKey(CacheKeyInvocationContext)}\n * to generate a {@link GeneratedCacheKey} for the invocation.\n *\n * @param <A> The type of annotation this context information is for. One of\n *            {@link CacheResult}, {@link CachePut}, or {@link CacheRemove}.\n * @author Eric Dalquist\n * @see CacheKeyGenerator\n */\npublic interface CacheKeyInvocationContext<A extends Annotation>\n    extends CacheInvocationContext<A> {\n\n  /**\n   * Returns a clone of the array of all method parameters to be used by the\n   * {@link\n   * CacheKeyGenerator} in creating a {@link GeneratedCacheKey}. The returned array\n   * may be the same as or a subset of the array returned by\n   * {@link #getAllParameters()}\n   * <p>\n   * Parameters in this array are selected by the following rules:\n   * <ul>\n   * <li>If no parameters are annotated with {@link CacheKey} or {@link\n   * CacheValue}\n   * then all parameters are included</li>\n   * <li>If a {@link CacheValue} annotation exists and no {@link CacheKey} then\n   * all\n   * parameters except the one annotated with {@link CacheValue} are included</li>\n   * <li>If one or more {@link CacheKey} annotations exist only those parameters\n   * with the {@link CacheKey} annotation are included</li>\n   * </ul>\n   *\n   * @return An array of all parameters to be used in cache key generation\n   */\n  CacheInvocationParameter[] getKeyParameters();\n\n  /**\n   * When a method is annotated with {@link CachePut} this is the parameter\n   * annotated with {@link CacheValue}\n   *\n   * @return The parameter to cache, will never be null for methods annotated with\n   *         {@link CachePut}, will be null for methods not annotated with {@link\n   *         CachePut}\n   */\n  CacheInvocationParameter getValueParameter();\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/annotation/CacheMethodDetails.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache.annotation;\n\nimport java.lang.annotation.Annotation;\nimport java.lang.reflect.Method;\nimport java.util.Set;\n\n/**\n * Static information about a method annotated with one of:\n * {@link CacheResult}, {@link CachePut}, {@link CacheRemove}, or {@link\n * CacheRemoveAll}\n * <p>\n * Used with {@link CacheResolverFactory#getCacheResolver(CacheMethodDetails)} to\n * determine the {@link CacheResolver} to use with the method.\n *\n * @param <A> The type of annotation this context information is for. One of\n *            {@link CacheResult}, {@link CachePut}, {@link CacheRemove}, or\n *            {@link CacheRemoveAll}.\n * @author Eric Dalquist\n * @see CacheResolverFactory\n */\npublic interface CacheMethodDetails<A extends Annotation> {\n  /**\n   * The annotated method\n   *\n   * @return The annotated method\n   */\n  Method getMethod();\n\n  /**\n   * An immutable Set of all Annotations on this method\n   *\n   * @return An immutable Set of all Annotations on this method\n   */\n  Set<Annotation> getAnnotations();\n\n  /**\n   * The caching related annotation on the method.\n   * One of: {@link CacheResult}, {@link CachePut}, {@link CacheRemove}, or\n   * {@link CacheRemoveAll}\n   *\n   * @return The caching related annotation on the method.\n   */\n  A getCacheAnnotation();\n\n  /**\n   * The cache name resolved by the implementation.\n   * <p>\n   * The cache name is determined by first looking at the cacheName attribute of\n   * the method level annotation. If that attribute is not set then the class\n   * level {@link CacheDefaults} annotation is checked. If that annotation does\n   * not exist or does not have its cacheName attribute set then the following\n   * cache name generation rules are followed:\n   * <p>\n   * \"fully qualified class name\".\"method name\"(\"fully qualified parameter class\n   * names\")\n   * <p>\n   * For example:\n   * <pre><code>\n   * package my.app;\n   * \n   * public class DomainDao {\n   *   &#64;CacheResult\n   *   public Domain getDomain(String domainId, int index) {\n   *     ...\n   *   }\n   * }\n   * </code></pre>\n   * <p>\n   * Results in the cache name: \"my.app.DomainDao.getDomain(java.lang.String,int)\"\n   *\n   * @return The fully resolved cache name\n   */\n  String getCacheName();\n}\n\n\n"
  },
  {
    "path": "src/main/java/javax/cache/annotation/CachePut.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache.annotation;\n\nimport javax.cache.Cache;\nimport javax.cache.CacheManager;\nimport javax.enterprise.util.Nonbinding;\nimport java.lang.annotation.ElementType;\nimport java.lang.annotation.Retention;\nimport java.lang.annotation.RetentionPolicy;\nimport java.lang.annotation.Target;\nimport java.util.Arrays;\n\n\n/**\n * When a method annotated with {@link CachePut} is invoked a {@link\n * GeneratedCacheKey} will be generated and {@link Cache#put(Object,\n * Object)} will be invoked on the specified cache storing the value marked with\n * {@link CacheValue}.\n * <p>\n * The default behavior is to call {@link Cache#put(Object, Object)}\n * after the annotated method is invoked, this behavior can be changed by setting\n * {@link #afterInvocation()} to false in which case\n * {@link Cache#put(Object, Object)} will be called before the annotated method is\n * invoked.\n * <p>\n * Example of caching the Domain object with a key generated from the String and\n * int parameters. The {@link CacheValue} annotation is used to designate which\n * parameter should be stored in the \"domainDao\" cache.\n * <pre><code>\n * package my.app;\n * \n * public class DomainDao {\n *   &#64;CachePut(cacheName=\"domainCache\")\n *   public void updateDomain(String domainId, int index, &#64;CacheValue Domain\n * domain) {\n *     ...\n *   }\n * }\n * </code></pre>\n * <p>\n * Exception Handling, only used if {@link #afterInvocation()} is true.\n * <ol>\n * <li>If {@link #cacheFor()} and {@link #noCacheFor()} are both empty then all\n * exceptions prevent the put</li>\n * <li>If {@link #cacheFor()} is specified and {@link #noCacheFor()} is not\n * specified then only exceptions that pass an instanceof check against the\n * cacheFor list result in a put</li>\n * <li>If {@link #noCacheFor()} is specified and {@link #cacheFor()} is not\n * specified then all exceptions that do not pass an instanceof check against the\n * noCacheFor result in a put</li>\n * <li>If {@link #cacheFor()} and {@link #noCacheFor()} are both specified then\n * exceptions that pass an instanceof check against the cacheFor list but do not\n * pass an instanceof check against the noCacheFor list result in a put</li>\n * </ol>\n *\n * @author Eric Dalquist\n * @author Rick Hightower\n * @see CacheValue\n * @see CacheKey\n * @since 1.0\n */\n@Target({ElementType.METHOD, ElementType.TYPE})\n@Retention(RetentionPolicy.RUNTIME)\npublic @interface CachePut {\n\n  /**\n   * The name of the cache.\n   * <p>\n   * If not specified defaults first to {@link CacheDefaults#cacheName()} and if\n   * that is not set it defaults to:\n   * package.name.ClassName.methodName(package.ParameterType,package.ParameterType)\n   */\n  @Nonbinding String cacheName() default \"\";\n\n  /**\n   * When {@link Cache#put(Object, Object)} should be called. If true it is called\n   * after the annotated method invocation completes successfully. If false it is\n   * called before the annotated method is invoked.\n   * <p>\n   * Defaults to true.\n   * <p>\n   * If true and the annotated method throws an exception the rules governing\n   * {@link #cacheFor()} and {@link #noCacheFor()} will be followed.\n   */\n  @Nonbinding boolean afterInvocation() default true;\n\n  /**\n   * The {@link CacheResolverFactory} used to find the {@link CacheResolver} to\n   * use at runtime.\n   * <p>\n   * The default resolver pair will resolve the cache by name from the default\n   * {@link CacheManager}\n   */\n  @Nonbinding Class<? extends CacheResolverFactory> cacheResolverFactory()\n      default CacheResolverFactory.class;\n\n  /**\n   * The {@link CacheKeyGenerator} to use to generate the {@link\n   * GeneratedCacheKey} for interacting with the specified Cache.\n   * <p>\n   * Defaults to a key generator that uses {@link Arrays#deepHashCode(Object[])}\n   * and {@link Arrays#deepEquals(Object[], Object[])} with the array\n   * returned by {@link CacheKeyInvocationContext#getKeyParameters()}\n   *\n   * @see CacheKey\n   */\n  @Nonbinding Class<? extends CacheKeyGenerator> cacheKeyGenerator()\n      default CacheKeyGenerator.class;\n\n  /**\n   * Defines zero (0) or more exception {@link Class classes}, that must be a\n   * subclass of {@link Throwable}, indicating the exception types that <b>must</b>\n   * cause the parameter to be cached. Only used if {@link #afterInvocation()} is\n   * true.\n   */\n  @Nonbinding Class<? extends Throwable>[] cacheFor() default {};\n\n  /**\n   * Defines zero (0) or more exception {@link Class Classes}, which must be a\n   * subclass of {@link Throwable}, indicating which exception types <b>must\n   * not</b> cause the parameter to be cached. Only used if\n   * {@link #afterInvocation()} is true.\n   */\n  @Nonbinding Class<? extends Throwable>[] noCacheFor() default {};\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/annotation/CacheRemove.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache.annotation;\n\nimport javax.cache.Cache;\nimport javax.cache.CacheManager;\nimport javax.enterprise.util.Nonbinding;\nimport java.lang.annotation.ElementType;\nimport java.lang.annotation.Retention;\nimport java.lang.annotation.RetentionPolicy;\nimport java.lang.annotation.Target;\n\n\n/**\n * When a method annotated with {@link CacheRemove} is invoked a {@link\n * GeneratedCacheKey} will be generated and {@link Cache#remove(Object)} will be\n * invoked on the specified cache.\n * <p>\n * The default behavior is to call {@link Cache#remove(Object)} after\n * the annotated method is invoked, this behavior can be changed by setting\n * {@link #afterInvocation()} to false in which case\n * {@link Cache#remove(Object)} will be called before the annotated\n * method is invoked.\n * <p>\n * Example of removing a specific Domain object from the \"domainCache\". A {@link\n * GeneratedCacheKey} will be generated from the String and int parameters and\n * used to call {@link Cache#remove(Object)} after the deleteDomain\n * method completes successfully.\n * <pre><code>\n * package my.app;\n * \n * public class DomainDao {\n *   &#64;CacheRemove(cacheName=\"domainCache\")\n *   public void deleteDomain(String domainId, int index) {\n *     ...\n *   }\n * }\n * </code></pre>\n * <p>\n * Exception Handling, only used if {@link #afterInvocation()} is true.\n * <ol>\n * <li>If {@link #evictFor()} and {@link #noEvictFor()} are both empty then all\n * exceptions prevent the remove</li>\n * <li>If {@link #evictFor()} is specified and {@link #noEvictFor()} is not\n * specified then only exceptions that pass an instanceof check against the\n * evictFor list result in a remove</li>\n * <li>If {@link #noEvictFor()} is specified and {@link #evictFor()} is not\n * specified then all exceptions that do not pass an instanceof check against the\n * noEvictFor result in a remove</li>\n * <li>If {@link #evictFor()} and {@link #noEvictFor()} are both specified then\n * exceptions that pass an instanceof check against the evictFor list but do not\n * pass an instanceof check against the noEvictFor list result in a remove</li>\n * </ol>\n *\n * @author Eric Dalquist\n * @author Rick Hightower\n * @author Greg Luck\n * @see CacheKey\n * @since 1.0\n */\n@Target({ElementType.METHOD, ElementType.TYPE})\n@Retention(RetentionPolicy.RUNTIME)\npublic @interface CacheRemove {\n\n  /**\n   * The name of the cache.\n   * <p>\n   * If not specified defaults first to {@link CacheDefaults#cacheName()},\n   * and if that is not set then to:\n   * package.name.ClassName.methodName(package.ParameterType,package.ParameterType)\n   */\n  @Nonbinding String cacheName() default \"\";\n\n  /**\n   * When {@link Cache#remove(Object)}  should be called. If true it is called\n   * after the annotated method invocation completes successfully. If false it is\n   * called before the annotated method is invoked.\n   * <p>\n   * Defaults to true.\n   * <p>\n   * If true and the annotated method throws an exception the remove will not be\n   * executed.\n   */\n  @Nonbinding boolean afterInvocation() default true;\n\n  /**\n   * The {@link CacheResolverFactory} used to find the {@link CacheResolver} to\n   * use at runtime.\n   * <p>\n   * The default resolver pair will resolve the cache by name from the default\n   * {@link CacheManager}\n   */\n  @Nonbinding Class<? extends CacheResolverFactory> cacheResolverFactory()\n      default CacheResolverFactory.class;\n\n  /**\n   * The {@link CacheKeyGenerator} to use to generate the {@link\n   * GeneratedCacheKey} for interacting with the specified Cache.\n   * <p>\n   * Defaults to a key generator that uses\n   * {@link java.util.Arrays#deepHashCode(Object[])}\n   * and {@link java.util.Arrays#deepEquals(Object[], Object[])} with the array\n   * returned by {@link CacheKeyInvocationContext#getKeyParameters()}\n   *\n   * @see CacheKey\n   */\n  @Nonbinding Class<? extends CacheKeyGenerator> cacheKeyGenerator()\n      default CacheKeyGenerator.class;\n\n  /**\n   * Defines zero (0) or more exception {@link Class classes}, that must be a\n   * subclass of {@link Throwable}, indicating the exception types that must cause\n   * a cache eviction. Only used if {@link #afterInvocation()} is true.\n   */\n  @Nonbinding Class<? extends Throwable>[] evictFor() default {};\n\n  /**\n   * Defines zero (0) or more exception {@link Class Classes}, that must be a\n   * subclass of {@link Throwable}, indicating the exception types that must\n   * <b>not</b> cause a cache eviction. Only used if {@link #afterInvocation()} is\n   * true.\n   */\n  @Nonbinding Class<? extends Throwable>[] noEvictFor() default {};\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/annotation/CacheRemoveAll.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache.annotation;\n\nimport javax.cache.Cache;\nimport javax.cache.CacheManager;\nimport javax.enterprise.util.Nonbinding;\nimport java.lang.annotation.ElementType;\nimport java.lang.annotation.Retention;\nimport java.lang.annotation.RetentionPolicy;\nimport java.lang.annotation.Target;\n\n\n/**\n * When a method annotated with {@link CacheRemoveAll} is invoked all elements in\n * the specified cache will be removed via the\n * {@link Cache#removeAll()} method\n * <p>\n * The default behavior is to call {@link Cache#removeAll()} after the\n * annotated method is invoked, this behavior can be changed by setting {@link\n * #afterInvocation()} to false in which case {@link Cache#removeAll()}\n * will be called before the annotated method is invoked.\n * <p>\n * Example of removing all Domain objects from the \"domainCache\". {@link\n * Cache#removeAll()} will be called after deleteAllDomains() returns\n * successfully.\n * <pre><code>\n * package my.app;\n * \n * public class DomainDao {\n *   &#64;CacheRemoveAll(cacheName=\"domainCache\")\n *   public void deleteAllDomains() {\n *     ...\n *   }\n * }\n * </code></pre>\n * <p>\n * Exception Handling, only used if {@link #afterInvocation()} is true.\n * <ol>\n * <li>If {@link #evictFor()} and {@link #noEvictFor()} are both empty then all\n * exceptions prevent the removeAll</li>\n * <li>If {@link #evictFor()} is specified and {@link #noEvictFor()} is not\n * specified then only exceptions that pass an instanceof check against the\n * evictFor list result in a removeAll</li>\n * <li>If {@link #noEvictFor()} is specified and {@link #evictFor()} is not\n * specified then all exceptions that do not pass an instanceof check against the\n * noEvictFor result in a removeAll</li>\n * <li>If {@link #evictFor()} and {@link #noEvictFor()} are both specified then\n * exceptions that pass an instanceof check against the evictFor list but do not\n * pass an instanceof check against the noEvictFor list result in a removeAll</li>\n * </ol>\n *\n * @author Eric Dalquist\n * @author Rick Hightower\n * @since 1.0\n */\n@Target({ElementType.METHOD, ElementType.TYPE})\n@Retention(RetentionPolicy.RUNTIME)\npublic @interface CacheRemoveAll {\n\n  /**\n   * /**\n   * The name of the cache.\n   * <p>\n   * If not specified defaults first to {@link CacheDefaults#cacheName()} and if\n   * that is not set it defaults to:\n   * package.name.ClassName.methodName(package.ParameterType,package.ParameterType)\n   */\n  @Nonbinding String cacheName() default \"\";\n\n  /**\n   * When {@link Cache#removeAll()} should be called. If true it is called after\n   * the annotated method invocation completes successfully. If false it is called\n   * before the annotated method is invoked.\n   * <p>\n   * Defaults to true.\n   * <p>\n   * If true and the annotated method throws an exception the removeAll will not be\n   * executed.\n   */\n  @Nonbinding boolean afterInvocation() default true;\n\n  /**\n   * The {@link CacheResolverFactory} used to find the {@link CacheResolver} to\n   * use at runtime.\n   * <p>\n   * The default resolver pair will resolve the cache by name from the default\n   * {@link CacheManager}\n   */\n  @Nonbinding Class<? extends CacheResolverFactory> cacheResolverFactory()\n      default CacheResolverFactory.class;\n\n  /**\n   * Defines zero (0) or more exception {@link Class classes}, that must be a\n   * subclass of {@link Throwable}, indicating the exception types that must\n   * cause a cache eviction. Only used if {@link #afterInvocation()} is true.\n   */\n  @Nonbinding Class<? extends Throwable>[] evictFor() default {};\n\n  /**\n   * Defines zero (0) or more exception {@link Class Classes}, that must be a\n   * subclass of {@link Throwable}, indicating the exception types that must\n   * <b>not</b> cause a cache eviction. Only used if {@link #afterInvocation()} is\n   * true.\n   */\n  @Nonbinding Class<? extends Throwable>[] noEvictFor() default {};\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/annotation/CacheResolver.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache.annotation;\n\nimport javax.cache.Cache;\nimport java.lang.annotation.Annotation;\n\n/**\n * Determines the {@link Cache} to use for an intercepted method invocation.\n * <p>\n * Implementations MUST be thread-safe.\n *\n * @author Eric Dalquist\n * @see CacheResolverFactory\n * @since 1.0\n */\npublic interface CacheResolver {\n\n  /**\n   * Resolve the {@link Cache} to use for the {@link CacheInvocationContext}.\n   *\n   * @param <K> the type of key\n   * @param <V> the type of value\n   * @param cacheInvocationContext The context data for the intercepted method\n   *                               invocation\n   * @return The {@link Cache} instance to be used by the interceptor\n   */\n  <K, V> Cache<K, V> resolveCache(CacheInvocationContext<? extends Annotation>\n                                      cacheInvocationContext);\n\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/annotation/CacheResolverFactory.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache.annotation;\n\nimport javax.cache.Cache;\nimport java.lang.annotation.Annotation;\n\n/**\n * Determines the {@link CacheResolver} to use for an annotated method. The\n * {@link CacheResolver} will be retrieved once per annotated method.\n * <p>\n * Implementations MUST be thread-safe.\n *\n * @author Eric Dalquist\n * @since 1.0\n */\npublic interface CacheResolverFactory {\n\n  /**\n   * Get the {@link CacheResolver} used at runtime for resolution of the\n   * {@link Cache} for the {@link CacheResult}, {@link CachePut},\n   * {@link CacheRemove}, or {@link CacheRemoveAll} annotation.\n   *\n   * @param cacheMethodDetails The details of the annotated method to get the\n   *                           {@link CacheResolver} for. @return The {@link\n   *                           CacheResolver} instance to be\n   *                           used by the interceptor.\n   */\n  CacheResolver getCacheResolver(CacheMethodDetails<? extends Annotation>\n                                     cacheMethodDetails);\n\n  /**\n   * Get the {@link CacheResolver} used at runtime for resolution of the {@link\n   * Cache} for the {@link CacheResult} annotation to cache exceptions.\n   * <p>\n   * Will only be called if {@link CacheResult#exceptionCacheName()} is not empty.\n   *\n   * @param cacheMethodDetails The details of the annotated method to get the\n   *                           {@link CacheResolver} for.\n   * @return The {@link CacheResolver} instance to be used by the interceptor.\n   */\n  CacheResolver getExceptionCacheResolver(CacheMethodDetails<CacheResult>\n                                              cacheMethodDetails);\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/annotation/CacheResult.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache.annotation;\n\nimport javax.cache.Cache;\nimport javax.cache.CacheManager;\nimport javax.enterprise.util.Nonbinding;\nimport java.lang.annotation.ElementType;\nimport java.lang.annotation.Retention;\nimport java.lang.annotation.RetentionPolicy;\nimport java.lang.annotation.Target;\n\n\n/**\n * When a method annotated with {@link CacheResult} is invoked a\n * {@link GeneratedCacheKey} will be generated and {@link Cache#get(Object)} is\n * called before the annotated method actually executes. If a value is found in the\n * cache it is returned and the annotated method is never actually executed. If no\n * value is found the annotated method is invoked and the returned value is stored\n * in the cache with the generated key.\n * <p>\n * Exceptions are not cached by default. Caching of exceptions can be enabled by\n * specifying an {@link #exceptionCacheName()}. If an exception cache is specified\n * it is checked before invoking the annotated method and if a cached exception is\n * found it is re-thrown.\n * <p>\n * The {@link #cachedExceptions()} and {@link #nonCachedExceptions()} properties\n * can be used to control the exceptions are cached and those that are not.\n * <p>\n * To always invoke the annotated method and still cache the result set\n * {@link #skipGet()} to true. This will disable the pre-invocation\n * {@link Cache#get(Object)} call. If {@link #exceptionCacheName()} is\n * specified the pre-invocation exception check is also disabled. This feature is\n * useful for methods that create or update objects to be cached.\n * <p>\n * Example of caching the Domain object with a key generated from the\n * <code>String</code> and <code>int</code> parameters.\n * <p>\n * With no {@link #cacheName()} specified a cache name of\n * \"my.app.DomainDao.getDomain(java.lang.String,int)\" will be generated.\n * </p>\n * <pre><code>\n * package my.app;\n * \n * public class DomainDao {\n *   &#64;CacheResult\n *   public Domain getDomain(String domainId, int index) {\n *     ...\n *   }\n * }\n * </code></pre>\n * <p>\n * Example using the {@link GeneratedCacheKey} annotation so that only the domainId\n * parameter is used in key generation:\n * <pre><code>\n * package my.app;\n * \n * public class DomainDao {\n *   &#64;CacheResult\n *   public Domain getDomain(@CacheKey String domainId, Monitor mon) {\n *     ...\n *   }\n * }\n * </code></pre>\n * <p>\n * If exception caching is enabled via specification of\n * {@link #exceptionCacheName()} the following rules are used to determine if a\n * thrown exception is cached:\n * <ol>\n * <li>If {@link #cachedExceptions()} and {@link #nonCachedExceptions()} are both\n * empty then all exceptions are cached</li>\n * <li>If {@link #cachedExceptions()} is specified and\n * {@link #nonCachedExceptions()} is not specified then only exceptions\n * that pass an instanceof check against the cachedExceptions list are cached</li>\n * <li>If {@link #nonCachedExceptions()} is specified and\n * {@link #cachedExceptions()} is not specified then all exceptions\n * that do not pass an instanceof check against the nonCachedExceptions list are\n * cached</li>\n * <li>If {@link #cachedExceptions()} and {@link #nonCachedExceptions()} are both\n * specified then exceptions that pass an instanceof check against the\n * cachedExceptions list but do not pass an instanceof check against the\n * nonCachedExceptions list are cached</li>\n * </ol>\n *\n * @author Eric Dalquist\n * @author Rick Hightower\n * @see CacheKey\n * @since 1.0\n */\n@Target({ElementType.METHOD, ElementType.TYPE})\n@Retention(RetentionPolicy.RUNTIME)\npublic @interface CacheResult {\n\n  /**\n   * <p>\n   * The name of the cache.\n   * </p>\n   * If not specified defaults first to {@link CacheDefaults#cacheName()} and if\n   * that is not set it defaults to:\n   * package.name.ClassName.methodName(package.ParameterType,package.ParameterType)\n   */\n  @Nonbinding String cacheName() default \"\";\n\n  /**\n   * If set to true the pre-invocation {@link Cache#get(Object)} is\n   * skipped and the annotated method is always executed with the returned value\n   * being cached as normal. This is useful for create or update methods that\n   * should always be executed and have their returned value placed in the cache.\n   * <p>\n   * If true and an {@link #exceptionCacheName()} is specified the pre-invocation\n   * check for a thrown exception is also skipped. If an exception is thrown during\n   * invocation it will be cached following the standard exception caching rules.\n   * <p>\n   * Defaults to false.\n   *\n   * @see CachePut\n   */\n  @Nonbinding boolean skipGet() default false;\n\n  /**\n   * The {@link CacheResolverFactory} used to find the {@link CacheResolver} to\n   * use at runtime.\n   * <p>\n   * The default resolver pair will resolve the cache by name from the default\n   * {@link CacheManager}\n   */\n  @Nonbinding Class<? extends CacheResolverFactory> cacheResolverFactory()\n      default CacheResolverFactory.class;\n\n  /**\n   * The {@link CacheKeyGenerator} to use to generate the {@link GeneratedCacheKey}\n   * for interacting with the specified Cache.\n   * <p>\n   * Defaults to a key generator that uses\n   * {@link java.util.Arrays#deepHashCode(Object[])} and\n   * {@link java.util.Arrays#deepEquals(Object[], Object[])} with the array\n   * returned by {@link CacheKeyInvocationContext#getKeyParameters()}\n   *\n   * @see CacheKey\n   */\n  @Nonbinding Class<? extends CacheKeyGenerator> cacheKeyGenerator()\n      default CacheKeyGenerator.class;\n\n  /**\n   * The name of the cache to cache exceptions.\n   * <p>\n   * If not specified no exception caching is done.\n   */\n  @Nonbinding String exceptionCacheName() default \"\";\n\n  /**\n   * Defines zero (0) or more exception {@link Class classes}, that must be a\n   * subclass of {@link Throwable}, indicating the exception types that\n   * <b>must</b> be cached. Only consulted if {@link #exceptionCacheName()} is\n   * specified.\n   */\n  @Nonbinding Class<? extends Throwable>[] cachedExceptions() default {};\n\n  /**\n   * Defines zero (0) or more exception {@link Class Classes}, that must be a\n   * subclass of {@link Throwable}, indicating the exception types that\n   * <b>must not</b> be cached. Only consulted if {@link #exceptionCacheName()}\n   * is specified.\n   */\n  @Nonbinding Class<? extends Throwable>[] nonCachedExceptions() default {};\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/annotation/CacheValue.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache.annotation;\n\nimport java.lang.annotation.ElementType;\nimport java.lang.annotation.Retention;\nimport java.lang.annotation.RetentionPolicy;\nimport java.lang.annotation.Target;\n\n\n/**\n * Marks the parameter to be cached for a method annotated with {@link CachePut}.\n *\n * @author Eric Dalquist\n * @author Rick Hightower\n * @see CachePut\n * @since 1.0\n */\n@Target({ElementType.PARAMETER})\n@Retention(RetentionPolicy.RUNTIME)\npublic @interface CacheValue {\n\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/annotation/GeneratedCacheKey.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache.annotation;\n\nimport java.io.Serializable;\n\n/**\n * A {@link Serializable}, immutable, thread-safe object that is used as a key,\n * automatically generated by a {@link CacheKeyGenerator}.\n * <p>\n * The implementation MUST follow the Java contract for {@link Object#hashCode()}\n * and {@link Object#equals(Object)} to ensure correct behavior.\n * <p>\n * It is recommended that implementations also override {@link Object#toString()}\n * and provide a human-readable string representation of the key.\n *\n * @author Eric Dalquist\n * @see CacheKeyGenerator\n * @since 1.0\n */\npublic interface GeneratedCacheKey extends Serializable {\n\n  /**\n   * The immutable hash code of the cache key.\n   *\n   * @return The hash code of the object\n   * @see Object#hashCode()\n   */\n  @Override\n  int hashCode();\n\n  /**\n   * Compare this {@link GeneratedCacheKey} with another. If the two objects\n   * are equal their {@link #hashCode()} values MUST be equal as well.\n   *\n   * @param object The other object to compare to.\n   * @return true if the objects are equal\n   * @see Object#equals(Object)\n   */\n  @Override\n  boolean equals(Object object);\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/annotation/package-info.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * The annotations in this package provide method interceptors for user supplied\n * classes.\n * <p>\n * In the case of a the {@link javax.cache.annotation.CacheResult} annotation,\n * if the cache can satisfy the request a result is returned by the method from\n * cache, not from method execution. For the mutative annotations such as\n * {@link javax.cache.annotation.CacheResult} the annotation allows the cached\n * value to be mutated so that it will be correct the next time\n * {@link javax.cache.annotation.CacheResult} is used.\n * <p>\n * Any operations against a cache via an annotation will have the same behaviour\n * as if the {@link javax.cache.annotation.CacheResult} methods were used. So\n * if the same underlying cache is used for an annotation and a direct API call,\n * the same data would be returned. Annotations therefore provide an additional\n * API for interacting with caches.\n * <p>\n * To use these annotations you'll need a library or framework that processes\n * these annotations and intercepts calls to your application objects\n * to provide the caching behaviour. This would commonly be provided by a\n * dependency injection framework such as defined by CDI in Java EE.\n *\n *  @author Eric Dalquist\n *  @author Greg Luck\n *  @since 1.0\n */\npackage javax.cache.annotation;\n"
  },
  {
    "path": "src/main/java/javax/cache/configuration/CacheEntryListenerConfiguration.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache.configuration;\n\nimport javax.cache.event.CacheEntryEventFilter;\nimport javax.cache.event.CacheEntryListener;\nimport java.io.Serializable;\n\n/**\n * Defines the configuration requirements for a\n * {@link CacheEntryListener} and a {@link Factory} for its\n * creation.\n *\n * @param <K> the type of keys\n * @param <V> the type of values\n * @author Brian Oliver\n * @author Greg Luck\n * @since 1.0\n */\npublic interface CacheEntryListenerConfiguration<K, V> extends Serializable {\n  /**\n   * Obtains the {@link Factory} for the\n   * {@link CacheEntryListener}.\n   *\n   * @return the {@link Factory} for the\n   *         {@link CacheEntryListener}\n   */\n  Factory<CacheEntryListener<? super K, ? super V>> getCacheEntryListenerFactory();\n\n  /**\n   * Determines if the old value should be provided to the\n   * {@link CacheEntryListener}.\n   *\n   * @return <code>true</code> if the old value is required by the\n   *         {@link CacheEntryListener}\n   */\n  boolean isOldValueRequired();\n\n  /**\n   * Obtains the {@link Factory} for the {@link CacheEntryEventFilter} that should be\n   * applied prior to notifying the {@link CacheEntryListener}.\n   * <p>\n   * When <code>null</code> no filtering is applied and all appropriate events\n   * are notified.\n   *\n   * @return the {@link Factory} for the\n   *         {@link CacheEntryEventFilter} or <code>null</code>\n   *         if no filtering is required\n   */\n  Factory<CacheEntryEventFilter<? super K, ? super V>>\n  getCacheEntryEventFilterFactory();\n\n  /**\n   * Determines if the thread that caused an event to be created should be\n   * blocked (not return from the operation causing the event) until the\n   * {@link CacheEntryListener} has been notified.\n   *\n   * @return <code>true</code> if the thread that created the event should block\n   */\n  boolean isSynchronous();\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/configuration/CompleteConfiguration.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache.configuration;\n\nimport javax.cache.expiry.ExpiryPolicy;\nimport javax.cache.integration.CacheLoader;\nimport javax.cache.integration.CacheWriter;\nimport java.io.Serializable;\n\n/**\n * A read-only representation of the complete JCache {@link javax.cache.Cache}\n * configuration.\n * <p>\n * The properties provided by instances of this interface are used by\n * {@link javax.cache.CacheManager}s to configure {@link javax.cache.Cache}s.\n * <p>\n * Implementations of this interface must override {@link Object#hashCode()} and\n * {@link Object#equals(Object)} as\n * {@link javax.cache.configuration.CompleteConfiguration}s are often compared at\n * runtime.\n *\n * @param <K> the type of keys maintained the cache\n * @param <V> the type of cached values\n * @author Greg Luck\n * @author Yannis Cosmadopoulos\n * @author Brian Oliver\n * @since 1.0\n */\npublic interface CompleteConfiguration<K, V> extends Configuration<K, V>,\n    Serializable {\n\n  /**\n   * Determines if a {@link javax.cache.Cache} should operate in read-through mode.\n   * <p>\n   * When in \"read-through\" mode, cache misses that occur due to cache entries\n   * not existing as a result of performing a \"get\" will appropriately\n   * cause the configured {@link javax.cache.integration.CacheLoader} to be\n   * invoked.\n   * <p>\n   * The default value is <code>false</code>.\n   *\n   * @return <code>true</code> when a {@link javax.cache.Cache} is in\n   * \"read-through\" mode.\n   * @see #getCacheLoaderFactory()\n   */\n  boolean isReadThrough();\n\n  /**\n   * Determines if a {@link javax.cache.Cache} should operate in write-through\n   * mode.\n   * <p>\n   * When in \"write-through\" mode, cache updates that occur as a result of\n   * performing \"put\" operations called via one of\n   * {@link javax.cache.Cache#put(Object, Object)},\n   * {@link javax.cache.Cache#getAndRemove(Object)},\n   * {@link javax.cache.Cache#removeAll()},\n   * {@link javax.cache.Cache#getAndPut(Object, Object)}\n   * {@link javax.cache.Cache#getAndRemove(Object)},\n   * {@link javax.cache.Cache#getAndReplace(Object,\n   * Object)}, {@link javax.cache.Cache#invoke(Object,\n   * javax.cache.processor.EntryProcessor,\n   * Object...)}, {@link javax.cache.Cache#invokeAll(java.util.Set,\n   * javax.cache.processor.EntryProcessor, Object...)} will appropriately cause\n   * the configured {@link javax.cache.integration.CacheWriter} to be invoked.\n   * <p>\n   * The default value is <code>false</code>.\n   *\n   * @return <code>true</code> when a {@link javax.cache.Cache} is in\n   *        \"write-through\" mode.\n   * @see #getCacheWriterFactory()\n   */\n  boolean isWriteThrough();\n\n  /**\n   * Checks whether statistics collection is enabled in this cache.\n   * <p>\n   * The default value is <code>false</code>.\n   *\n   * @return true if statistics collection is enabled\n   */\n  boolean isStatisticsEnabled();\n\n  /**\n   * Checks whether management is enabled on this cache.\n   * <p>\n   * The default value is <code>false</code>.\n   *\n   * @return true if management is enabled\n   */\n  boolean isManagementEnabled();\n\n  /**\n   * Obtains the {@link javax.cache.configuration.CacheEntryListenerConfiguration}s\n   * for {@link javax.cache.event.CacheEntryListener}s to be configured on a\n   * {@link javax.cache.Cache}.\n   *\n   * @return an {@link Iterable} over the\n   * {@link javax.cache.configuration.CacheEntryListenerConfiguration}s\n   */\n  Iterable<CacheEntryListenerConfiguration<K,\n      V>> getCacheEntryListenerConfigurations();\n\n  /**\n   * Gets the {@link javax.cache.configuration.Factory} for the\n   * {@link javax.cache.integration.CacheLoader}, if any.\n   * <p>\n   * A CacheLoader should be configured for \"Read Through\" caches to load values\n   * when a cache miss occurs using either the\n   * {@link javax.cache.Cache#get(Object)} and/or\n   * {@link javax.cache.Cache#getAll(java.util.Set)} methods.\n   * <p>\n   * The default value is <code>null</code>.\n   *\n   * @return the {@link javax.cache.configuration.Factory} for the\n   * {@link javax.cache.integration.CacheLoader} or null if none has been set.\n   */\n  Factory<CacheLoader<K, V>> getCacheLoaderFactory();\n\n  /**\n   * Gets the {@link javax.cache.configuration.Factory} for the\n   * {@link javax.cache.integration.CacheWriter}, if any.\n   * <p>\n   * The default value is <code>null</code>.\n   *\n   * @return the {@link javax.cache.configuration.Factory} for the\n   * {@link javax.cache.integration.CacheWriter} or null if none has been set.\n   */\n  Factory<CacheWriter<? super K, ? super V>> getCacheWriterFactory();\n\n  /**\n   * Gets the {@link javax.cache.configuration.Factory} for the\n   * {@link javax.cache.expiry.ExpiryPolicy} to be used for caches.\n   * <p>\n   * The default value is a {@link javax.cache.configuration.Factory} that will\n   * produce a {@link javax.cache.expiry.EternalExpiryPolicy} instance.\n   *\n   * @return the {@link javax.cache.configuration.Factory} for\n   * {@link javax.cache.expiry.ExpiryPolicy} (must not be <code>null</code>)\n   */\n  Factory<ExpiryPolicy> getExpiryPolicyFactory();\n\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/configuration/Configuration.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache.configuration;\n\nimport javax.cache.Cache;\nimport javax.cache.CacheManager;\nimport java.io.Serializable;\n\n/**\n * A basic read-only representation of a {@link Cache} configuration.\n * <p>\n * The properties provided by instances of this interface are used by\n * {@link CacheManager}s to configure {@link Cache}s.\n * <p>\n * Implementations of this interface must override {@link Object#hashCode()} and\n * {@link Object#equals(Object)} as {@link Configuration}s are often compared at\n * runtime.\n *\n * @param <K> the type of keys maintained the cache\n * @param <V> the type of cached values\n * @author Greg Luck\n * @author Brian Oliver\n * @since 1.0\n */\npublic interface Configuration<K, V> extends Serializable {\n\n  /**\n   * Determines the required type of keys for {@link Cache}s configured\n   * with this {@link Configuration}.\n   *\n   * @return the key type or <code>Object.class</code> if the type is undefined\n   */\n  Class<K> getKeyType();\n\n  /**\n   * Determines the required type of values for {@link Cache}s configured\n   * with this {@link Configuration}.\n   *\n   * @return the value type or <code>Object.class</code> if the type is undefined\n   */\n  Class<V> getValueType();\n\n  /**\n   * Whether storeByValue (true) or storeByReference (false).\n   * When true, both keys and values are stored by value.\n   * <p>\n   * When false, both keys and values are stored by reference.\n   * Caches stored by reference are capable of mutation by any threads holding\n   * the reference. The effects are:\n   * <ul>\n   * <li>if the key is mutated, then the key may not be retrievable or\n   * removable</li>\n   * <li>if the value is mutated, then all threads in the JVM can potentially\n   * observe those mutations, subject to the normal Java Memory Model rules.</li>\n   * </ul>\n   * Storage by reference only applies to the local heap. If an entry is moved off\n   * heap it will need to be transformed into a representation. Any mutations that\n   * occur after transformation may not be reflected in the cache.\n   * <p>\n   * When a cache is storeByValue, any mutation to the key or value does not\n   * affect the key of value stored in the cache.\n   * <p>\n   * The default value is <code>true</code>.\n   *\n   * @return true if the cache is store by value\n   */\n  boolean isStoreByValue();\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/configuration/Factory.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache.configuration;\n\nimport java.io.Serializable;\n\n/**\n * Constructs and returns a fully configured instance of a specific factory type.\n * <p>\n * Implementations may choose not to construct a new instance, but instead\n * return a previously created instance.\n * <p>\n * Implementations must correctly implement {@link Object#equals(Object)} and\n * {@link Object#hashCode()} as {@link Factory}s are often compared with each\n * other for equivalence.\n *\n * @param <T> the type of factory constructed\n * @author Brian Oliver\n * @since 1.0\n */\npublic interface Factory<T> extends Serializable {\n\n  /**\n   * Constructs and returns a fully configured instance of T.\n   *\n   * @return an instance of T.\n   */\n  T create();\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/configuration/FactoryBuilder.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache.configuration;\n\nimport java.io.Serializable;\n\n/**\n * A convenience class that defines generically typed static methods to aid in\n * the building of {@link Factory} instances.\n * <p>\n * {@link Factory} is used by {@link MutableConfiguration} to avoid adding\n * non-Serializable instances that would assume usage in the local JVM.\n * <p>\n * Two styles of builder are available:\n * <ul>\n *   <li>those taking a Class or className. A new instance will be created by\n *   the {@link Factory}\n *   </li>\n *   <li>those taking a Serializable instance. That instance will be created\n *   by the {@link Factory}. As the instance is Serializable it no assumption of\n *   usage in the local JVM is implied.\n *   </li>\n * </ul>\n *\n * Factory instances can also be created in other ways.\n *\n * @author Brian Oliver\n * @author Greg Luck\n * @since 1.0\n */\npublic final class FactoryBuilder {\n\n  /**\n   * A private constructor to prevent instantiation.\n   */\n  private FactoryBuilder() {\n    //deliberately empty - no instances allowed!\n  }\n\n  /**\n   * Constructs a {@link Factory} that will produce factory instances of the\n   * specified class.\n   * <p>\n   * The specified class must have a no-args constructor.\n   *\n   * @param clazz the class of instances to be produced by the returned\n   *              {@link Factory}\n   * @param <T>   the type of the instances produced by the {@link Factory}\n   * @return a {@link Factory} for the specified clazz\n   */\n  public static <T> Factory<T> factoryOf(Class<T> clazz) {\n    return new ClassFactory<T>(clazz);\n  }\n\n  /**\n   * Constructs a {@link Factory} that will produce factory instances of the\n   * specified class.\n   * <p>\n   * The specified class must have a no-args constructor.\n   *\n   * @param className the class of instances to be produced by the returned\n   *                  {@link Factory}\n   * @param <T>       the type of the instances produced by the {@link Factory}\n   * @return          a {@link Factory} for the specified clazz\n   */\n  public static <T> Factory<T> factoryOf(String className) {\n    return new ClassFactory<T>(className);\n  }\n\n  /**\n   * Constructs a {@link Factory} that will return the specified factory\n   * Serializable instance.\n   * <p>\n   * If T is not Serializable use {@link #factoryOf(Class)} or\n   * {@link #factoryOf(String)}.\n   *\n   * @param instance the Serializable instance the {@link Factory} will return\n   * @param <T>      the type of the instances returned\n   * @return a {@link Factory} for the instance\n   */\n  public static <T extends Serializable> Factory<T> factoryOf(T instance) {\n    return new SingletonFactory<T>(instance);\n  }\n\n\n  /**\n   * A {@link Factory} that instantiates a specific Class.\n   *\n   * @param <T> the type of the instance produced by the {@link Factory}\n   */\n  public static class ClassFactory<T> implements Factory<T>, Serializable {\n\n    /**\n     * The serialVersionUID required for {@link Serializable}.\n     */\n    public static final long serialVersionUID = 201305101626L;\n\n    /**\n     * The name of the Class.\n     */\n    private String className;\n\n    /**\n     * Constructor for the {@link ClassFactory}.\n     *\n     * @param clazz the Class to instantiate\n     */\n    public ClassFactory(Class<T> clazz) {\n      this.className = clazz.getName();\n    }\n\n    /**\n     * Constructor for the {@link ClassFactory}.\n     *\n     * @param className the name of the Class to instantiate\n     */\n    public ClassFactory(String className) {\n      this.className = className;\n    }\n\n    @Override\n    public T create() {\n      try {\n        ClassLoader loader = Thread.currentThread().getContextClassLoader();\n\n        Class<?> clazz = loader.loadClass(className);\n\n        return (T) clazz.newInstance();\n      } catch (Exception e) {\n        throw new RuntimeException(\"Failed to create an instance of \" + className, e);\n      }\n    }\n\n    @Override\n    public boolean equals(Object other) {\n      if (this == other) return true;\n      if (other == null || getClass() != other.getClass()) return false;\n\n      ClassFactory that = (ClassFactory) other;\n\n      if (!className.equals(that.className)) return false;\n\n      return true;\n    }\n\n    @Override\n    public int hashCode() {\n      return className.hashCode();\n    }\n  }\n\n  /**\n   * A {@link Factory} that always returns a specific instance. ie: the\n   * factory returns a singleton, regardless of the number of times\n   * {@link Factory#create()} is called.\n   *\n   * @param <T> the type of the instance produced by the {@link Factory}\n   */\n  public static class SingletonFactory<T> implements Factory<T>, Serializable {\n\n    /**\n     * The serialVersionUID required for {@link java.io.Serializable}.\n     */\n    public static final long serialVersionUID = 201305101634L;\n\n    /**\n     * The singleton instance.\n     */\n    private T instance;\n\n    /**\n     * Constructor for the {@link SingletonFactory}.\n     *\n     * @param instance the instance to return\n     */\n    public SingletonFactory(T instance) {\n      this.instance = instance;\n    }\n\n    @Override\n    public T create() {\n      return instance;\n    }\n\n    @Override\n    public boolean equals(Object other) {\n      if (this == other) return true;\n      if (other == null || getClass() != other.getClass()) return false;\n\n      SingletonFactory that = (SingletonFactory) other;\n\n      if (!instance.equals(that.instance)) return false;\n\n      return true;\n    }\n\n    @Override\n    public int hashCode() {\n      return instance.hashCode();\n    }\n  }\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/configuration/MutableCacheEntryListenerConfiguration.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache.configuration;\n\nimport javax.cache.event.CacheEntryEventFilter;\nimport javax.cache.event.CacheEntryListener;\n\n/**\n * A convenience class providing a mutable, serializable implementation of a\n * {@link CacheEntryListenerConfiguration}.\n *\n * @param <K> the type of keys maintained the cache\n * @param <V> the type of cached values\n * @author Brian Oliver\n * @since 1.0\n */\npublic class MutableCacheEntryListenerConfiguration<K, V>\n    implements CacheEntryListenerConfiguration<K, V> {\n\n  /**\n   * The serialVersionUID required for {@link java.io.Serializable}.\n   */\n  public static final long serialVersionUID = 201306200822L;\n\n  /**\n   * The {@link Factory} to be used to create the {@link CacheEntryListener}.\n   */\n  private Factory<CacheEntryListener<? super K, ? super V>> listenerFactory;\n\n  /**\n   * The {@link Factory} to be used to create the {@link CacheEntryEventFilter}.\n   * (may be null if no filtering is required)\n   */\n  private Factory<CacheEntryEventFilter<? super K, ? super V>> filterFactory;\n\n  /**\n   * Is the old value required to be provide to the {@link CacheEntryListener}?\n   */\n  private boolean isOldValueRequired;\n\n  /**\n   * Should the {@link CacheEntryListener} be notified as part of an operation\n   * or is asynchronous delivery acceptable?\n   */\n  private boolean isSynchronous;\n\n  /**\n   * Constructs a {@link MutableCacheEntryListenerConfiguration} based on\n   * another {@link CacheEntryListenerConfiguration}.\n   *\n   * @param configuration the {@link CacheEntryListenerConfiguration}\n   */\n  public MutableCacheEntryListenerConfiguration(CacheEntryListenerConfiguration<K, V> configuration) {\n    this.listenerFactory = configuration.getCacheEntryListenerFactory();\n    this.filterFactory = configuration.getCacheEntryEventFilterFactory();\n    this.isOldValueRequired = configuration.isOldValueRequired();\n    this.isSynchronous = configuration.isSynchronous();\n  }\n\n  /**\n   * Constructs a {@link MutableCacheEntryListenerConfiguration}.\n   *\n   * @param listenerFactory    the {@link CacheEntryListener} {@link Factory}\n   * @param filterFactory      the optional {@link CacheEntryEventFilter} {@link Factory}\n   * @param isOldValueRequired if the old value is required for events with this listenerFactory\n   * @param isSynchronous      if the listenerFactory should block the thread causing the event\n   */\n  public MutableCacheEntryListenerConfiguration(Factory<? extends CacheEntryListener<? super K, ? super V>> listenerFactory,\n                                                Factory<? extends\n                                                    CacheEntryEventFilter<? super K, ? super V>> filterFactory,\n                                                boolean isOldValueRequired,\n                                                boolean isSynchronous) {\n    this.listenerFactory = (Factory<CacheEntryListener<? super K, ? super V>>) listenerFactory;\n    this.filterFactory = (Factory<CacheEntryEventFilter<? super K, ? super V>>) filterFactory;\n    this.isOldValueRequired = isOldValueRequired;\n    this.isSynchronous = isSynchronous;\n  }\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public Factory<CacheEntryListener<? super K, ? super V>> getCacheEntryListenerFactory() {\n    return listenerFactory;\n  }\n\n  /**\n   * Sets the {@link Factory} to be used to create a {@link CacheEntryListener}.\n   *\n   * @param listenerFactory the {@link Factory}\n   * @return the {@link MutableCacheEntryListenerConfiguration} to permit\n   *         fluent-style method calls\n   */\n  public MutableCacheEntryListenerConfiguration<K, V> setCacheEntryListenerFactory(\n      Factory<? extends CacheEntryListener<? super K, ? super V>> listenerFactory) {\n    this.listenerFactory = (Factory<CacheEntryListener<? super K, ? super V>>) listenerFactory;\n    return this;\n  }\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public Factory<CacheEntryEventFilter<? super K, ? super V>> getCacheEntryEventFilterFactory() {\n    return filterFactory;\n  }\n\n  /**\n   * Sets the {@link Factory} to be used to create a {@link CacheEntryEventFilter}.\n   *\n   * @param filterFactory the {@link Factory}, or <code>null</code> if event\n   *                      filtering is not requried\n   * @return the {@link MutableCacheEntryListenerConfiguration} to permit\n   *         fluent-style method calls\n   */\n  public MutableCacheEntryListenerConfiguration<K, V> setCacheEntryEventFilterFactory(\n      Factory<? extends CacheEntryEventFilter<? super K, ? super V>> filterFactory) {\n    this.filterFactory = (Factory<CacheEntryEventFilter<? super K, ? super V>>) filterFactory;\n    return this;\n  }\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public boolean isOldValueRequired() {\n    return isOldValueRequired;\n  }\n\n  /**\n   * Sets if the old value should be provided to the {@link CacheEntryListener}.\n   *\n   * @param isOldValueRequired <code>true</code> if the old value is required\n   * @return the {@link MutableCacheEntryListenerConfiguration} to permit\n   *         fluent-style method calls\n   */\n  public MutableCacheEntryListenerConfiguration<K, V> setOldValueRequired(\n      boolean isOldValueRequired) {\n    this.isOldValueRequired = isOldValueRequired;\n    return this;\n  }\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public boolean isSynchronous() {\n    return isSynchronous;\n  }\n\n  /**\n   * Sets if the thread that causes an event should be blocked\n   * (not return from the operation causing the event) until the\n   * {@link CacheEntryListener} has been notified.\n   *\n   * @param isSynchronous <code>true</code> means block until notified\n   * @return the {@link MutableCacheEntryListenerConfiguration} to permit\n   *         fluent-style method calls\n   */\n  public MutableCacheEntryListenerConfiguration<K, V> setSynchronous(\n      boolean isSynchronous) {\n    this.isSynchronous = isSynchronous;\n    return this;\n  }\n\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public int hashCode() {\n    final int prime = 31;\n    int result = 1;\n    result = prime * result + ((filterFactory == null) ? 0 : filterFactory.hashCode());\n    result = prime * result + (isOldValueRequired ? 1231 : 1237);\n    result = prime * result + (isSynchronous ? 1231 : 1237);\n    result = prime * result\n        + ((listenerFactory == null) ? 0 : listenerFactory.hashCode());\n    return result;\n  }\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public boolean equals(Object object) {\n    if (this == object) {\n      return true;\n    }\n    if (object == null) {\n      return false;\n    }\n    if (!(object instanceof MutableCacheEntryListenerConfiguration)) {\n      return false;\n    }\n    MutableCacheEntryListenerConfiguration<?, ?> other = (MutableCacheEntryListenerConfiguration<?, ?>) object;\n    if (filterFactory == null) {\n      if (other.filterFactory != null) {\n        return false;\n      }\n    } else if (!filterFactory.equals(other.filterFactory)) {\n      return false;\n    }\n    if (isOldValueRequired != other.isOldValueRequired) {\n      return false;\n    }\n    if (isSynchronous != other.isSynchronous) {\n      return false;\n    }\n    if (listenerFactory == null) {\n      if (other.listenerFactory != null) {\n        return false;\n      }\n    } else if (!listenerFactory.equals(other.listenerFactory)) {\n      return false;\n    }\n    return true;\n  }\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/configuration/MutableConfiguration.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache.configuration;\n\nimport javax.cache.Cache;\nimport javax.cache.CacheManager;\nimport javax.cache.event.CacheEntryListener;\nimport javax.cache.expiry.EternalExpiryPolicy;\nimport javax.cache.expiry.ExpiryPolicy;\nimport javax.cache.integration.CacheLoader;\nimport javax.cache.integration.CacheWriter;\nimport java.util.HashSet;\n\n/**\n * A simple mutable implementation of a {@link Configuration}.\n *\n * @param <K> the type of keys maintained the cache\n * @param <V> the type of cached values\n * @author Brian Oliver\n * @author Greg Luck\n * @since 1.0\n */\npublic class MutableConfiguration<K, V> implements CompleteConfiguration<K, V> {\n\n  /**\n   * The serialVersionUID required for {@link java.io.Serializable}.\n   */\n  public static final long serialVersionUID = 201306200821L;\n\n  /**\n   * The type of keys for {@link Cache}s configured with this\n   * {@link Configuration}.\n   */\n  protected Class<K> keyType;\n\n  /**\n   * The type of values for {@link Cache}s configured with this\n   * {@link Configuration}.\n   */\n  protected Class<V> valueType;\n\n  /**\n   * The {@link CacheEntryListenerConfiguration}s for the {@link Configuration}.\n   */\n  protected HashSet<CacheEntryListenerConfiguration<K,\n        V>> listenerConfigurations;\n\n  /**\n   * The {@link Factory} for the {@link CacheLoader}.\n   */\n  protected Factory<CacheLoader<K, V>> cacheLoaderFactory;\n\n  /**\n   * The {@link Factory} for the {@link CacheWriter}.\n   */\n  protected Factory<CacheWriter<? super K, ? super V>> cacheWriterFactory;\n\n  /**\n   * The {@link Factory} for the {@link ExpiryPolicy}.\n   */\n  protected Factory<ExpiryPolicy> expiryPolicyFactory;\n\n  /**\n   * A flag indicating if \"read-through\" mode is required.\n   */\n  protected boolean isReadThrough;\n\n  /**\n   * A flag indicating if \"write-through\" mode is required.\n   */\n  protected boolean isWriteThrough;\n\n  /**\n   * A flag indicating if statistics gathering is enabled.\n   */\n  protected boolean isStatisticsEnabled;\n\n  /**\n   * A flag indicating if the cache will be store-by-value or store-by-reference.\n   */\n  protected boolean isStoreByValue;\n\n  /**\n   * Whether management is enabled\n   */\n  protected boolean isManagementEnabled;\n\n  /**\n   * Default JavaBean constructor.\n   * <p>\n   * Creates a default configuration. Default configurations have no\n   * runtime type checking and are set for eternal expiry.\n   * </p><p>\n   * To enable runtime type enforcement, if supported by the implementation, call\n   * {@link #setTypes} after construction.\n   * </p><p>\n   * After construction set any other configuration parameters in the\n   * fluent style. e.g.\n   * </p>\n   * <pre>{@code\n   * CacheConfiguration<Integer, String> = new MutableConfiguration<Integer, String>()\n   *             .setTypes(Integer.class, String.class)\n   *             .setReadThrough(true)\n   *             . . .\n   * }</pre>\n   * @see #setTypes(Class, Class)\n   */\n  public MutableConfiguration() {\n    //Due to erasure in generics the type will always be Object.class. i.e. cast is ignored\n    this.keyType = (Class<K>)Object.class;\n    //Due to erasure in generics the type will always be Object.class. i.e. cast is ignored\n    this.valueType = (Class<V>)Object.class;\n    this.listenerConfigurations = new\n        HashSet<CacheEntryListenerConfiguration<K, V>>();\n    this.cacheLoaderFactory = null;\n    this.cacheWriterFactory = null;\n    this.expiryPolicyFactory = EternalExpiryPolicy.factoryOf();\n    this.isReadThrough = false;\n    this.isWriteThrough = false;\n    this.isStatisticsEnabled = false;\n    this.isStoreByValue = true;\n    this.isManagementEnabled = false;\n  }\n\n  /**\n   * Constructs a {@link MutableConfiguration} based on another\n   * {@link CompleteConfiguration}.\n   *\n   * @param configuration the {@link CompleteConfiguration}\n   */\n  public MutableConfiguration(CompleteConfiguration<K, V> configuration) {\n\n    this.keyType = configuration.getKeyType();\n    this.valueType = configuration.getValueType();\n\n    listenerConfigurations = new\n        HashSet<CacheEntryListenerConfiguration<K, V>>();\n    for (CacheEntryListenerConfiguration<K, V> definition : configuration\n        .getCacheEntryListenerConfigurations()) {\n      addCacheEntryListenerConfiguration(definition);\n    }\n\n    this.cacheLoaderFactory = configuration.getCacheLoaderFactory();\n    this.cacheWriterFactory = configuration.getCacheWriterFactory();\n\n    if (configuration.getExpiryPolicyFactory() == null) {\n      this.expiryPolicyFactory = EternalExpiryPolicy.factoryOf();\n    } else {\n      this.expiryPolicyFactory = configuration.getExpiryPolicyFactory();\n    }\n\n    this.isReadThrough = configuration.isReadThrough();\n    this.isWriteThrough = configuration.isWriteThrough();\n\n    this.isStatisticsEnabled = configuration.isStatisticsEnabled();\n\n    this.isStoreByValue = configuration.isStoreByValue();\n\n    this.isManagementEnabled = configuration.isManagementEnabled();\n  }\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public Class<K> getKeyType() {\n    return keyType;\n  }\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public Class<V> getValueType() {\n    return valueType;\n  }\n\n  /**\n   * Sets the expected type of keys and values for a {@link Cache}\n   * configured with this {@link Configuration}. Setting both to\n   * <code>Object.class</code> means type-safety checks are not required.\n   * <p>\n   * This is used by {@link CacheManager} to ensure that the key and value\n   * types are the same as those configured for the {@link Cache} prior to\n   * returning a requested cache from this method.\n   * <p>\n   * Implementations may further perform type checking on mutative cache operations\n   * and throw a {@link ClassCastException} if these checks fail.\n   *\n   * @param keyType   the expected key type\n   * @param valueType the expected value type\n   * @return the {@link MutableConfiguration} to permit fluent-style method calls\n   * @throws NullPointerException should the key or value type be null\n   * @see CacheManager#getCache(String, Class, Class)\n   */\n  public MutableConfiguration<K, V> setTypes(Class<K> keyType, Class<V> valueType) {\n    if (keyType == null || valueType == null) {\n      throw new NullPointerException(\"keyType and/or valueType can't be null\");\n    } else {\n      this.keyType = keyType;\n      this.valueType = valueType;\n      return this;\n    }\n  }\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public Iterable<CacheEntryListenerConfiguration<K,\n        V>> getCacheEntryListenerConfigurations() {\n    return listenerConfigurations;\n  }\n\n  /**\n   * Add a configuration for a {@link CacheEntryListener}.\n   *\n   * @param cacheEntryListenerConfiguration the\n   *  {@link CacheEntryListenerConfiguration}\n   * @return the {@link MutableConfiguration} to permit fluent-style method calls\n   * @throws IllegalArgumentException is the same CacheEntryListenerConfiguration\n   * is used more than once\n   */\n  public MutableConfiguration<K, V> addCacheEntryListenerConfiguration(\n      CacheEntryListenerConfiguration<K, V> cacheEntryListenerConfiguration) {\n\n    if (cacheEntryListenerConfiguration == null) {\n      throw new NullPointerException(\"CacheEntryListenerConfiguration can't be null\");\n    }\n\n    boolean alreadyExists = false;\n    for (CacheEntryListenerConfiguration<? super K, ? super V> c : listenerConfigurations) {\n      if (c.equals(cacheEntryListenerConfiguration)) {\n        alreadyExists = true;\n      }\n    }\n\n    if (!alreadyExists) {\n      this.listenerConfigurations.add(cacheEntryListenerConfiguration);\n    } else {\n      throw new IllegalArgumentException(\"A CacheEntryListenerConfiguration can \" +\n          \"be registered only once\");\n    }\n    return this;\n  }\n\n  /**\n   * Remove a configuration for a {@link CacheEntryListener}.\n   *\n   * @param cacheEntryListenerConfiguration  the\n   *     {@link CacheEntryListenerConfiguration} to remove\n   * @return the {@link MutableConfiguration} to permit fluent-style method calls\n   */\n  public MutableConfiguration<K, V> removeCacheEntryListenerConfiguration(\n      CacheEntryListenerConfiguration<K, V> cacheEntryListenerConfiguration) {\n\n    if (cacheEntryListenerConfiguration == null) {\n      throw new NullPointerException(\"CacheEntryListenerConfiguration can't be null\");\n    }\n\n    listenerConfigurations.remove(cacheEntryListenerConfiguration);\n\n    return this;\n  }\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public Factory<CacheLoader<K, V>> getCacheLoaderFactory() {\n    return this.cacheLoaderFactory;\n  }\n\n  /**\n   * Set the {@link CacheLoader} factory.\n   *\n   * @param factory the {@link CacheLoader} {@link Factory}\n   * @return the {@link MutableConfiguration} to permit fluent-style method calls\n   */\n  public MutableConfiguration<K, V> setCacheLoaderFactory(Factory<? extends\n      CacheLoader<K, V>> factory) {\n    this.cacheLoaderFactory = (Factory<CacheLoader<K, V>>) factory;\n    return this;\n  }\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public Factory<CacheWriter<? super K, ? super V>> getCacheWriterFactory() {\n    return this.cacheWriterFactory;\n  }\n\n  /**\n   * Set the {@link CacheWriter} factory.\n   *\n   * @param factory the {@link CacheWriter} {@link Factory}\n   * @return the {@link MutableConfiguration} to permit fluent-style method calls\n   */\n  public MutableConfiguration<K, V> setCacheWriterFactory(Factory<? extends\n      CacheWriter<? super K, ? super V>> factory) {\n    this.cacheWriterFactory = (Factory<CacheWriter<? super K, ? super V>>) factory;\n    return this;\n  }\n\n  /**\n   * {@inheritDoc}\n   */\n  public Factory<ExpiryPolicy> getExpiryPolicyFactory() {\n    return this.expiryPolicyFactory;\n  }\n\n  /**\n   * Set the {@link Factory} for the {@link ExpiryPolicy}.  If <code>null</code>\n   * is specified the default {@link ExpiryPolicy} is used.\n   * <p>\n   * Only one expiry policy can be set for a cache. The last policy applied\n   * before cache construction will be the one used.\n   * @param factory the {@link ExpiryPolicy} {@link Factory}\n   * @return the {@link MutableConfiguration} to permit fluent-style method calls\n   */\n  public MutableConfiguration<K, V> setExpiryPolicyFactory(Factory<? extends\n      ExpiryPolicy> factory) {\n    if (factory == null) {\n      this.expiryPolicyFactory = EternalExpiryPolicy.factoryOf();\n    } else {\n      this.expiryPolicyFactory = (Factory<ExpiryPolicy>) factory;\n    }\n    return this;\n  }\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public boolean isReadThrough() {\n    return this.isReadThrough;\n  }\n\n  /**\n   * Set if read-through caching should be used.\n   * <p>\n   * It is an invalid configuration to set this to true without specifying a\n   * {@link CacheLoader} {@link Factory}.\n   *\n   * @param isReadThrough <code>true</code> if read-through is required\n   * @return the {@link MutableConfiguration} to permit fluent-style method calls\n   */\n  public MutableConfiguration<K, V> setReadThrough(boolean isReadThrough) {\n    this.isReadThrough = isReadThrough;\n    return this;\n  }\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public boolean isWriteThrough() {\n    return this.isWriteThrough;\n  }\n\n  /**\n   * Set if write-through caching should be used.\n   * <p>\n   * It is an invalid configuration to set this to true without specifying a\n   * {@link CacheWriter} {@link Factory}.\n   *\n   * @param isWriteThrough <code>true</code> if write-through is required\n   * @return the {@link MutableConfiguration} to permit fluent-style method calls\n   */\n  public MutableConfiguration<K, V> setWriteThrough(boolean isWriteThrough) {\n    this.isWriteThrough = isWriteThrough;\n    return this;\n  }\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public boolean isStoreByValue() {\n    return this.isStoreByValue;\n  }\n\n  /**\n   * Set if a configured cache should use store-by-value or store-by-reference\n   * semantics.\n   *\n   * @param isStoreByValue <code>true</code> if store-by-value is required,\n   *                       <code>false</code> for store-by-reference\n   * @return the {@link MutableConfiguration} to permit fluent-style method calls\n   */\n  public MutableConfiguration<K, V> setStoreByValue(boolean isStoreByValue) {\n    this.isStoreByValue = isStoreByValue;\n    return this;\n  }\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public boolean isStatisticsEnabled() {\n    return this.isStatisticsEnabled;\n  }\n\n  /**\n   * Sets whether statistics gathering is enabled on a cache.\n   * <p>\n   * Statistics may be enabled or disabled at runtime via\n   * {@link CacheManager#enableStatistics(String, boolean)}.\n   *\n   * @param enabled true to enable statistics, false to disable.\n   * @return the {@link MutableConfiguration} to permit fluent-style method calls\n   */\n  public MutableConfiguration<K, V> setStatisticsEnabled(boolean enabled) {\n    this.isStatisticsEnabled = enabled;\n    return this;\n  }\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public boolean isManagementEnabled() {\n    return this.isManagementEnabled;\n  }\n\n  /**\n   * Sets whether management is enabled on a cache.\n   * <p>\n   * Management may be enabled or disabled at runtime via\n   * {@link CacheManager#enableManagement(String, boolean)}.\n   *\n   * @param enabled true to enable statistics, false to disable.\n   * @return the {@link MutableConfiguration} to permit fluent-style method calls\n   */\n  public MutableConfiguration<K, V> setManagementEnabled(boolean enabled) {\n    this.isManagementEnabled = enabled;\n    return this;\n  }\n\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public int hashCode() {\n    final int prime = 31;\n    int result = 1;\n    result = prime * result + keyType.hashCode();\n    result = prime * result + valueType.hashCode();\n    result = prime\n        * result\n        + ((listenerConfigurations == null) ? 0 : listenerConfigurations\n        .hashCode());\n    result = prime * result\n        + ((cacheLoaderFactory == null) ? 0 : cacheLoaderFactory.hashCode());\n    result = prime * result\n        + ((cacheWriterFactory == null) ? 0 : cacheWriterFactory.hashCode());\n    result = prime * result\n        + ((expiryPolicyFactory == null) ? 0 : expiryPolicyFactory.hashCode());\n    result = prime * result + (isReadThrough ? 1231 : 1237);\n    result = prime * result + (isStatisticsEnabled ? 1231 : 1237);\n    result = prime * result + (isStoreByValue ? 1231 : 1237);\n    result = prime * result + (isWriteThrough ? 1231 : 1237);\n    return result;\n  }\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public boolean equals(Object object) {\n    if (this == object) {\n      return true;\n    }\n    if (object == null) {\n      return false;\n    }\n    if (!(object instanceof MutableConfiguration)) {\n      return false;\n    }\n    MutableConfiguration<?, ?> other = (MutableConfiguration<?, ?>) object;\n\n    if (!keyType.equals(other.keyType)) {\n      return false;\n    }\n    if (!valueType.equals(other.valueType)) {\n      return false;\n    }\n    if (!listenerConfigurations.equals(other.listenerConfigurations)) {\n      return false;\n    }\n    if (cacheLoaderFactory == null) {\n      if (other.cacheLoaderFactory != null) {\n        return false;\n      }\n    } else if (!cacheLoaderFactory.equals(other.cacheLoaderFactory)) {\n      return false;\n    }\n    if (cacheWriterFactory == null) {\n      if (other.cacheWriterFactory != null) {\n        return false;\n      }\n    } else if (!cacheWriterFactory.equals(other.cacheWriterFactory)) {\n      return false;\n    }\n    if (expiryPolicyFactory == null) {\n      if (other.expiryPolicyFactory != null) {\n        return false;\n      }\n    } else if (!expiryPolicyFactory.equals(other.expiryPolicyFactory)) {\n      return false;\n    }\n    if (isReadThrough != other.isReadThrough) {\n      return false;\n    }\n    if (isStatisticsEnabled != other.isStatisticsEnabled) {\n      return false;\n    }\n    if (isStoreByValue != other.isStoreByValue) {\n      return false;\n    }\n    if (isWriteThrough != other.isWriteThrough) {\n      return false;\n    }\n    return true;\n  }\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/configuration/OptionalFeature.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache.configuration;\n\n/**\n * Optional features that may be present in an implementation.\n *\n * @author Yannis Cosmadopoulos\n * @author Greg Luck\n * @since 1.0\n */\npublic enum OptionalFeature {\n\n  /**\n   * Implementation supports store by reference\n   */\n  STORE_BY_REFERENCE\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/configuration/package-info.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * This package contains configuration classes and interfaces.\n * <p>\n * Rather than configuration accepting user instances of interfaces for maximum\n * portability factories are configured instead, so that instances can be\n * instantiated where needed. To aid in this, FactoryBuilder can build factories\n * of the required type as shown in the following example.\n * <pre><code>\n *  MutableConfiguration&lt;String, Integer&gt; config = new MutableConfiguration&lt;String, Integer&gt;();\n *\n *  config.setTypes(String.class, Integer.class)\n *        .setStoreByValue(false)\n *        .setStatisticsEnabled(true)\n *        .setExpiryPolicyFactory(FactoryBuilder.factoryOf(\n *            new AccessedExpiryPolicy&lt;String&gt;(new Duration(TimeUnit.HOURS, 1))));\n * </code></pre>\n * <p>\n * {@link javax.cache.configuration.OptionalFeature}, though not specific to\n * cache configuration, allows application to determine the optional features\n * supported at runtime.\n *\n * @author Greg Luck\n * @since 1.0\n */\npackage javax.cache.configuration;\n"
  },
  {
    "path": "src/main/java/javax/cache/event/CacheEntryCreatedListener.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache.event;\n\n/**\n * Invoked after a cache entry is created, or if a batch call is made, after the\n * entries are created.\n * <p>\n * If an entry for the key existed prior to the operation it is not invoked,\n * instead {@link CacheEntryUpdatedListener} is invoked.\n *\n * @param <K> the type of key\n * @param <V> the type of value\n * @author Yannis Cosmadopoulos\n * @author Greg Luck\n * @see CacheEntryUpdatedListener\n * @since 1.0\n */\npublic interface CacheEntryCreatedListener<K, V> extends CacheEntryListener<K, V> {\n\n  /**\n   * Called after one or more entries have been created.\n   *\n   * @param events The entries just created.\n   * @throws CacheEntryListenerException if there is problem executing the listener\n   */\n  void onCreated(Iterable<CacheEntryEvent<? extends K, ? extends V>> events)\n      throws CacheEntryListenerException;\n\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/event/CacheEntryEvent.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache.event;\n\nimport javax.cache.Cache;\nimport javax.cache.configuration.CacheEntryListenerConfiguration;\nimport java.util.EventObject;\n\n/**\n * A Cache entry event base class.\n *\n * @param <K> the type of key\n * @param <V> the type of value\n * @author Greg Luck\n * @since 1.0\n */\npublic abstract class CacheEntryEvent<K, V> extends EventObject\n    implements Cache.Entry<K, V> {\n\n  private EventType eventType;\n\n  /**\n   * Constructs a cache entry event from a given cache as source\n   *\n   * @param source the cache that originated the event\n   * @param eventType the event type for this event\n   */\n  public CacheEntryEvent(Cache source, EventType eventType) {\n    super(source);\n    this.eventType = eventType;\n  }\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public final Cache getSource() {\n    return (Cache) super.getSource();\n  }\n\n  /**\n   * Returns the value stored in the cache when this entry was created or updated.\n   * <p>\n   * The value will be available\n   * for {@link CacheEntryCreatedListener} and {@link CacheEntryUpdatedListener}.\n   * Returns the same value as {@link #getOldValue()} for\n   * {@link CacheEntryExpiredListener} and {@link CacheEntryRemovedListener}.\n   * Cache clients that need to maintain compatibility with JSR107 version 1.0\n   * cache implementations, need to use this method for retrieving the expired\n   * or removed value. When using cache implementations compatible with JSR107\n   * version 1.1, clients should prefer the method {@link #getOldValue()}.\n   *\n   * @return the value corresponding to this entry\n   * @see #getOldValue()\n   */\n  @Override\n  public abstract V getValue();\n\n  /**\n   * Returns the previous value that existed for entry in the cache before\n   * modification or removal.\n   *\n   * The old value will be available\n   * for {@link CacheEntryUpdatedListener}, {@link CacheEntryExpiredListener}\n   * and {@link CacheEntryRemovedListener}\n   * if {@link CacheEntryListenerConfiguration#isOldValueRequired()} is true.\n   * The old value may be available for {@link CacheEntryUpdatedListener},\n   * {@link CacheEntryExpiredListener} and {@link CacheEntryRemovedListener}\n   * if {@link CacheEntryListenerConfiguration#isOldValueRequired()} is false.\n   *\n   * @return the previous value or <code>null</code> if there was no previous\n   * value or the previous value is not available\n   */\n  public abstract V getOldValue();\n\n  /**\n   * Whether the old value is available. The old value will be available\n   * for {@link CacheEntryUpdatedListener}, {@link CacheEntryExpiredListener}\n   * and {@link CacheEntryRemovedListener}\n   * if {@link CacheEntryListenerConfiguration#isOldValueRequired()} is true.\n   * The old value <b>may</b> be available for {@link CacheEntryUpdatedListener},\n   * {@link CacheEntryExpiredListener} and {@link CacheEntryRemovedListener}\n   * if {@link CacheEntryListenerConfiguration#isOldValueRequired()} is false.\n   *\n   * @return true if the old value is definitely available\n   */\n  public abstract boolean isOldValueAvailable();\n\n  /**\n   * Gets the event type of this event\n   *\n   * @return the event type.\n   */\n  public final EventType getEventType() {\n    return eventType;\n  }\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/event/CacheEntryEventFilter.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache.event;\n\n/**\n * A function that may be used to check {@link CacheEntryEvent}s prior to being\n * dispatched to {@link CacheEntryListener}s.\n * <p>\n * A filter must not create side effects.\n *\n * @param <K> the type of key\n * @param <V> the type of value\n * @author Greg Luck\n * @author Brian Oliver\n * @since 1.0\n */\npublic interface CacheEntryEventFilter<K, V> {\n\n  /**\n   * Evaluates specified {@link CacheEntryEvent}.\n   *\n   * @param event the event that occurred\n   * @return true if the evaluation passes, otherwise false.\n   *         The effect of returning true is that listener will be invoked\n   * @throws CacheEntryListenerException if there is problem executing the listener\n   */\n  boolean evaluate(CacheEntryEvent<? extends K, ? extends V> event)\n      throws CacheEntryListenerException;\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/event/CacheEntryExpiredListener.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache.event;\n\n\n/**\n * Invoked if a cache entry or entries are evicted due to expiration.\n *\n * @param <K> the type of key\n * @param <V> the type of value\n * @author Greg Luck\n * @since 1.0\n */\npublic interface CacheEntryExpiredListener<K, V> extends CacheEntryListener<K, V> {\n\n  /**\n   * Called after one or more entries have been expired by the cache. This is not\n   * necessarily when an entry is expired, but when the cache detects the expiry.\n   *\n   * @param events The entries just removed.\n   * @throws CacheEntryListenerException if there is problem executing the listener\n   */\n  void onExpired(Iterable<CacheEntryEvent<? extends K, ? extends V>> events)\n      throws CacheEntryListenerException;\n\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/event/CacheEntryListener.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache.event;\n\nimport java.util.EventListener;\n\n/**\n * A tagging interface for cache entry listeners.\n * <p>\n * Sub-interfaces exist for the various cache events allowing a listener to be\n * created that implements only those listeners it is interested in.\n * <p>\n * Listeners should be implemented with care. In particular it is important to\n * consider their impact on performance and latency.\n * <p>\n * Listeners:\n * <ul>\n * <li>are fired after the entry is mutated in the cache</li>\n * <li>if synchronous are fired, for a given key, in the order that events\n * occur</li>\n * <li>block the calling thread until the listener returns,\n * where the listener was registered as synchronous</li>\n * <li>that are asynchronous iterate through multiple events with an undefined\n * ordering, except that events on the same key are in the order that the\n * events occur.</li>\n * </ul>\n * Listeners follow the observer pattern. An exception thrown by a\n * listener does not cause the cache operation to fail.\n * <p>\n * Listeners can only throw {@link CacheEntryListenerException}. Caching\n * implementations must catch any other {@link Exception} from a listener, then\n * wrap and rethrow it as a {@link CacheEntryListenerException}.\n * <p>\n * A listener that mutates a cache on the CacheManager may cause a deadlock.\n * Detection and response to deadlocks is implementation specific.\n * \n * @param <K> the type of key\n * @param <V> the type of value\n * @author Yannis Cosmadopoulos\n * @author Greg Luck\n * @see CacheEntryCreatedListener\n * @see CacheEntryUpdatedListener\n * @see CacheEntryRemovedListener\n * @see CacheEntryExpiredListener\n * @see EventType\n * @since 1.0\n */\npublic interface CacheEntryListener<K, V> extends EventListener {\n\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/event/CacheEntryListenerException.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache.event;\n\nimport javax.cache.CacheException;\n\n/**\n * An exception to indicate a problem has occurred with a listener.\n * As listeners are only called after the cache has been mutated, the mutation\n * to the cache is not affected.\n *\n * @author Greg Luck\n * @since 1.0\n */\npublic class CacheEntryListenerException extends CacheException {\n\n  private static final long serialVersionUID = 20130621110150L;\n\n\n  /**\n   * Constructs a new CacheEntryListenerException.\n   */\n  public CacheEntryListenerException() {\n    super();\n  }\n\n  /**\n   * Constructs a new CacheEntryListenerException with a message string.\n   *\n   * @param message the detail message. The detail message is saved for\n   *                later retrieval by the {@link #getMessage()} method.\n   */\n  public CacheEntryListenerException(String message) {\n    super(message);\n  }\n\n  /**\n   * Constructs a CacheEntryListenerException with a message string, and\n   * a base exception\n   *\n   * @param message the detail message. The detail message is saved for\n   *                later retrieval by the {@link #getMessage()} method.\n   * @param cause   the cause (that is saved for later retrieval by the\n   *                {@link #getCause()} method).  (A <tt>null</tt> value is\n   *                permitted, and indicates that the cause is nonexistent or\n   *                unknown.)\n   * @since 1.0\n   */\n  public CacheEntryListenerException(String message, Throwable cause) {\n    super(message, cause);\n  }\n\n\n  /**\n   * Constructs a new CacheEntryListenerException with the specified cause and a\n   * detail message of <tt>(cause==null ? null : cause.toString())</tt>\n   * (that typically contains the class and detail message of\n   * <tt>cause</tt>).  This constructor is useful for runtime exceptions\n   * that are little more than wrappers for other throwables.\n   *\n   * @param cause the cause (that is saved for later retrieval by the\n   *              {@link #getCause()} method).  (A <tt>null</tt> value is\n   *              permitted, and indicates that the cause is nonexistent or\n   *              unknown.)\n   * @since 1.0\n   */\n  public CacheEntryListenerException(Throwable cause) {\n    super(cause);\n  }\n\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/event/CacheEntryRemovedListener.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache.event;\n\n/**\n * Invoked if a cache entry is removed, or if a batch call is made, after the\n * entries are removed.\n *\n * @param <K> the type of key\n * @param <V> the type of value\n * @author Yannis Cosmadopoulos\n * @author Greg Luck\n * @since 1.0\n */\npublic interface CacheEntryRemovedListener<K, V> extends CacheEntryListener<K, V> {\n\n  /**\n   * Called after one or more entries have been removed. If no entry existed for\n   * a key an event is not raised for it.\n   *\n   * @param events The entries just removed.\n   * @throws CacheEntryListenerException if there is problem executing the listener\n   */\n  void onRemoved(Iterable<CacheEntryEvent<? extends K, ? extends V>> events)\n      throws CacheEntryListenerException;\n\n\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/event/CacheEntryUpdatedListener.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache.event;\n\n/**\n * Invoked if an existing cache entry is updated, or if a batch call is made,\n * after the entries are updated.\n *\n * @param <K> the type of key\n * @param <V> the type of value\n * @author Yannis Cosmadopoulos\n * @author Greg Luck\n * @see CacheEntryCreatedListener\n * @since 1.0\n */\npublic interface CacheEntryUpdatedListener<K, V> extends CacheEntryListener<K, V> {\n\n  /**\n   * Called after one or more entries have been updated.\n   *\n   * @param events The entries just updated.\n   * @throws CacheEntryListenerException if there is problem executing the listener\n   */\n  void onUpdated(Iterable<CacheEntryEvent<? extends K, ? extends V>> events)\n      throws CacheEntryListenerException;\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/event/EventType.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache.event;\n\n/**\n * The type of event received by the listener.\n *\n * @author Greg Luck\n * @since 1.0\n */\npublic enum EventType {\n\n  /**\n   * An event type indicating that the cache entry was created.\n   */\n  CREATED,\n\n  /**\n   * An event type indicating that the cache entry was updated. i.e. a previous\n   * mapping existed\n   */\n  UPDATED,\n\n\n  /**\n   * An event type indicating that the cache entry was removed.\n   */\n  REMOVED,\n\n\n  /**\n   * An event type indicating that the cache entry has expired.\n   */\n  EXPIRED\n\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/event/package-info.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * This package contains event listener interfaces.\n * <p>\n * These may be registered for callback notification of the cache events.\n * The specific interface should be implemented for each event type a callback\n * is desired on.\n * <p>\n * Event notifications occur synchronously in the line of execution of the calling thread.\n * The calling thread blocks until the listener has completed execution or thrown a {@link javax.cache.event.CacheEntryCreatedListener}.\n * <p>\n * Listeners are invoked <strong>after</strong> the cache is updated. If the listener throws\n * an {@link javax.cache.event.CacheEntryCreatedListener} this will propagate back to the caller but it does not affect the cache update\n * as it already completed before the listener was called.\n * \n * @author Greg Luck\n * @author Yannis Cosmadopoulos\n * @since 1.0\n */\npackage javax.cache.event;\n"
  },
  {
    "path": "src/main/java/javax/cache/expiry/AccessedExpiryPolicy.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */package javax.cache.expiry;\n\nimport javax.cache.configuration.Factory;\nimport javax.cache.configuration.FactoryBuilder;\nimport java.io.Serializable;\n\n/**\n * An {@link ExpiryPolicy} that defines the expiry {@link Duration}\n * of a Cache Entry based on the last time it was accessed. Accessed\n * does not include a cache update.\n *\n * @author Greg Luck\n * @author Brian Oliver\n * @since 1.0\n * @see ExpiryPolicy\n */\npublic final class AccessedExpiryPolicy implements ExpiryPolicy, Serializable {\n\n  /**\n   * The serialVersionUID required for {@link java.io.Serializable}.\n   */\n  public static final long serialVersionUID = 201305101601L;\n\n  /**\n   * The {@link Duration} a Cache Entry should be available before it expires.\n   */\n  private Duration expiryDuration;\n\n  /**\n   * Constructs an {@link AccessedExpiryPolicy} {@link ExpiryPolicy}.\n   *\n   * @param expiryDuration the {@link Duration} a Cache Entry should exist be\n   *                       before it expires after being accessed\n   */\n  public AccessedExpiryPolicy(Duration expiryDuration) {\n    this.expiryDuration = expiryDuration;\n  }\n\n  /**\n   * Obtains a {@link Factory} for an Accessed {@link ExpiryPolicy}.\n   * @param duration The expiry duration\n   * @return a {@link Factory} for an Accessed {@link ExpiryPolicy}.\n   */\n  public static Factory<ExpiryPolicy> factoryOf(Duration duration) {\n    return new FactoryBuilder.SingletonFactory<ExpiryPolicy>(new\n        AccessedExpiryPolicy(duration));\n  }\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public Duration getExpiryForCreation() {\n    //the initial expiry duration is the same as if the entry was accessed\n    return expiryDuration;\n  }\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public Duration getExpiryForAccess() {\n    //when a cache entry is accessed, we return the specified expiry duration,\n    //ignoring the current expiry duration\n    return expiryDuration;\n  }\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public Duration getExpiryForUpdate() {\n    //modifying a cache entry has no affect on the current expiry duration\n    return null;\n  }\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public int hashCode() {\n    final int prime = 31;\n    int result = 1;\n    result = prime * result + ((expiryDuration == null) ? 0 : expiryDuration.hashCode());\n    return result;\n  }\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public boolean equals(Object object) {\n    if (this == object) {\n      return true;\n    }\n    if (object == null) {\n      return false;\n    }\n    if (!(object instanceof AccessedExpiryPolicy)) {\n      return false;\n    }\n    AccessedExpiryPolicy other = (AccessedExpiryPolicy) object;\n    if (expiryDuration == null) {\n      if (other.expiryDuration != null) {\n        return false;\n      }\n    } else if (!expiryDuration.equals(other.expiryDuration)) {\n      return false;\n    }\n    return true;\n  }\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/expiry/CreatedExpiryPolicy.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */package javax.cache.expiry;\n\nimport javax.cache.configuration.Factory;\nimport javax.cache.configuration.FactoryBuilder;\nimport java.io.Serializable;\n\n/**\n * An {@link ExpiryPolicy} that defines the expiry {@link Duration}\n * of a Cache Entry based on when it was created. An update does not reset\n * the expiry time.\n *\n * @author Greg Luck\n * @author Brian Oliver\n * @since 1.0\n * @see ExpiryPolicy\n */\npublic final class CreatedExpiryPolicy implements ExpiryPolicy, Serializable {\n\n  /**\n   * The serialVersionUID required for {@link java.io.Serializable}.\n   */\n  public static final long serialVersionUID = 201305291023L;\n\n  /**\n   * The {@link Duration} a Cache Entry should be available before it expires.\n   */\n  private Duration expiryDuration;\n\n  /**\n   * Constructs an {@link CreatedExpiryPolicy} {@link ExpiryPolicy}.\n   *\n   * @param expiryDuration the {@link Duration} a Cache Entry should exist be\n   *                       before it expires after being modified\n   */\n  public CreatedExpiryPolicy(Duration expiryDuration) {\n    this.expiryDuration = expiryDuration;\n  }\n\n  /**\n   * Obtains a {@link Factory} for a Created {@link ExpiryPolicy}.\n   * @param duration The expiry duration\n   * @return a {@link Factory} for a Created {@link ExpiryPolicy}.\n   */\n  public static Factory<ExpiryPolicy> factoryOf(Duration duration) {\n    return new FactoryBuilder.SingletonFactory<ExpiryPolicy>(new CreatedExpiryPolicy(duration));\n  }\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public Duration getExpiryForCreation() {\n    //for newly created entries we use the specified expiry duration\n    return expiryDuration;\n  }\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public Duration getExpiryForAccess() {\n    //accessing a cache entry has no affect on the current expiry duration\n    return null;\n  }\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public Duration getExpiryForUpdate() {\n    //updating a cache entry has no affect on the current expiry duration\n    return null;\n  }\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public int hashCode() {\n    final int prime = 31;\n    int result = 1;\n    result = prime * result + ((expiryDuration == null) ? 0 : expiryDuration.hashCode());\n    return result;\n  }\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public boolean equals(Object object) {\n    if (this == object) {\n      return true;\n    }\n    if (object == null) {\n      return false;\n    }\n    if (!(object instanceof CreatedExpiryPolicy)) {\n      return false;\n    }\n    CreatedExpiryPolicy other = (CreatedExpiryPolicy) object;\n    if (expiryDuration == null) {\n      if (other.expiryDuration != null) {\n        return false;\n      }\n    } else if (!expiryDuration.equals(other.expiryDuration)) {\n      return false;\n    }\n    return true;\n  }\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/expiry/Duration.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */package javax.cache.expiry;\n\nimport java.io.Serializable;\nimport java.util.concurrent.TimeUnit;\n\nimport static java.util.concurrent.TimeUnit.DAYS;\nimport static java.util.concurrent.TimeUnit.HOURS;\nimport static java.util.concurrent.TimeUnit.MINUTES;\nimport static java.util.concurrent.TimeUnit.SECONDS;\n\n/**\n * A {@link java.io.Serializable} duration of time.\n *\n * <p>Although this class is not declared final, it is not intended for extension. The behavior\n * is undefined when subclasses are created and used.\n *\n * @author Yannis Cosmadopoulos\n * @author Greg Luck\n * @author Brian Oliver\n * @since 1.0\n * @see ExpiryPolicy\n */\npublic class Duration implements Serializable {\n\n  /**\n   * The serialVersionUID required for {@link java.io.Serializable}.\n   */\n  public static final long serialVersionUID = 201305101442L;\n\n  /**\n   * ETERNAL (forever).\n   */\n  public static final Duration ETERNAL = new Duration();\n\n  /**\n   * One day.\n   */\n  public static final Duration ONE_DAY = new Duration(DAYS, 1);\n\n  /**\n   * One hour.\n   */\n  public static final Duration ONE_HOUR = new Duration(HOURS, 1);\n\n  /**\n   * Thirty minutes.\n   */\n  public static final Duration THIRTY_MINUTES = new Duration(MINUTES, 30);\n\n  /**\n   * Twenty minutes.\n   */\n  public static final Duration TWENTY_MINUTES = new Duration(MINUTES, 20);\n\n  /**\n   * Ten minutes.\n   */\n  public static final Duration TEN_MINUTES = new Duration(MINUTES, 10);\n\n  /**\n   * Five minutes.\n   */\n  public static final Duration FIVE_MINUTES = new Duration(MINUTES, 5);\n\n  /**\n   * One minute.\n   */\n  public static final Duration ONE_MINUTE = new Duration(MINUTES, 1);\n\n  /**\n   * Zero (no time).\n   */\n  public static final Duration ZERO = new Duration(SECONDS, 0);\n\n  /**\n   * The unit of time to specify time in. The minimum time unit is milliseconds.\n   */\n  private final TimeUnit timeUnit;\n\n  /**\n   * How long, in the specified units, the cache entries should live.\n   * The lifetime is measured from the cache entry was last accessed or\n   * mutated.\n   */\n  private final long durationAmount;\n\n  /**\n   * Constructs an eternal duration ({@link #isEternal} is true). Since the duration is immutable\n   * the constant {@link #ETERNAL} should be used alternatively.\n   */\n  public Duration() {\n    this.timeUnit = null;\n    this.durationAmount = 0;\n  }\n\n  /**\n   * Constructs a duration. The eternal duration ({@link #isEternal} is true) is represented by\n   * specifying {@code null} for {@code timeUnit} and {@code 0} for {@code durationAmount}.\n   *\n   * @param timeUnit       the unit of time to specify time in. The minimum time unit is milliseconds.\n   * @param durationAmount how long, in the specified units, the cache entries should live.\n   * @throws NullPointerException     if timeUnit is null and the {@code durationAmount} is not 0\n   * @throws IllegalArgumentException if durationAmount is less than 0 or a TimeUnit less than milliseconds is specified\n   */\n  public Duration(TimeUnit timeUnit, long durationAmount) {\n    if (timeUnit == null) {\n      if (durationAmount == 0) {\n        //allow creation of an Eternal Duration\n        this.timeUnit = null;\n        this.durationAmount = 0;\n      } else {\n        throw new NullPointerException();\n      }\n\n    } else {\n      switch (timeUnit) {\n        case NANOSECONDS:\n        case MICROSECONDS:\n          throw new IllegalArgumentException(\"Must specify a TimeUnit of milliseconds or higher.\");\n        default:\n          this.timeUnit = timeUnit;\n          break;\n      }\n      if (durationAmount < 0) {\n        throw new IllegalArgumentException(\"Cannot specify a negative durationAmount.\");\n      }\n      this.durationAmount = durationAmount;\n    }\n  }\n\n  /**\n   * Constructs a {@link Duration} based on the duration between two\n   * specified points in time (since the Epoc), measured in milliseconds.\n   *\n   * <p>If either parameter is {@code Long.MAX_VALUE} an eternal duration ({@link #isEternal}\n   * is true) will be constructed.\n   *\n   * @param startTime the start time (since the Epoc)\n   * @param endTime   the end time (since the Epoc)\n   */\n  public Duration(long startTime, long endTime) {\n    if (startTime == Long.MAX_VALUE || endTime == Long.MAX_VALUE) {\n      //we're dealing with arithmetic involving an ETERNAL value\n      //so the result must be ETERNAL\n      timeUnit = null;\n      durationAmount = 0;\n    } else if (startTime < 0) {\n        throw new IllegalArgumentException(\"Cannot specify a negative startTime.\");\n    } else if (endTime < 0) {\n      throw new IllegalArgumentException(\"Cannot specify a negative endTime.\");\n    } else {\n      timeUnit = TimeUnit.MILLISECONDS;\n      durationAmount = Math.max(startTime, endTime) - Math.min(startTime, endTime);\n    }\n  }\n\n  /**\n   * Obtain the TimeUnit for the Duration\n   *\n   * @return the TimeUnit\n   */\n  public TimeUnit getTimeUnit() {\n    return timeUnit;\n  }\n\n  /**\n   * Obtain the number of TimeUnits in the Duration\n   *\n   * @return the number of TimeUnits\n   */\n  public long getDurationAmount() {\n    return durationAmount;\n  }\n\n  /**\n   * Determines if a {@link Duration} is eternal (forever).\n   *\n   * @return true if the {@link Duration} is eternal\n   */\n  public boolean isEternal() {\n    return timeUnit == null && durationAmount == 0;\n  }\n\n  /**\n   * Determines if a {@link Duration} is zero.\n   *\n   * @return true if the {@link Duration} is zero\n   */\n  public boolean isZero() {\n    return timeUnit != null && durationAmount == 0;\n  }\n\n  /**\n   * Calculates the adjusted time (represented in milliseconds from the Epoc)\n   * given a specified time in milliseconds (to be adjusted) by the duration.\n   *\n   * <p>If this instance represents an eternal duration ({@link #isEternal}\n   * is true), the value {@code Long.MAX_VALUE} is returned.\n   *\n   * @param time the time from which to adjust given the duration\n   * @return the adjusted time\n   */\n  public long getAdjustedTime(long time) {\n    if (isEternal()) {\n      return Long.MAX_VALUE;\n    } else {\n      return time + timeUnit.toMillis(durationAmount);\n    }\n  }\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public boolean equals(Object other) {\n    if (this == other) {\n      return true;\n\n    } else if (other == null || getClass() != other.getClass()) {\n      return false;\n\n    } else {\n      Duration duration = (Duration) other;\n\n      if (this.timeUnit == null && duration.timeUnit == null &&\n          this.durationAmount == duration.durationAmount) {\n        return true;\n      } else if (this.timeUnit != null && duration.timeUnit != null) {\n        long time1 = timeUnit.toMillis(durationAmount);\n        long time2 = duration.timeUnit.toMillis(duration.durationAmount);\n        return time1 == time2;\n      } else {\n        return false;\n      }\n    }\n  }\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public int hashCode() {\n    return timeUnit == null ? -1 : (int)timeUnit.toMillis(durationAmount);\n  }\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/expiry/EternalExpiryPolicy.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache.expiry;\n\nimport javax.cache.configuration.Factory;\nimport javax.cache.configuration.FactoryBuilder;\nimport java.io.Serializable;\n\nimport static javax.cache.expiry.Duration.ETERNAL;\n\n/**\n * An eternal {@link ExpiryPolicy} specifies that Cache Entries\n * won't expire.  This however doesn't mean they won't be evicted if an\n * underlying implementation needs to free-up resources where by it may\n * choose to evict entries that are not due to expire.\n *\n * @author Greg Luck\n * @author Brian Oliver\n * @since 1.0\n * @see ExpiryPolicy\n */\npublic final class EternalExpiryPolicy implements ExpiryPolicy, Serializable {\n\n  /**\n   * The serialVersionUID required for {@link java.io.Serializable}.\n   */\n  public static final long serialVersionUID = 201305101603L;\n\n  /**\n   * Obtains a {@link Factory} for an Eternal {@link ExpiryPolicy}.\n\n   * @return a {@link Factory} for an Eternal {@link ExpiryPolicy}.\n   */\n  public static Factory<ExpiryPolicy> factoryOf() {\n    return new FactoryBuilder.SingletonFactory<ExpiryPolicy>(\n        new EternalExpiryPolicy());\n  }\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public Duration getExpiryForCreation() {\n    return ETERNAL;\n  }\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public Duration getExpiryForAccess() {\n    return null;\n  }\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public Duration getExpiryForUpdate() {\n    return null;\n  }\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public int hashCode() {\n    return EternalExpiryPolicy.class.hashCode();\n  }\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public boolean equals(Object other) {\n    return other instanceof EternalExpiryPolicy;\n  }\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/expiry/ExpiryPolicy.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache.expiry;\n\n/**\n * Defines functions to determine when cache entries will expire based on\n * creation, access and modification operations.\n * <p>\n * Each of the functions return a new {@link Duration} that specifies the\n * amount of time that must pass before a cache entry is considered expired.\n * {@link Duration} has constants defined for useful durations.\n *\n * @author Brian Oliver\n * @author Greg Luck\n * @since 1.0\n * @see Duration\n */\npublic interface ExpiryPolicy {\n\n  /**\n   * Gets the {@link Duration} before a newly created Cache.Entry is considered\n   * expired.\n   * <p>\n   * This method is called by a caching implementation after a Cache.Entry is\n   * created, but before a Cache.Entry is added to a cache, to determine the\n   * {@link Duration} before an entry expires.  If a {@link Duration#ZERO}\n   * is returned the new Cache.Entry is considered to be already expired and\n   * will not be added to the Cache.\n   * <p>\n   * Should an exception occur while determining the Duration, an implementation\n   * specific default {@link Duration} will be used.\n   *\n   * @return the new {@link Duration} before a created entry expires\n   */\n  Duration getExpiryForCreation();\n\n  /**\n   * Gets the {@link Duration} before an accessed Cache.Entry is\n   * considered expired.\n   * <p>\n   * This method is called by a caching implementation after a Cache.Entry is\n   * accessed to determine the {@link Duration} before an entry expires.  If a\n   * {@link Duration#ZERO} is returned a Cache.Entry will be\n   * considered immediately expired.  Returning <code>null</code> will result\n   * in no change to the previously understood expiry {@link Duration}.\n   * <p>\n   * Should an exception occur while determining the Duration, an implementation\n   * specific default Duration will be used.\n   *\n   * @return the new {@link Duration} before an accessed entry expires\n   */\n  Duration  getExpiryForAccess();\n\n  /**\n   * Gets the {@link Duration} before an updated Cache.Entry is considered\n   * expired.\n   * <p>\n   * This method is called by the caching implementation after a Cache.Entry is\n   * updated to determine the {@link Duration} before the updated entry expires.\n   * If a {@link Duration#ZERO} is returned a Cache.Entry is considered\n   * immediately expired.  Returning <code>null</code> will result in no change\n   * to the previously understood expiry {@link Duration}.\n   * <p>\n   * Should an exception occur while determining the Duration, an implementation\n   * specific default Duration will be used.\n   *\n   * @return the new {@link Duration} before an updated entry expires\n   */\n  Duration getExpiryForUpdate();\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/expiry/ModifiedExpiryPolicy.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache.expiry;\n\nimport javax.cache.configuration.Factory;\nimport javax.cache.configuration.FactoryBuilder;\nimport java.io.Serializable;\n\n/**\n * An {@link ExpiryPolicy} that defines the expiry {@link Duration}\n * of a Cache Entry based on the last time it was updated. Updating\n * includes created and changing (updating) an entry.\n *\n * @author Greg Luck\n * @author Brian Oliver\n * @since 1.0\n * @see ExpiryPolicy\n */\npublic final class ModifiedExpiryPolicy implements ExpiryPolicy, Serializable {\n\n  /**\n   * The serialVersionUID required for {@link java.io.Serializable}.\n   */\n  public static final long serialVersionUID = 201305101602L;\n\n  /**\n   * The {@link Duration} a Cache Entry should be available before it expires.\n   */\n  private Duration expiryDuration;\n\n  /**\n   * Constructs an {@link ModifiedExpiryPolicy} {@link ExpiryPolicy}.\n   *\n   * @param expiryDuration the {@link Duration} a Cache Entry should exist be\n   *                       before it expires after being modified\n   */\n  public ModifiedExpiryPolicy(Duration expiryDuration) {\n    this.expiryDuration = expiryDuration;\n  }\n\n  /**\n   * Obtains a {@link Factory} for a Modified {@link ExpiryPolicy}.\n   *\n   * @param duration The expiry duration\n   * @return a {@link Factory} for a Modified {@link ExpiryPolicy}.\n   */\n  public static Factory<ExpiryPolicy> factoryOf(Duration duration) {\n    return new FactoryBuilder.SingletonFactory<ExpiryPolicy>(new ModifiedExpiryPolicy(duration));\n  }\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public Duration getExpiryForCreation() {\n    //for newly created entries we use the specified expiry duration\n    return expiryDuration;  }\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public Duration getExpiryForAccess() {\n    //accessing a cache entry has no affect on the current expiry duration\n    return null;\n  }\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public Duration getExpiryForUpdate() {\n    //when a cache entry is modified, we return the specified expiry duration,\n    //ignoring the current expiry duration\n    return expiryDuration;\n  }\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public int hashCode() {\n    final int prime = 31;\n    int result = 1;\n    result = prime * result + ((expiryDuration == null) ? 0 : expiryDuration.hashCode());\n    return result;\n  }\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public boolean equals(Object object) {\n    if (this == object) {\n      return true;\n    }\n    if (object == null) {\n      return false;\n    }\n    if (!(object instanceof ModifiedExpiryPolicy)) {\n      return false;\n    }\n    ModifiedExpiryPolicy other = (ModifiedExpiryPolicy) object;\n    if (expiryDuration == null) {\n      if (other.expiryDuration != null) {\n        return false;\n      }\n    } else if (!expiryDuration.equals(other.expiryDuration)) {\n      return false;\n    }\n    return true;\n  }\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/expiry/TouchedExpiryPolicy.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache.expiry;\n\nimport javax.cache.configuration.Factory;\nimport javax.cache.configuration.FactoryBuilder;\nimport java.io.Serializable;\n\n/**\n * An {@link ExpiryPolicy} that defines the expiry {@link Duration}\n * of a Cache Entry based on when it was last touched. A touch includes\n * creation, update or access.\n *\n * @author Greg Luck\n * @author Brian Oliver\n * @since 1.0\n * @see ExpiryPolicy\n */\npublic final class TouchedExpiryPolicy implements ExpiryPolicy, Serializable {\n\n  /**\n   * The serialVersionUID required for {@link java.io.Serializable}.\n   */\n  public static final long serialVersionUID = 201305291023L;\n\n  /**\n   * The {@link Duration} a Cache Entry should be available before it expires.\n   */\n  private Duration expiryDuration;\n\n  /**\n   * Constructs an {@link TouchedExpiryPolicy} {@link ExpiryPolicy}.\n   *\n   * @param expiryDuration the {@link Duration} a Cache Entry should exist be\n   *                       before it expires after being modified\n   */\n  public TouchedExpiryPolicy(Duration expiryDuration) {\n    this.expiryDuration = expiryDuration;\n  }\n\n  /**\n   * Obtains a {@link Factory} for a Touched {@link ExpiryPolicy}.\n   * @param duration The expiry duration\n   * @return a {@link Factory} for a Touched {@link ExpiryPolicy}.\n   */\n  public static Factory<ExpiryPolicy> factoryOf(Duration duration) {\n    return new FactoryBuilder.SingletonFactory<ExpiryPolicy>(new TouchedExpiryPolicy(duration));\n  }\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public Duration getExpiryForCreation() {\n    //for newly created entries we use the specified expiry duration.\n    return expiryDuration;\n  }\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public Duration getExpiryForAccess() {\n    //accessing a cache entry resets the duration.\n    return expiryDuration;\n  }\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public Duration getExpiryForUpdate() {\n    //updating a cache entry resets the duration.\n    return expiryDuration;\n  }\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public int hashCode() {\n    final int prime = 31;\n    int result = 1;\n    result = prime * result + ((expiryDuration == null) ? 0 : expiryDuration.hashCode());\n    return result;\n  }\n\n  /**\n   * {@inheritDoc}\n   */\n  @Override\n  public boolean equals(Object object) {\n    if (this == object) {\n      return true;\n    }\n    if (object == null) {\n      return false;\n    }\n    if (!(object instanceof TouchedExpiryPolicy)) {\n      return false;\n    }\n    TouchedExpiryPolicy other = (TouchedExpiryPolicy) object;\n    if (expiryDuration == null) {\n      if (other.expiryDuration != null) {\n        return false;\n      }\n    } else if (!expiryDuration.equals(other.expiryDuration)) {\n      return false;\n    }\n    return true;\n  }\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/expiry/package-info.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n This package contains expiry policies\n\n @author Greg Luck\n @since 1.0\n */\npackage javax.cache.expiry;\n"
  },
  {
    "path": "src/main/java/javax/cache/integration/CacheLoader.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache.integration;\n\nimport javax.cache.configuration.CompleteConfiguration;\nimport java.util.Map;\n\n/**\n * Used when a cache is read-through or when loading data into a cache via the\n * {@link javax.cache.Cache#loadAll(java.util.Set, boolean,\n * CompletionListener)} method.\n *\n * @param <K> the type of keys handled by this loader\n * @param <V> the type of values generated by this loader\n * @author Greg Luck\n * @author Yannis Cosmadopoulos\n * @see CompleteConfiguration#isReadThrough()\n * @see CacheWriter\n * @since 1.0\n */\npublic interface CacheLoader<K, V> {\n\n  /**\n   * Loads an object. Application developers should implement this\n   * method to customize the loading of a value for a cache entry. This method\n   * is called by a cache when a requested entry is not in the cache. If\n   * the object can't be loaded <code>null</code> should be returned.\n   *\n   * @param key the key identifying the object being loaded\n   * @return The value for the entry that is to be stored in the cache or\n   *         <code>null</code> if the object can't be loaded\n   * @throws CacheLoaderException if there is problem executing the loader.\n   */\n  V load(K key) throws CacheLoaderException;\n\n\n\n  /**\n   * Loads multiple objects. Application developers should implement this\n   * method to customize the loading of cache entries. This method is called\n   * when the requested object is not in the cache. If an object can't be loaded,\n   * it is not returned in the resulting map.\n   *\n   * @param keys keys identifying the values to be loaded\n   * @return A map of key, values to be stored in the cache.\n   * @throws CacheLoaderException if there is problem executing the loader.\n   */\n  Map<K, V> loadAll(Iterable<? extends K> keys) throws CacheLoaderException;\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/integration/CacheLoaderException.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */package javax.cache.integration;\n\nimport javax.cache.CacheException;\n\n/**\n * An exception to indicate a problem has occurred executing a {@link CacheLoader}.\n * <p>\n * A Caching Implementation must wrap any {@link Exception} thrown by a {@link\n * CacheLoader} in this exception.\n *\n * @author Greg Luck\n * @since 1.0\n */\npublic class CacheLoaderException extends CacheException {\n\n  private static final long serialVersionUID = 20130822163231L;\n\n\n  /**\n   * Constructs a new CacheLoaderException.\n   */\n  public CacheLoaderException() {\n    super();\n  }\n\n  /**\n   * Constructs a new CacheLoaderException with a message string.\n   *\n   * @param message the detail message. The detail message is saved for\n   *                later retrieval by the {@link #getMessage()} method.\n   */\n  public CacheLoaderException(String message) {\n    super(message);\n  }\n\n  /**\n   * Constructs a CacheLoaderException with a message string, and\n   * a base exception\n   *\n   * @param message the detail message. The detail message is saved for\n   *                later retrieval by the {@link #getMessage()} method.\n   * @param cause   the cause (that is saved for later retrieval by the\n   *                {@link #getCause()} method).  (A <tt>null</tt> value is\n   *                permitted, and indicates that the cause is nonexistent or\n   *                unknown.)\n   * @since 1.0\n   */\n  public CacheLoaderException(String message, Throwable cause) {\n    super(message, cause);\n  }\n\n\n  /**\n   * Constructs a new CacheLoaderException with the specified cause and a\n   * detail message of <tt>(cause==null ? null : cause.toString())</tt>\n   * (that typically contains the class and detail message of\n   * <tt>cause</tt>).  This constructor is useful for runtime exceptions\n   * that are little more than wrappers for other throwables.\n   *\n   * @param cause the cause (that is saved for later retrieval by the\n   *              {@link #getCause()} method).  (A <tt>null</tt> value is\n   *              permitted, and indicates that the cause is nonexistent or\n   *              unknown.)\n   * @since 1.0\n   */\n  public CacheLoaderException(Throwable cause) {\n    super(cause);\n  }\n\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/integration/CacheWriter.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */package javax.cache.integration;\n\n\nimport javax.cache.Cache;\nimport java.util.Collection;\n\n/**\n * A CacheWriter is used for write-through to an external resource.\n * <p>\n * Under Default Consistency, the non-batch writer methods are atomic with respect\n * to the corresponding cache operation.\n * <p>\n * For batch methods under Default Consistency, the entire cache operation\n * is not required to be atomic in {@link Cache} and is therefore not required to\n * be atomic in the writer. As individual writer operations can fail, cache\n * operations are not required to occur until after the writer batch method has\n * returned or, in the case of partial success, thrown an exception. In the case\n * of partial success, the collection of entries return must only contain\n * those entries that failed.\n * <p>\n * The entry passed into {@link #write(Cache.Entry)} is independent\n * of the cache mapping for that key, meaning that if the value changes in the\n * cache or is removed it does not change the entry.\n *\n * @param <K> the type of keys maintained by this map\n * @param <V> the type of mapped values\n * @author Greg Luck\n * @author Brian Oliver\n * @see CacheLoader\n * @since 1.0\n */\npublic interface CacheWriter<K, V> {\n\n\n  /**\n   * Write the specified value under the specified key to the external resource.\n   * <p>\n   * This method is intended to support both key/value creation and value update\n   * for a specific key.\n   *\n   * @param entry the entry to be written\n   * @throws CacheWriterException if the write fails. If thrown the\n   *                              cache mutation will not occur.\n   */\n  void write(Cache.Entry<? extends K, ? extends V> entry) throws CacheWriterException;\n\n  /**\n   * Write the specified entries to the external resource. This method is intended\n   * to support both insert and update.\n   * <p>\n   * The order that individual writes occur is undefined, as\n   * {@link Cache#putAll(java.util.Map)} also has undefined ordering.\n   * <p>\n   * If this operation fails (by throwing an exception) after a partial success,\n   * the writer must remove any successfully written entries from the entries\n   * collection so that the caching implementation knows what succeeded and can\n   * mutate the cache.\n   *\n   * @param entries a mutable collection to write. Upon invocation, it contains\n   *                the entries to write for write-through. Upon return the\n   *                collection must only contain entries that were not\n   *                successfully written. (see partial success above)\n   * @throws CacheWriterException if one or more of the writes fail. If\n   *                              thrown cache mutations will occur for\n   *                              entries that succeeded.\n   */\n  void writeAll(Collection<Cache.Entry<? extends K, ? extends V>> entries) throws\n      CacheWriterException;\n\n\n  /**\n   * Delete the cache entry from the external resource.\n   * <p>\n   * Expiry of a cache entry is not a delete hence will not cause this method to\n   * be invoked.\n   * <p>\n   * This method is invoked even if no mapping for the key exists.\n   *\n   * @param key the key that is used for the delete operation\n   * @throws CacheWriterException if delete fails. If thrown the cache delete will\n   *                              not occur.\n   */\n  void delete(Object key) throws CacheWriterException;\n\n\n  /**\n   * Remove data and keys from the external resource for the given collection of\n   * keys, if present.\n   * <p>\n   * The order that individual deletes occur is undefined, as\n   * {@link Cache#removeAll(java.util.Set)} also has undefined ordering.\n   * <p>\n   * If this operation fails (by throwing an exception) after a partial success,\n   * the writer must remove any successfully written entries from the entries\n   * collection so that the caching implementation knows what succeeded and can\n   * mutate the cache.\n   * <p>\n   * Expiry of a cache entry is not a delete hence will not cause this method to\n   * be invoked.\n   * <p>\n   * This method may include keys even if there is no mapping for that key,\n   * in which case the data represented by that key should be removed from the\n   * underlying resource.\n   *\n   * @param keys a mutable collection of keys for entries to delete. Upon\n   *             invocation, it contains the keys to delete for write-through.\n   *             Upon return the collection must only contain the keys that were\n   *             not successfully deleted. (see partial success above)\n   * @throws CacheWriterException if one or more deletes fail. If thrown\n   *                              cache deletes will occur for entries that\n   *                              succeeded.\n   */\n  void deleteAll(Collection<?> keys) throws CacheWriterException;\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/integration/CacheWriterException.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */package javax.cache.integration;\n\nimport javax.cache.CacheException;\n\n/**\n * An exception to indicate a problem has occurred executing a {@link CacheWriter}.\n * <p>\n * A Caching Implementation must wrap any {@link Exception} thrown by a {@link\n * CacheWriter} in this exception.\n *\n * @author Greg Luck\n * @since 1.0\n */\npublic class CacheWriterException extends CacheException {\n\n  private static final long serialVersionUID =  20130822161612L;\n\n\n  /**\n   * Constructs a new CacheWriterException.\n   */\n  public CacheWriterException() {\n    super();\n  }\n\n  /**\n   * Constructs a new CacheWriterException with a message string.\n   *\n   * @param message the detail message. The detail message is saved for\n   *                later retrieval by the {@link #getMessage()} method.\n   */\n  public CacheWriterException(String message) {\n    super(message);\n  }\n\n  /**\n   * Constructs a CacheWriterException with a message string, and\n   * a base exception\n   *\n   * @param message the detail message. The detail message is saved for\n   *                later retrieval by the {@link #getMessage()} method.\n   * @param cause   the cause (that is saved for later retrieval by the\n   *                {@link #getCause()} method).  (A <tt>null</tt> value is\n   *                permitted, and indicates that the cause is nonexistent or\n   *                unknown.)\n   * @since 1.0\n   */\n  public CacheWriterException(String message, Throwable cause) {\n    super(message, cause);\n  }\n\n\n  /**\n   * Constructs a new CacheWriterException with the specified cause and a\n   * detail message of <tt>(cause==null ? null : cause.toString())</tt>\n   * (that typically contains the class and detail message of\n   * <tt>cause</tt>).  This constructor is useful for runtime exceptions\n   * that are little more than wrappers for other throwables.\n   *\n   * @param cause the cause (that is saved for later retrieval by the\n   *              {@link #getCause()} method).  (A <tt>null</tt> value is\n   *              permitted, and indicates that the cause is nonexistent or\n   *              unknown.)\n   * @since 1.0\n   */\n  public CacheWriterException(Throwable cause) {\n    super(cause);\n  }\n\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/integration/CompletionListener.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache.integration;\n\n/**\n * A CompletionListener is implemented by an application when it needs to be\n * notified of the completion of some Cache operation.\n * <p>\n * When the operation is complete, the Cache provider notifies the application\n * by calling the {@link #onCompletion()} method of the {@link\n * CompletionListener}.\n * <p>\n * If the operation fails for any reason, the Cache provider calls the\n * {@link #onException(Exception)} method of the {@link CompletionListener}.\n * <p>\n * To support a Java Future-based approach to synchronously wait for a Cache\n * operation to complete, use a {@link CompletionListenerFuture}.\n * <p>\n * A Cache provider will use an implementation specific thread to call methods\n * on this interface.\n *\n * @author Brian Oliver\n * @since 1.0\n * @see CompletionListenerFuture\n */\npublic interface CompletionListener {\n\n  /**\n   * Notifies the application that the operation completed successfully.\n   */\n  void onCompletion();\n\n  /**\n   * Notifies the application that the operation failed.\n   *\n   * @param e the Exception that occurred\n   */\n  void onException(Exception e);\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/integration/CompletionListenerFuture.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */package javax.cache.integration;\n\nimport java.util.concurrent.ExecutionException;\nimport java.util.concurrent.Future;\nimport java.util.concurrent.TimeUnit;\nimport java.util.concurrent.TimeoutException;\n\n/**\n * A CompletionListenerFuture is a CompletionListener implementation that\n * supports being used as a Future.\n * <p>\n * For example:\n * <pre><code>\n * //create a completion future to use to wait for loadAll\n * CompletionListenerFuture future = new CompletionListenerFuture();\n * \n * //load the values for the set of keys, replacing those that may already exist\n * //in the cache\n * cache.loadAll(keys, true, future);\n * \n * //wait for the cache to load the keys\n * future.get();\n * </code></pre>\n * <p>\n * A CompletionListenerFuture may only be used once.  Attempts to use an instance\n * multiple times, as part of multiple asynchronous calls will result in an\n * {@link java.lang.IllegalStateException} being raised.\n *\n * @author Brian Oliver\n * @author Greg Luck\n * @author Jens Wilke\n * @since 1.0\n */\npublic class CompletionListenerFuture implements CompletionListener, Future<Void> {\n\n  private final Object lock = new Object();\n  private boolean isCompleted;\n  private Exception exception;\n\n  /**\n   * Constructs a CompletionListenerFuture.\n   */\n  public CompletionListenerFuture() {\n    this.isCompleted = false;\n    this.exception = null;\n  }\n\n  /**\n   * Notifies the application that the operation completed successfully.\n   * @throws IllegalStateException if the instance is used more than once\n   */\n  @Override\n  public void onCompletion() throws IllegalStateException {\n    synchronized (lock) {\n      if (isCompleted) {\n        throw new IllegalStateException(\"Attempted to use a CompletionListenerFuture instance more than once\");\n      }\n      markAsCompleted();\n    }\n  }\n\n  /**\n   * Notifies the application that the operation failed.\n   *\n   * @param e the Exception that occurred\n   * @throws IllegalStateException if the instance is used more than once\n   */\n  @Override\n  public void onException(Exception e) throws IllegalStateException {\n    synchronized (lock) {\n      if (isCompleted) {\n        throw new IllegalStateException(\"Attempted to use a CompletionListenerFuture instance more than once\");\n      }\n      exception = e;\n      markAsCompleted();\n    }\n  }\n\n  /**\n   * Mark operation as completed and wakeup all listeners, called under lock.\n   */\n  private void markAsCompleted() {\n    assert Thread.holdsLock(lock);\n    isCompleted = true;\n    lock.notifyAll();\n  }\n\n  /**\n   * Cancelling is not supported, always throws exception.\n   *\n   * @throws UnsupportedOperationException thrown always\n   */\n  @Override\n  public boolean cancel(boolean b) {\n    throw new UnsupportedOperationException(\"CompletionListenerFutures can't be cancelled\");\n  }\n\n  /**\n   * Cancelling is not supported, always returns false\n   *\n   * @return always false.\n   */\n  @Override\n  public boolean isCancelled() {\n    return false;\n  }\n\n  @Override\n  public boolean isDone() {\n    synchronized (lock) {\n      return isCompleted;\n    }\n  }\n\n  /**\n   * Waits if necessary for the operation to complete. Always returns {@code null}.\n   *\n   * @return always {@code null}\n   * @throws ExecutionException if the computation threw an\n   * exception. This wraps the exception received by {@link #onException\n   * (Exception)}\n   * @throws InterruptedException if the current thread was interrupted\n   * while waiting\n   */\n  @Override\n  public Void get() throws InterruptedException, ExecutionException {\n    synchronized (lock) {\n      while (!isCompleted) {\n        lock.wait();\n      }\n      if (exception != null) {\n        throw new ExecutionException(exception);\n      }\n    }\n    return null;\n  }\n\n  /**\n   * Waits if necessary for at most the given time for the operation\n   * to complete.  Always returns {@code null}.\n   *\n   * @param timeout the maximum time to wait\n   * @param unit the time unit of the timeout argument\n   * @return always {@code null}\n   * @throws ExecutionException if the computation threw an\n   * exception. This wraps the exception received by {@link #onException\n   * (Exception)}\n   * @throws InterruptedException if the current thread was interrupted\n   * while waiting\n   * @throws TimeoutException if the wait timed out\n   */\n  @Override\n  public Void get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {\n    long endTime = System.currentTimeMillis() + unit.toMillis(timeout);\n    synchronized (lock) {\n      while (!isCompleted) {\n        long waitTime = endTime - System.currentTimeMillis();\n        if (waitTime <= 0) {\n          throw new TimeoutException();\n        }\n        lock.wait(waitTime);\n      }\n      if (exception != null) {\n        throw new ExecutionException(exception);\n      }\n    }\n    return null;\n  }\n\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/integration/package-info.java",
    "content": "/**\n *  Copyright (c) 2011-2013 Terracotta, Inc.\n *  Copyright (c) 2011-2013 Oracle and/or its affiliates.\n *\n *  All rights reserved. Use is subject to license terms.\n */\n\n/**\n * This package contains interfaces for integration.\n * <p>\n * It contains the {@link javax.cache.integration.CacheLoader} and\n * {@link javax.cache.integration.CacheWriter} interfaces that\n * allow loading from and writing to other systems respectively.\n * <p>\n * A cache with a registered loader can be configured as a read-through cache, so\n * that access will automatically load missing entries. And similarly a cache\n * with a registered writer can be configured\n * as a write-through cache, so that changes are written through to an underlying\n * system.\n * <p>\n * In addition a common idiom is to use a loader to initially\n * populate or refresh a cache. For that purpose there is the\n * {@link javax.cache.Cache#loadAll(java.util.Set, boolean, CompletionListener)}\n * method.\n *\n * @author Greg Luck\n * @since 1.0\n */\npackage javax.cache.integration;\n\n"
  },
  {
    "path": "src/main/java/javax/cache/management/CacheMXBean.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache.management;\n\nimport javax.cache.Cache;\nimport javax.cache.integration.CacheLoader;\nimport javax.cache.integration.CacheWriter;\nimport javax.management.MXBean;\n\n/**\n * A management bean for cache. It provides configuration information. It does not\n * allow mutation of configuration or mutation of the cache.\n * <p>\n * Each cache's management object must be registered with an ObjectName that is\n * unique and has the following type and attributes:\n * <p>\n * Type:\n * <code>javax.cache:type=CacheConfiguration</code>\n * <p>\n * Required Attributes:\n * <ul>\n * <li>CacheManager the URI of the CacheManager\n * <li>Cache the name of the Cache\n * </ul>\n *\n * @author Greg Luck\n * @author Yannis Cosmadopoulos\n * @since 1.0\n */\n@MXBean\npublic interface CacheMXBean {\n\n  /**\n   * Determines the required type of keys for this {@link Cache}, if any.\n   *\n   * @return the fully qualified class name of the key type,\n   * or \"java.lang.Object\" if the type is undefined.\n   */\n  String getKeyType();\n\n  /**\n   * Determines the required type of values for this {@link Cache}, if any.\n   * @return the fully qualified class name of the value type,\n   * or \"java.lang.Object\" if the type is undefined.\n   */\n  String getValueType();\n\n  /**\n   * Determines if a {@link Cache} should operate in read-through mode.\n   * <p>\n   * When in read-through mode, cache misses that occur due to cache entries\n   * not existing as a result of performing a \"get\" call via one of\n   * {@link Cache#get},\n   * {@link Cache#getAll},\n   * {@link Cache#getAndRemove} and/or\n   * {@link Cache#getAndReplace} will appropriately\n   * cause the configured {@link CacheLoader} to be\n   * invoked.\n   * <p>\n   * The default value is <code>false</code>.\n   *\n   * @return <code>true</code> when a {@link Cache} is in\n   *         \"read-through\" mode.\n   * @see CacheLoader\n   */\n  boolean isReadThrough();\n\n  /**\n   * Determines if a {@link Cache} should operate in \"write-through\"\n   * mode.\n   * <p>\n   * When in \"write-through\" mode, cache updates that occur as a result of\n   * performing \"put\" operations called via one of\n   * {@link Cache#put},\n   * {@link Cache#getAndRemove},\n   * {@link Cache#removeAll},\n   * {@link Cache#getAndPut}\n   * {@link Cache#getAndRemove},\n   * {@link Cache#getAndReplace},\n   * {@link Cache#invoke}\n   * {@link Cache#invokeAll}\n   * <p>\n   * will appropriately cause the configured {@link CacheWriter} to be invoked.\n   * <p>\n   * The default value is <code>false</code>.\n   *\n   * @return <code>true</code> when a {@link Cache} is in \"write-through\" mode.\n   * @see CacheWriter\n   */\n  boolean isWriteThrough();\n\n  /**\n   * Whether storeByValue (true) or storeByReference (false).\n   * When true, both keys and values are stored by value.\n   * <p>\n   * When false, both keys and values are stored by reference.\n   * Caches stored by reference are capable of mutation by any threads holding\n   * the reference. The effects are:\n   * <ul>\n   * <li>if the key is mutated, then the key may not be retrievable or\n   * removable</li>\n   * <li>if the value is mutated, then all threads in the JVM can potentially\n   * observe those mutations, subject to the normal Java Memory Model rules.</li>\n   * </ul>\n   * Storage by reference only applies to the local heap. If an entry is moved off\n   * heap it will need to be transformed into a representation. Any mutations that\n   * occur after transformation may not be reflected in the cache.\n   * <p>\n   * When a cache is storeByValue, any mutation to the key or value does not affect\n   * the key of value stored in the cache.\n   * <p>\n   * The default value is <code>true</code>.\n   *\n   * @return true if the cache is store by value\n   */\n  boolean isStoreByValue();\n\n  /**\n   * Checks whether statistics collection is enabled in this cache.\n   * <p>\n   * The default value is <code>false</code>.\n   *\n   * @return true if statistics collection is enabled\n   */\n  boolean isStatisticsEnabled();\n\n  /**\n   * Checks whether management is enabled on this cache.\n   * <p>\n   * The default value is <code>false</code>.\n   *\n   * @return true if management is enabled\n   */\n  boolean isManagementEnabled();\n\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/management/CacheStatisticsMXBean.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache.management;\n\nimport javax.management.MXBean;\n\n/**\n * Cache statistics.\n * <p>\n * Statistics are accumulated from the time a cache is created. They can be reset\n * to zero using {@link #clear}.\n * <p>\n * There are no defined consistency semantics for statistics. Refer to the\n * implementation for precise semantics.\n * <p>\n * Each cache's statistics object must be registered with an ObjectName that is\n * unique and has the following type and attributes:\n * <p>\n * Type:\n * <code>javax.cache:type=CacheStatistics</code>\n * <p>\n * Required Attributes:\n * <ul>\n * <li>CacheManager the URI of the CacheManager\n * <li>Cache the name of the Cache\n * </ul>\n *\n * @author Greg Luck\n * @since 1.0\n */\n@MXBean\npublic interface CacheStatisticsMXBean {\n\n  /**\n   * Clears the statistics counters to 0 for the associated Cache.\n   */\n  void clear();\n\n  /**\n   * The number of get requests that were satisfied by the cache.\n   * <p>\n   * {@link javax.cache.Cache#containsKey(Object)} is not a get request for\n   * statistics purposes.\n   * <p>\n   * In a caches with multiple tiered storage, a hit may be implemented as a hit\n   * to the cache or to the first tier.\n   * <p>\n   * For an {@link javax.cache.processor.EntryProcessor}, a hit occurs when the\n   * key exists and an entry processor can be invoked against it, even if no\n   * methods of {@link javax.cache.Cache.Entry} or\n   * {@link javax.cache.processor.MutableEntry} are called.\n   *\n   * @return the number of hits\n   */\n  long getCacheHits();\n\n  /**\n   * This is a measure of cache efficiency.\n   * <p>\n   * It is calculated as:\n   * {@link #getCacheHits} divided by {@link #getCacheGets ()} * 100.\n   *\n   * @return the percentage of successful hits, as a decimal e.g 75.\n   */\n  float getCacheHitPercentage();\n\n  /**\n   * A miss is a get request that is not satisfied.\n   * <p>\n   * In a simple cache a miss occurs when the cache does not satisfy the request.\n   * <p>\n   * {@link javax.cache.Cache#containsKey(Object)} is not a get request for\n   * statistics purposes.\n   * <p>\n   * For an {@link javax.cache.processor.EntryProcessor}, a miss occurs when the\n   * key does not exist and therefore an entry processor cannot be invoked\n   * against it.\n   * <p>\n   * In a caches with multiple tiered storage, a miss may be implemented as a miss\n   * to the cache or to the first tier.\n   * <p>\n   * In a read-through cache a miss is an absence of the key in the cache that\n   * will trigger a call to a CacheLoader. So it is still a miss even though the\n   * cache will load and return the value.\n   * <p>\n   * Refer to the implementation for precise semantics.\n   *\n   * @return the number of misses\n   */\n  long getCacheMisses();\n\n  /**\n   * Returns the percentage of cache accesses that did not find a requested entry\n   * in the cache.\n   * <p>\n   * This is calculated as {@link #getCacheMisses()} divided by\n   * {@link #getCacheGets()} * 100.\n   *\n   * @return the percentage of accesses that failed to find anything\n   */\n  float getCacheMissPercentage();\n\n  /**\n   * The total number of requests to the cache. This will be equal to the sum of\n   * the hits and misses.\n   * <p>\n   * A \"get\" is an operation that returns the current or previous value. It does\n   * not include checking for the existence of a key.\n   * <p>\n   * In a caches with multiple tiered storage, a gets may be implemented as a get\n   * to the cache or to the first tier.\n   *\n   * @return the number of gets\n   */\n  long getCacheGets();\n\n  /**\n   * The total number of puts to the cache.\n   * <p>\n   * A put is counted even if it is immediately evicted.\n   * <p>\n   * Replaces, where a put occurs which overrides an existing mapping is counted\n   * as a put.\n   *\n   * @return the number of puts\n   */\n  long getCachePuts();\n\n  /**\n   * The total number of removals from the cache. This does not include evictions,\n   * where the cache itself initiates the removal to make space.\n   *\n   * @return the number of removals\n   */\n  long getCacheRemovals();\n\n  /**\n   * The total number of evictions from the cache. An eviction is a removal\n   * initiated by the cache itself to free up space. An eviction is not treated as\n   * a removal and does not appear in the removal counts.\n   *\n   * @return the number of evictions\n   */\n  long getCacheEvictions();\n\n  /**\n   * The mean time to execute gets.\n   * <p>\n   * In a read-through cache the time taken to load an entry on miss is not\n   * included in get time.\n   *\n   * @return the time in µs\n   */\n  float getAverageGetTime();\n\n  /**\n   * The mean time to execute puts.\n   *\n   * @return the time in µs\n   */\n  float getAveragePutTime();\n\n  /**\n   * The mean time to execute removes.\n   *\n   * @return the time in µs\n   */\n  float getAverageRemoveTime();\n\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/management/package-info.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * This package contains management interfaces.\n * \n * @author Greg Luck\n * @since 1.0\n */\npackage javax.cache.management;\n"
  },
  {
    "path": "src/main/java/javax/cache/package-info.java",
    "content": "\n/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * This package contains the API for JCache. JCache describes the technique\n * whereby Java developers use a {@link javax.cache.spi.CachingProvider} to\n * temporarily cache Java objects. It provides a common way for Java programs\n * to create, access, update and remove entries from caches.\n * <h1>Core Concepts</h1>\n * The Java Caching API defines five core interfaces:\n * {@link javax.cache.spi.CachingProvider}, {@link javax.cache.CacheManager},\n * {@link javax.cache.Cache}, {@link javax.cache.Cache.Entry} and\n * {@link javax.cache.expiry.ExpiryPolicy}.\n * <p>\n * A {@link javax.cache.spi.CachingProvider} defines the mechanism to establish,\n * configure, acquire, manage and control zero or more\n * {@link javax.cache.CacheManager}s.  An application may access and use zero\n * or more {@link javax.cache.spi.CachingProvider}s at runtime.\n * <p>\n * A {@link javax.cache.CacheManager} defines the mechanism to establish,\n * configure, acquire, manage and control zero or more uniquely named\n * {@link javax.cache.Cache}s all within the context of the\n * {@link javax.cache.CacheManager}. A {@link javax.cache.CacheManager} is\n * owned by a single {@link javax.cache.spi.CachingProvider}.\n * <p>\n * A {@link javax.cache.Cache} is a Map-like data-structure that permits\n * the temporary storage of Key-based Values, some what like\n * {@link java.util.Map} data-structure.  A {@link javax.cache.Cache} is owned\n * by a single {@link javax.cache.CacheManager}.\n * <p>\n * An {@link javax.cache.Cache.Entry} is a single key-value pair stored by a\n * {@link javax.cache.Cache}.\n * <p>\n * Each entry stored by a {@link javax.cache.Cache} has a defined duration, called\n * the Expiry Duration, during which they may be accessed, updated and removed.\n * Once this duration has passed, the entry is said to be expired. Once expired,\n * entries are no longer available to be accessed, updated or removed, just as if\n * they never existed in a {@link javax.cache.Cache}. Expiry is set using an\n * {@link javax.cache.expiry.ExpiryPolicy}.\n * <h1>Store-By-Value and Store-By-Reference</h1>\n * Entries are stored by individual {@link javax.cache.Cache}s using one of two\n * mechanisms:\n * store-by-value and store-by-reference.\n * <h2>Store-By-Value</h2>\n * The default mechanism, called store-by-value, instructs an implementation to\n * make a copy of application provided keys and values prior to storing them in a\n * {@link javax.cache.Cache} and later to return a new copy of the entries when\n * accessed from a {@link javax.cache.Cache}.\n * <p>\n * The purpose of copying entries as they are stored in a {@link javax.cache.Cache}\n * and again when they are returned from a {@link javax.cache.Cache} is to allow\n * applications to continue mutating the state of the keys and values without causing\n * side-effects to entries held by a {@link javax.cache.Cache}.\n * <h2>Store-By-Reference</h2>\n * The alternative and optional mechanism, called store-by-reference, instructs a\n * {@link javax.cache.Cache} implementation to simply store and return references to\n * the application provided keys and values, instead of making a copies as required by\n * the store-by-value approach.  Should an application later mutate the keys or values\n * provided to a {@link javax.cache.Cache} using store-by-reference semantics, the\n * side-effects of the mutations will be visible to those accessing the entries from\n * the {@link javax.cache.Cache}, without an application having to update the\n * {@link javax.cache.Cache}.\n * <h1>{@link javax.cache.Cache}s and {@link java.util.Map}s</h1>\n * While {@link javax.cache.Cache}s and {@link java.util.Map}s share somewhat similar\n * APIs, {@link javax.cache.Cache}s are not Maps and {@link java.util.Map}s are not\n * {@link javax.cache.Cache}s.\n * The following section outlines the main similarities and differences.\n * <p>\n * Like {@link java.util.Map}-based data-structures:\n * <ul>\n * <li>{@link javax.cache.Cache} values are stored and accessed through an associated\n * key.</li>\n * <li>Each key may only be associated with a single value in a\n * {@link javax.cache.Cache}. <li>Great care must be exercised if mutable objects are\n * used as keys. The behavior of a {@link javax.cache.Cache} is undefined if a key\n * is mutated in a manner that affects equals comparisons when a key is used with\n * a {@link javax.cache.Cache}.</li> <li>{@link javax.cache.Cache}s depend on the\n * concept of equality to determine when keys and values are the same. Consequently\n * custom key and value classes should define a suitable implementation of the\n * {@link java.lang.Object#equals} method.</li> <li> Custom key classes should\n * additionally provide a suitable implementation of the\n * {@link java.lang.Object#hashCode()} method.\n * <p>\n * Although recommended, implementations are not required to call either the\n * Object.hashCode or Object.equals methods defined by custom key classes.\n * Implementations are free to use optimizations whereby the invocation of these\n * methods is avoided.\n * <p>\n * As this specification does not define the concept of object equivalence it\n * should be noted applications that make use of custom key classes and rely on\n * implementation specific optimizations to determine equivalence may not be\n * portable.</li>\n * </ul>\n * Unlike {@link java.util.Map}-based data-structures:\n * <ul>\n * <li>{@link javax.cache.Cache} keys and values must not be null.</li>\n * <li>Any attempt to use null for keys or values will result in a\n * {@link java.lang.NullPointerException} being thrown, regardless of the use.</li>\n * <li>Entries may expire.</li>\n * <li>Entries may be evicted.</li>\n * <li>To support the compare-and-swap (CAS) operations, those that atomically\n * compare and exchange values, custom value classes should provide a suitable\n * implementation of {@link java.lang.Object#equals}.\n * <p>\n * Although recommended, implementations are not required to call the\n * {@link java.lang.Object#equals} method defined by custom value classes.\n * Implementations are free to implement optimizations whereby the invocation\n * of this method is avoided. </li>\n * <li>Implementations may require Keys and Values to be serializable in some\n * manner.</li>\n * <li>{@link javax.cache.Cache}s may be configured to control how entries are stored,\n * either using\n * store-by-value or optionally using store-by-reference semantics.</li>\n * <li> Implementations may optionally enforce security restrictions. In case of a\n * violation, a {@link java.lang.SecurityException} must be thrown.</li>\n * </ul>\n * <h1>Consistency</h1>\n * Consistency refers to the behavior of caches and the guarantees that exist when\n * concurrent cache mutation occur together with the visibility of the mutations\n * when multiple threads are accessing a cache.\n * <p>\n * All implementations must support the Default Consistency model as outlined\n * below.\n * <h2>Default Consistency</h2>\n * When using the default consistency mode, most {@link javax.cache.Cache} operations\n * are performed as if a locking mechanism exists for each key in a\n * {@link javax.cache.Cache}. When a cache operation acquires an exclusive read and\n * write lock on a key all subsequent operations on that key will block until that\n * lock is released. The consequences are that operations performed by a thread\n * happen-before read or mutation operations performed by another thread, including\n * threads in different Java Virtual Machines.\n * <p>\n * For some {@link javax.cache.Cache} operations the value returned by a\n * {@link javax.cache.Cache} is considered the last value. The last value might be an\n * old value or a new value, especially in the case where an entry is concurrently being\n * updated. It is implementation dependent which is returned.\n * <p>\n * Other operations follow a different convention in that mutations may only occur\n * when the current state of an entry matches a desired state. In such operations\n * multiple threads are free to compete to apply these changes i.e. as if they\n * share a lock.\n * <p>\n * As these methods must interact with other {@link javax.cache.Cache} operations\n * acting as if they had an exclusive lock, the CAS methods cannot write new values\n * without acting as if they also had an exclusive lock.\n * <p>\n * See the JCache Specification for further details.\n * <h2>Further Consistency Models</h2>\n * An implementation may provide support for different consistency models in\n * addition to the required <em>Default Consistency</em> mode\n * <h1>A Simple Example</h1>\n * <p>This simple example creates a default {@link javax.cache.CacheManager},\n * configures a {@link javax.cache.Cache} on it called “simpleCache” with a key type\n * of String and a value type of Integer and an expiry of one hour and then performs\n * a some cache operations.\n * </p>\n * <pre><code>\n * //resolve a cache manager\n * CachingProvider cachingProvider = Caching.getCachingProvider();\n * CacheManager cacheManager = cachingProvider.getCacheManager();\n *\n * //configure the cache\n * MutableConfiguration&lt;String, Integer&gt; config =\n *    new MutableConfiguration&lt;&gt;()\n *    .setTypes(String.class, Integer.class)\n *    .setExpiryPolicyFactory(AccessedExpiryPolicy.factoryOf(ONE_HOUR))\n *    .setStatisticsEnabled(true);\n *\n * //create the cache\n * Cache&lt;String, Integer&gt; cache = cacheManager.createCache(\"simpleCache\", config);\n *\n * //cache operations\n * String key = \"key\";\n * Integer value1 = 1;\n * cache.put(\"key\", value1);\n * Integer value2 = cache.get(key);\n * cache.remove(key);\n * </code></pre>\n *\n * @author Greg Luck\n * @since 1.0\n */\npackage javax.cache;\n"
  },
  {
    "path": "src/main/java/javax/cache/processor/EntryProcessor.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache.processor;\n\nimport javax.cache.Cache;\nimport javax.cache.event.CacheEntryListener;\nimport javax.cache.expiry.ExpiryPolicy;\nimport javax.cache.integration.CacheWriter;\n\n\n/**\n * An invocable function that allows applications to perform compound operations\n * on a {@link javax.cache.Cache.Entry} atomically, according to the defined\n * consistency of a {@link Cache}.\n * <p>\n * Any {@link javax.cache.Cache.Entry} mutations will not take effect until after\n * the {@link EntryProcessor#process(MutableEntry, Object...)} method has completed\n * execution.\n * <p>\n * If an exception is thrown by an {@link EntryProcessor}, a Caching Implementation\n * must wrap any {@link Exception} thrown wrapped in an {@link\n * EntryProcessorException}. If this occurs no mutations will be made to the\n * {@link javax.cache.Cache.Entry}.\n * <p>\n * Implementations may execute {@link EntryProcessor}s in situ, thus avoiding\n * locking, round-trips and expensive network transfers.\n * \n * <h3>Effect of {@link MutableEntry} operations</h3>\n * {@link javax.cache.Cache.Entry} access, via a call to\n * {@link javax.cache.Cache.Entry#getValue()}, will behave as if\n * {@link Cache#get(Object)} was called for the key.  This includes updating\n * necessary statistics, consulting the configured {@link ExpiryPolicy} and loading\n * from a configured {@link javax.cache.integration.CacheLoader}.\n * <p>\n * {@link javax.cache.Cache.Entry} mutation, via a call to\n * {@link MutableEntry#setValue(Object)}, will behave as if {@link\n * Cache#put(Object, Object)} was called for the key. This includes updating\n * necessary statistics, consulting the configured {@link\n * ExpiryPolicy}, notifying {@link CacheEntryListener}s and writing to a\n * configured {@link CacheWriter}.\n * <p>\n * {@link javax.cache.Cache.Entry} removal, via a call to\n * {@link MutableEntry#remove()}, will behave as if {@link Cache#remove(Object)}\n * was called for the key. This includes updating necessary statistics, notifying\n * {@link CacheEntryListener}s and causing a delete on a configured\n * {@link CacheWriter}.\n * <p>\n * As implementations may choose to execute {@link EntryProcessor}s remotely,\n * {@link EntryProcessor}s, together with specified parameters and return\n * values, may be required to implement {@link java.io.Serializable}.\n * \n * <h3>Effect of multiple {@link MutableEntry} operations performed by one {@link\n * EntryProcessor}</h3>\n * Only the net effect of multiple operations has visibility outside of the Entry\n * Processor. The entry is locked by the entry processor for the entire scope\n * of the entry processor, so intermediate effects are not visible.\n * <h4>Example 1</h4>\n * In this example, an {@link EntryProcessor} calls:\n * <ol>\n * <li>{@link MutableEntry#getValue()}</li>\n * <li>{@link MutableEntry#setValue(Object)}</li>\n * <li>{@link MutableEntry#getValue()}</li>\n * <li>{@link MutableEntry#setValue(Object)}</li>\n * </ol>\n * This will have the following {@link Cache} effects:\n * <br>\n * Final value of the cache: last setValue<br>\n * Statistics: one get and one put as the second get and the first put are\n * internal to the EntryProcessor.<br>\n * Listeners: second put will cause either a put or an update depending on whether\n * there was an initial value for the entry.<br>\n * CacheLoader: Invoked by the first get only if the entry is not present, a\n * loader was registered and read through is enabled.<br>\n * CacheWriter: Invoked by the second put only as the first put was internal to\n * the Entry Processor.<br>\n * ExpiryPolicy: The first get and the second put only are visible to the\n * ExpiryPolicy.<br>\n * \n * <h4>Example 2</h4>\n * In this example, an {@link EntryProcessor} calls:\n * <ol>\n * <li>{@link MutableEntry#getValue()}</li>\n * <li>{@link MutableEntry#remove()}}</li>\n * <li>{@link MutableEntry#getValue()}</li>\n * <li>{@link MutableEntry#setValue(Object)}</li>\n * </ol>\n * This will have the following {@link Cache} effects:\n * <br>\n * Final value of the cache: last setValue<br>\n * Statistics: one get and one put as the second get and the first put are\n * internal to the EntryProcessor.<br>\n * Listeners: second put will cause either a put or an update depending on whether\n * there was an initial value for the entry.<br>\n * CacheLoader: Invoked by the first get only if the entry is not present, a loader\n * was registered and read through is enabled.<br>\n * CacheWriter: Invoked by the second put only as the first put was internal to\n * the Entry Processor.<br>\n * ExpiryPolicy: The first get and the second put only are visible to the\n * ExpiryPolicy.<br>\n * \n * <h4>Example 3</h4>\n * In this example, an {@link EntryProcessor} calls:\n * <ol>\n * <li>{@link MutableEntry#getValue()}</li>\n * <li>{@link MutableEntry#setValue(Object)}}</li>\n * <li>{@link MutableEntry#getValue()}</li>\n * <li>{@link MutableEntry#setValue(Object)}</li>\n * <li>{@link MutableEntry#remove()}</li>\n * </ol>\n * This will have the following {@link Cache} effects:\n * <br>\n * Final value of the cache: the entry is removed if it was present<br>\n * Statistics: one get and one remove as the second get and the two puts are\n * internal to the EntryProcessor.<br>\n * Listeners: remove if there was initial value in the cache, otherwise no\n * listener invoked.\n * <br> CacheLoader: Invoked by the first get only if the entry is not present,\n * a loader was registered and read through is enabled.\n * <br> CacheWriter: Invoked by the remove only as the two puts are internal to\n * the Entry Processor, provided that the first #getValue was non-null.<br>\n * ExpiryPolicy: The first get only is visible to the ExpiryPolicy. There is no\n * remove event in ExpiryPolicy.\n *\n * @param <K> the type of keys maintained by this cache\n * @param <V> the type of cached values\n * @param <T> the type of the return value\n * @author Greg Luck\n * @since 1.0\n */\npublic interface EntryProcessor<K, V, T> {\n\n  /**\n   * Process an entry.\n   *\n   * @param entry     the entry\n   * @param arguments a number of arguments to the process.\n   * @return the user-defined result of the processing, if any.\n   * @throws EntryProcessorException if there is a failure in entry processing.\n   */\n  T process(MutableEntry<K, V> entry, Object... arguments)\n      throws EntryProcessorException;\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/processor/EntryProcessorException.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache.processor;\n\nimport javax.cache.CacheException;\n\n/**\n * An exception to indicate a problem occurred attempting to execute an\n * {@link EntryProcessor} against an entry.\n * <p>\n * An implementation must wrap any {@link Exception} thrown by an\n * {@link EntryProcessor} in this exception.\n *\n * @author Greg Luck\n * @since 1.0\n */\npublic class EntryProcessorException extends CacheException {\n\n  private static final long serialVersionUID = 20130822110920L;\n\n\n  /**\n   * Constructs a new CacheLoaderException.\n   */\n  public EntryProcessorException() {\n    super();\n  }\n\n  /**\n   * Constructs a new CacheLoaderException with a message string.\n   *\n   * @param message the detail message. The detail message is saved for\n   *                later retrieval by the {@link #getMessage()} method.\n   */\n  public EntryProcessorException(String message) {\n    super(message);\n  }\n\n  /**\n   * Constructs a CacheLoaderException with a message string, and\n   * a base exception\n   *\n   * @param message the detail message. The detail message is saved for\n   *                later retrieval by the {@link #getMessage()} method.\n   * @param cause   the cause (that is saved for later retrieval by the\n   *                {@link #getCause()} method).  (A <tt>null</tt> value is\n   *                permitted, and indicates that the cause is nonexistent or\n   *                unknown.)\n   * @since 1.0\n   */\n  public EntryProcessorException(String message, Throwable cause) {\n    super(message, cause);\n  }\n\n\n  /**\n   * Constructs a new CacheLoaderException with the specified cause and a\n   * detail message of <tt>(cause==null ? null : cause.toString())</tt>\n   * (that typically contains the class and detail message of\n   * <tt>cause</tt>).  This constructor is useful for runtime exceptions\n   * that are little more than wrappers for other throwables.\n   *\n   * @param cause the cause (that is saved for later retrieval by the\n   *              {@link #getCause()} method).  (A <tt>null</tt> value is\n   *              permitted, and indicates that the cause is nonexistent or\n   *              unknown.)\n   * @since 1.0\n   */\n  public EntryProcessorException(Throwable cause) {\n    super(cause);\n  }\n\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/processor/EntryProcessorResult.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache.processor;\n\nimport javax.cache.CacheException;\n\n/**\n * A mechanism to represent and obtain the result of processing\n * a {@link javax.cache.Cache} entry using an {@link EntryProcessor}.\n *\n * @param <T> the type of the return value\n *\n * @author Brian Oliver\n * @since 1.0\n */\npublic interface EntryProcessorResult<T> {\n  /**\n   * Obtain the result of processing an entry with an {@link EntryProcessor}.\n   * <p>\n   * If an exception was thrown during the processing of an entry, either by\n   * the {@link EntryProcessor} itself or by the Caching implementation,\n   * the exceptions will be wrapped and re-thrown as a\n   * {@link EntryProcessorException} when calling this method.\n   *\n   * @return  the result of processing\n   *\n   * @throws CacheException           if the implementation failed to execute\n   *                                  the {@link EntryProcessor}\n   * @throws EntryProcessorException  if the {@link EntryProcessor} raised\n   *                                  an exception, this exception will be\n   *                                  used to wrap the causing exception\n   */\n  T get() throws EntryProcessorException;\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/processor/MutableEntry.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache.processor;\n\nimport javax.cache.Cache;\nimport javax.cache.integration.CacheLoader;\n\n/**\n * A mutable representation of a {@link javax.cache.Cache.Entry}.\n * <p>\n * Mutable entries are used by {@link EntryProcessor}s to mutate\n * {@link Cache.Entry}s in place, atomically.\n *\n * @param <K> the type of key\n * @param <V> the type of value\n *\n * @author Greg Luck\n * @since 1.0\n * @see EntryProcessor\n */\npublic interface MutableEntry<K, V> extends Cache.Entry<K, V> {\n\n  /**\n   * Checks for the existence of the entry in the cache\n   *\n   * @return true if the entry exists\n   */\n  boolean exists();\n\n  /**\n   * Removes the entry from the Cache.\n   * <p>\n   * This has the same semantics as calling {@link Cache#remove}.\n   */\n  void remove();\n\n  /**\n   * Returns the value stored in the cache.\n   * <p>\n   * If the cache is configured to use read-through, and this method\n   * would return null because the entry is missing from the cache,\n   * the Cache's {@link CacheLoader} is called in an attempt to load\n   * the entry.\n   *\n   * @return the value corresponding to this entry\n   */\n  V getValue();\n\n  /**\n   * Sets or replaces the value associated with the key.\n   * <p>\n   * If {@link #exists} is false and setValue is called\n   * then a mapping is added to the cache visible once the EntryProcessor\n   * completes. Moreover a second invocation of {@link #exists()}\n   * will return true.\n   *\n   * @param value the value to update the entry with\n   * @throws ClassCastException if the implementation supports and is\n   *                            configured to perform runtime-type-checking,\n   *                            and value type is incompatible with that\n   *                            which has been configured for the\n   *                            {@link Cache}\n   */\n  void setValue(V value);\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/processor/package-info.java",
    "content": "/**\n *  Copyright (c) 2011-2013 Terracotta, Inc.\n *  Copyright (c) 2011-2013 Oracle and/or its affiliates.\n *\n *  All rights reserved. Use is subject to license terms.\n */\n\n/**\n * This package contains the API for Entry Processors.\n * <p>\n * Implementations may optionally enforce security restrictions. In case of a\n * violation, a {@link java.lang.SecurityException} must be thrown.\n *\n * @author Greg Luck\n * @since 1.0\n */\npackage javax.cache.processor;\n"
  },
  {
    "path": "src/main/java/javax/cache/spi/CachingProvider.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage javax.cache.spi;\n\nimport javax.cache.CacheException;\nimport javax.cache.CacheManager;\nimport javax.cache.configuration.OptionalFeature;\nimport java.io.Closeable;\nimport java.net.URI;\nimport java.util.Properties;\n\n/**\n * Provides mechanisms to create, request and later manage the life-cycle of\n * configured {@link CacheManager}s, identified by {@link URI}s and scoped by\n * {@link ClassLoader}s.\n * <p>\n * The meaning and semantics of the {@link URI} used to identify a\n * {@link CacheManager} is implementation dependent.  For applications to remain\n * implementation independent, they should avoid attempting to create {@link URI}s\n * and instead use those returned by {@link #getDefaultURI()}.\n *\n * @author Brian Oliver\n * @author Greg Luck\n * @since 1.0\n */\npublic interface CachingProvider extends Closeable {\n\n  /**\n   * Requests a {@link CacheManager} configured according to the implementation\n   * specific {@link URI} be made available that uses the provided\n   * {@link ClassLoader} for loading underlying classes.\n   * <p>\n   * Multiple calls to this method with the same {@link URI} and\n   * {@link ClassLoader} must return the same {@link CacheManager} instance,\n   * except if a previously returned {@link CacheManager} has been closed.\n   * <p>\n   * Properties are used in construction of a {@link CacheManager} and do not form\n   * part of the identity of the CacheManager. i.e. if a second call is made to\n   * with the same {@link URI} and {@link ClassLoader} but different properties,\n   * the {@link CacheManager} created in the first call is returned.\n   * <p>\n   * Properties names follow the same scheme as package names.\n   * The prefixes {@code java} and {@code javax} are reserved.\n   * Properties are passed through and can be retrieved via\n   * {@link CacheManager#getProperties()}.\n   * Properties within the package scope of a caching implementation may be used for\n   * additional configuration.\n   *\n   * @param uri         an implementation specific URI for the\n   *                    {@link CacheManager} (null means use\n   *                    {@link #getDefaultURI()})\n   * @param classLoader the {@link ClassLoader}  to use for the\n   *                    {@link CacheManager} (null means use\n   *                    {@link #getDefaultClassLoader()})\n   * @param properties  the {@link Properties} for the {@link CachingProvider}\n   *                    to create the {@link CacheManager} (null means no\n   *                    implementation specific Properties are required)\n   * @throws CacheException    when a {@link CacheManager} for the\n   *                           specified arguments could not be produced\n   * @throws SecurityException when the operation could not be performed\n   *                           due to the current security settings\n   */\n  CacheManager getCacheManager(URI uri, ClassLoader classLoader,\n                               Properties properties);\n\n  /**\n   * Obtains the default {@link ClassLoader} that will be used by the\n   * {@link CachingProvider}.\n   *\n   * @return the default {@link ClassLoader} used by the {@link CachingProvider}\n   */\n  ClassLoader getDefaultClassLoader();\n\n  /**\n   * Obtains the default {@link URI} for the {@link CachingProvider}.\n   * <p>\n   * Use this method to obtain a suitable {@link URI} for the\n   * {@link CachingProvider}.\n   *\n   * @return the default {@link URI} for the {@link CachingProvider}\n   */\n  URI getDefaultURI();\n\n  /**\n   * Obtains the default {@link Properties} for the {@link CachingProvider}.\n   * <p>\n   * Use this method to obtain suitable {@link Properties} for the\n   * {@link CachingProvider}.\n   *\n   * @return the default {@link Properties} for the {@link CachingProvider}\n   */\n  Properties getDefaultProperties();\n\n  /**\n   * Requests a {@link CacheManager} configured according to the implementation\n   * specific {@link URI} that uses the provided {@link ClassLoader} for loading\n   * underlying classes.\n   * <p>\n   * Multiple calls to this method with the same {@link URI} and\n   * {@link ClassLoader} must return the same {@link CacheManager} instance,\n   * except if a previously returned {@link CacheManager} has been closed.\n   *\n   * @param uri         an implementation specific {@link URI} for the\n   *                    {@link CacheManager} (null means\n   *                    use {@link #getDefaultURI()})\n   * @param classLoader the {@link ClassLoader}  to use for the\n   *                    {@link CacheManager} (null means\n   *                    use {@link #getDefaultClassLoader()})\n   * @throws CacheException    when a {@link CacheManager} for the\n   *                           specified arguments could not be produced\n   * @throws SecurityException when the operation could not be performed\n   *                           due to the current security settings\n   */\n  CacheManager getCacheManager(URI uri, ClassLoader classLoader);\n\n  /**\n   * Requests a {@link CacheManager} configured according to the\n   * {@link #getDefaultURI()} and {@link #getDefaultProperties()} be made\n   * available that using the {@link #getDefaultClassLoader()} for loading\n   * underlying classes.\n   * <p>\n   * Multiple calls to this method must return the same {@link CacheManager}\n   * instance, except if a previously returned {@link CacheManager} has been\n   * closed.\n   *\n   * @throws SecurityException when the operation could not be performed\n   *                           due to the current security settings\n   */\n  CacheManager getCacheManager();\n\n  /**\n   * Closes all of the {@link CacheManager} instances and associated resources\n   * created and maintained by the {@link CachingProvider} across all\n   * {@link ClassLoader}s.\n   * <p>\n   * After closing the {@link CachingProvider} will still be operational.  It\n   * may still be used for acquiring {@link CacheManager} instances, though\n   * those will now be new.\n   *\n   * @throws SecurityException when the operation could not be performed\n   *                           due to the current security settings\n   */\n  void close();\n\n  /**\n   * Closes all {@link CacheManager} instances and associated resources created\n   * by the {@link CachingProvider} using the specified {@link ClassLoader}.\n   * <p>\n   * After closing the {@link CachingProvider} will still be operational.  It\n   * may still be used for acquiring {@link CacheManager} instances, though\n   * those will now be new for the specified {@link ClassLoader} .\n   *\n   * @param classLoader the {@link ClassLoader}  to release\n   * @throws SecurityException when the operation could not be performed\n   *                           due to the current security settings\n   */\n  void close(ClassLoader classLoader);\n\n  /**\n   * Closes all {@link CacheManager} instances and associated resources created\n   * by the {@link CachingProvider} for the specified {@link URI} and\n   * {@link ClassLoader}.\n   *\n   * @param uri         the {@link URI} to release\n   * @param classLoader the {@link ClassLoader}  to release\n   * @throws SecurityException when the operation could not be performed\n   *                           due to the current security settings\n   */\n  void close(URI uri, ClassLoader classLoader);\n\n  /**\n   * Determines whether an optional feature is supported by the\n   * {@link CachingProvider}.\n   *\n   * @param optionalFeature the feature to check for\n   * @return true if the feature is supported\n   */\n  boolean isSupported(OptionalFeature optionalFeature);\n}\n"
  },
  {
    "path": "src/main/java/javax/cache/spi/package-info.java",
    "content": "/**\n * Copyright 2011-2016 Terracotta, Inc.\n * Copyright 2011-2016 Oracle America Incorporated\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n The javax.cache.spi package defines the classes and interfaces that are implemented by the\n caching provider for use by the {@link javax.cache.Caching} class\n\n @author Yannis Cosmadopoulos\n @since 1.0\n */\npackage javax.cache.spi;\n"
  }
]