Skip to content

Commit

Permalink
Quarkus Embedded Docs (#10746)
Browse files Browse the repository at this point in the history
ISPN-14584 Add Infinispan Quarkus Embedded documentation
  • Loading branch information
ryanemerson committed Apr 21, 2023
1 parent 2ebd6c5 commit 6685830
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 0 deletions.
5 changes: 5 additions & 0 deletions build/bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,11 @@
<artifactId>infinispan-anchored-keys</artifactId>
<version>${version.infinispan}</version>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-quarkus-embedded</artifactId>
<version>${version.infinispan}</version>
</dependency>
<dependency>
<groupId>org.infinispan.protostream</groupId>
<artifactId>protostream</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[id='quarkus_embedded']
:context: quarkus
= Using the Quarkus extension
{brandname} provides an extension that integrates with the Quarkus framework.
The extension lets you create natively compiled {brandname} applications.

include::{topics}/ref_quarkus_dependencies.adoc[leveloffset=+1]
include::{topics}/proc_quarkus_injecting_embedded.adoc[leveloffset=+1]
include::{topics}/proc_quarkus_native_compilation.adoc[leveloffset=+1]

// Restore the parent context.
ifdef::parent-context[:context: {parent-context}]
ifndef::parent-context[:!context:]
3 changes: 3 additions & 0 deletions documentation/src/main/asciidoc/titles/embedding/stories.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ include::{stories}/assembly_setting_up_clusters.adoc[leveloffset=+1]
include::{stories}/assembly_clustered_locks.adoc[leveloffset=+1]
include::{stories}/assembly_cluster_executor.adoc[leveloffset=+1]
include::{stories}/assembly_streams.adoc[leveloffset=+1]
ifdef::community[]
include::{stories}/assembly_quarkus_embedded.adoc[leveloffset=+1]
endif::community[]
include::{stories}/assembly_cdi.adoc[leveloffset=+1]
include::{stories}/assembly_multimap_cache.adoc[leveloffset=+1]
//Community content
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-quarkus-embedded</artifactId>
</dependency>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[id='quarkus_inject_embedded']
= Injecting Embedded Caches
Inject a `EmbeddedCacheManager` instance into your Quarkus application to interact with {brandname} caches..

.Procedure

. Optional: Use the `quarkus.infinispan-embedded.xml-config` property to set the path to an XML file that includes the configuration of the injected instance.
+
[source,java]
----
quarkus.infinispan-embedded.xml-config=/example/path/to/config.xml
----
. Add the `@Inject` annotation to an uninitialized `EmbeddedCacheManager` class variable.
+
[source,java]
----
import javax.inject.Inject;
import org.infinispan.manager.EmbeddedCacheManager;
...
@Path("/example")
public class ExampleResource {
@Inject
EmbeddedCacheManager emc;
}
----
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[id='quarkus_native_compilation']
= Compiling Quarkus {brandname} application
Generate a native executable for Quarkus {brandname} application.

.Prerequisites

* Have a Quarkus based project. For a complete list of prerequisites, see link:https://quarkus.io/guides/building-native-image#prerequisites[Quarkus native prerequisites].

.Procedure
* Natively compile your Quarkus {brandname} application:
+
[source]
----
mvn clean package -Pnative
----
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[id='quarkus_embedded_dependencies']
= Quarkus dependencies
Include the {brandname} Quarkus extension in your `pom.xml`:

.Embedded mode
----
include::dependencies_maven/cdi_embedded_quarkus.xml[]
----

0 comments on commit 6685830

Please sign in to comment.