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
dependencies { | |
annotationProcessor "io.micronaut:micronaut-inject-java:3.1.0" | |
annotationProcessor "io.micronaut:micronaut-validation:3.1.0" | |
annotationProcessor "io.micronaut.coherence:micronaut-coherence-data:3.0.1" | |
compile "com.oracle.coherence.ce:coherence:21.06.2" | |
compile "io.micronaut.coherence:micronaut-coherence:3.0.1" | |
compile "io.micronaut.coherence:micronaut-coherence-data:3.0.1" | |
compile "jakarta.inject:jakarta.inject-api:2.0.0" | |
compile "javax.inject:javax.inject:1" |
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
curl -i -X GET -H "Accept: application/json" http://localhost:3000/api/tasks |
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
curl -i -X POST -H "Content-Type: application/json" \ | |
-d '{"description": "Learn Coherence"}' http://localhost:3000/api/task | |
curl -i -X POST -H "Content-Type: application/json" \ | |
-d '{"description": "Write an article"}' http://localhost:3000/api/tasks |
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
package com.oracle.coherence.examples.todo.server; | |
import io.micronaut.coherence.data.AbstractCoherenceRepository; | |
import io.micronaut.coherence.data.annotation.CoherenceRepository; | |
import java.util.Collection; | |
/** | |
* A {@code Coherence}-base {@code Micronaut Data} repository for working with {@link Task tasks}. | |
*/ | |
@CoherenceRepository("task") |
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
@Get | |
@Produces(APPLICATION_JSON) | |
public Collection<Task> getTasks(@Nullable @QueryValue(value = "completed") Boolean completed) | |
{ | |
return completed == null | |
? tasks.getAll() | |
: tasks.findByCompleted(completed); | |
} |
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
package com.oracle.coherence.examples.todo.server; | |
import io.micronaut.coherence.data.AbstractCoherenceRepository; | |
import io.micronaut.coherence.data.annotation.CoherenceRepository; | |
import java.util.Collection; | |
/** | |
* A {@code Coherence}-base {@code Micronaut Data} repository for working with {@link Task tasks}. | |
*/ | |
@CoherenceRepository("task") |
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
/* | |
* Copyright (c) 2021 Oracle and/or its affiliates. | |
* Licensed under the Universal Permissive License v 1.0 as shown at | |
* https://oss.oracle.com/licenses/upl. | |
*/ | |
plugins { | |
id 'application' | |
id 'java' | |
id "com.github.johnrengelman.shadow" version "4.0.2" |
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
coherence: | |
cluster: test-cluster | |
role: test | |
ttl: 0 | |
distributed: | |
localstorage: true | |
sessions: | |
mysession: | |
name: mysession | |
config: coherence-cache-config.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
micronaut: | |
application: | |
name: todo-list-micronaut-server | |
server: | |
port: 3000 | |
router: | |
static-resources: | |
default: | |
enabled: true | |
mapping: "/**" |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xmlns="http://maven.apache.org/POM/4.0.0" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<parent> | |
<groupId>io.micronaut</groupId> | |
<artifactId>micronaut-parent</artifactId> | |
<version>3.0.1</version> <!-- Micronaut version this example uses --> |