-
Notifications
You must be signed in to change notification settings - Fork 568
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
4.x: archetypes - add coherence caching option (#9824)
- Loading branch information
Showing
20 changed files
with
584 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
...pes/archetypes/src/main/archetype/common/files/README.coherence.exercise.app.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
```shell | ||
curl -X POST -H "Content-Type: application/json" \ | ||
-d '{"ssn" : "123-45-6789", "firstName" : "Frank", "lastName" : "Helidon", "dateOfBirth" : "02/14/2019"}' \ | ||
http://localhost:8080/creditscore | ||
``` | ||
|
||
You'll notice a short delay as the application computes the credit score. | ||
Now repeat the same request. You'll see the score is returned instantly as it is retrieved from the cache. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
archetypes/archetypes/src/main/archetype/mp/custom/coherence-output.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (c) 2025 Oracle and/or its affiliates. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
--> | ||
<archetype-script xmlns="https://helidon.io/archetype/2.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="https://helidon.io/archetype/2.0 https://helidon.io/xsd/archetype-2.0.xsd"> | ||
|
||
<output> | ||
<templates transformations="mustache,packaged" engine="mustache"> | ||
<directory>files</directory> | ||
<includes> | ||
<include>src/main/java/__pkg__/CoherenceResource.java.mustache</include> | ||
<include>src/main/java/__pkg__/Person.java.mustache</include> | ||
<include>src/test/java/__pkg__/CoherenceResourceTest.java.mustache</include> | ||
</includes> | ||
</templates> | ||
<model> | ||
<list key="pom-properties"> | ||
<map> | ||
<value key="key">version.lib.coherence</value> | ||
<value key="value">24.03.1</value> | ||
</map> | ||
</list> | ||
<list key="dependencies-management"> | ||
<map> | ||
<value key="groupId">com.oracle.coherence.ce</value> | ||
<value key="artifactId">coherence-bom</value> | ||
<!-- Using template to skip variable resolution --> | ||
<value key="version" template="mustache">${version.lib.coherence}</value> | ||
<value key="type">pom</value> | ||
<value key="scope">import</value> | ||
</map> | ||
</list> | ||
<list key="dependencies"> | ||
<map> | ||
<value key="groupId">com.oracle.coherence.ce</value> | ||
<value key="artifactId">coherence-cdi-server</value> | ||
</map> | ||
<map> | ||
<value key="groupId">com.oracle.coherence.ce</value> | ||
<value key="artifactId">coherence-mp-config</value> | ||
<value key="scope">runtime</value> | ||
</map> | ||
<map> | ||
<value key="groupId">org.glassfish.jersey.media</value> | ||
<value key="artifactId">jersey-media-json-binding</value> | ||
<value key="scope">runtime</value> | ||
</map> | ||
</list> | ||
<list key="module-requires" if="${jpms}"> | ||
<value>com.oracle.coherence</value> | ||
<value>com.oracle.coherence.cdi</value> | ||
</list> | ||
<list key="microprofile-config-entries"> | ||
<value file="files/src/main/resources/META-INF/microprofile-config-coherence.properties.mustache"/> | ||
</list> | ||
</model> | ||
</output> | ||
</archetype-script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.