Skip to content

Commit

Permalink
Infinispan Client: add deployment SPI module
Browse files Browse the repository at this point in the history
Two build items, `InfinispanClientBuildItem` and `InfinispanClientNameBuildItem`,
are moved from the Infinispan Client deployment module to the deployment SPI
module. This is technically a breaking change, because they are also moved
to a different package, but these build items don't seem to be used anywhere
outside of Quarkus, so it should be safe.
  • Loading branch information
Ladicek committed Oct 11, 2023
1 parent eb1e80d commit 31d5e45
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 10 deletions.
5 changes: 5 additions & 0 deletions bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1213,6 +1213,11 @@
<artifactId>quarkus-infinispan-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-infinispan-client-deployment-spi</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-infinispan-client-deployment</artifactId>
Expand Down
26 changes: 26 additions & 0 deletions extensions/infinispan-client/deployment-spi/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>quarkus-infinispan-client-parent</artifactId>
<groupId>io.quarkus</groupId>
<version>999-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>quarkus-infinispan-client-deployment-spi</artifactId>
<name>Quarkus - Infinispan - Client - Deployment SPI</name>

<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-core-deployment</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-infinispan-client</artifactId>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.quarkus.infinispan.client.deployment;
package io.quarkus.infinispan.client.deployment.spi;

import org.infinispan.client.hotrod.RemoteCacheManager;

Expand All @@ -12,8 +12,7 @@ public final class InfinispanClientBuildItem extends MultiBuildItem {
private final RuntimeValue<RemoteCacheManager> client;
private final String name;

public InfinispanClientBuildItem(RuntimeValue<RemoteCacheManager> client,
String name) {
public InfinispanClientBuildItem(RuntimeValue<RemoteCacheManager> client, String name) {
this.client = client;
this.name = name;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.quarkus.infinispan.client.deployment;
package io.quarkus.infinispan.client.deployment.spi;

import io.quarkus.builder.item.MultiBuildItem;

Expand Down
4 changes: 4 additions & 0 deletions extensions/infinispan-client/deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-infinispan-client</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-infinispan-client-deployment-spi</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-caffeine-deployment</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.infinispan.client.deployment.spi.InfinispanClientBuildItem;
import io.quarkus.infinispan.client.runtime.InfinispanClientUtil;
import io.quarkus.kubernetes.service.binding.spi.ServiceBindingQualifierBuildItem;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@
import io.quarkus.deployment.pkg.steps.NativeOrNativeSourcesBuild;
import io.quarkus.infinispan.client.InfinispanClientName;
import io.quarkus.infinispan.client.Remote;
import io.quarkus.infinispan.client.deployment.spi.InfinispanClientBuildItem;
import io.quarkus.infinispan.client.deployment.spi.InfinispanClientNameBuildItem;
import io.quarkus.infinispan.client.runtime.InfinispanClientBuildTimeConfig;
import io.quarkus.infinispan.client.runtime.InfinispanClientProducer;
import io.quarkus.infinispan.client.runtime.InfinispanClientUtil;
Expand Down Expand Up @@ -623,9 +625,9 @@ List<InfinispanClientBuildItem> infinispanClients(InfinispanRecorder recorder,
List<InfinispanClientNameBuildItem> infinispanClientNames,
// make sure all beans have been initialized
@SuppressWarnings("unused") BeanContainerBuildItem beanContainer) {
List<InfinispanClientBuildItem> result = new ArrayList<>(infinispanClientNames.size());
for (InfinispanClientNameBuildItem ic : infinispanClientNames) {
String name = ic.getName();
Set<String> names = infinispanClientNames.stream().map(icn -> icn.getName()).collect(Collectors.toSet());
List<InfinispanClientBuildItem> result = new ArrayList<>(names.size());
for (String name : names) {
result.add(new InfinispanClientBuildItem(recorder.getClient(name), name));
}
return result;
Expand Down
1 change: 1 addition & 0 deletions extensions/infinispan-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<packaging>pom</packaging>
<modules>
<module>deployment</module>
<module>deployment-spi</module>
<module>runtime</module>
</modules>
</project>
4 changes: 1 addition & 3 deletions extensions/infinispan-client/runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,7 @@
</exclusion>
<exclusion>
<groupId>org.jboss.spec.javax.transaction</groupId>
<artifactId>
jboss-transaction-api_1.2_spec
</artifactId>
<artifactId>jboss-transaction-api_1.2_spec</artifactId>
</exclusion>
<exclusion>
<groupId>io.netty</groupId>
Expand Down

0 comments on commit 31d5e45

Please sign in to comment.