Skip to content

Commit

Permalink
ISPN-14584 Add Infinispan Quarkus Embedded documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanemerson committed Mar 29, 2023
1 parent 7977a64 commit 225b641
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[id='quarkus_embedded']
:context: quarkus
= Using the Quarkus Extension
{brandname} provides an extension that integrates with the Quarkus framework and allows you to:

* Create a natively compiled Infinispan application
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:]
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ 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]
include::{stories}/assembly_quarkus_embedded.adoc[leveloffset=+1]
include::{stories}/assembly_cdi.adoc[leveloffset=+1]
include::{stories}/assembly_jcache.adoc[leveloffset=+1]
include::{stories}/assembly_multimap_cache.adoc[leveloffset=+1]
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.

.Procedure

. Optionally define the `quarkus.infinispan-embedded.xml-config` with the path of a xml file that's used to configure 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,11 @@
[id='quarkus_native_compilation']
= Native Compilation
Natively compile your Quarkus {brandname} application

.Prerequisites

* Ensure all https://quarkus.io/guides/building-native-image#prerequisites[Quarkus native prerequisites] are satisfied

.Procedure

. `mvn clean package -Pnative`
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[id='quarkus_embedded_dependencies']
= Quarkus Dependencies
Update your `pom.xml` with one of the following dependencies to include the
{brandname} Quarkus extension in your project:

.Embedded (Library) Mode
----
include::dependencies_maven/cdi_embedded_quarkus.xml[]
----

0 comments on commit 225b641

Please sign in to comment.