forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Amazon Services - Fix class loading issues by separating recorders
Fixes quarkusio#15014
- Loading branch information
Showing
18 changed files
with
782 additions
and
429 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
34 changes: 34 additions & 0 deletions
34
...rc/main/java/io/quarkus/amazon/common/deployment/AmazonClientAsyncTransportBuildItem.java
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,34 @@ | ||
package io.quarkus.amazon.common.deployment; | ||
|
||
import org.jboss.jandex.DotName; | ||
|
||
import io.quarkus.builder.item.MultiBuildItem; | ||
import io.quarkus.runtime.RuntimeValue; | ||
import software.amazon.awssdk.http.async.SdkAsyncHttpClient; | ||
|
||
public final class AmazonClientAsyncTransportBuildItem extends MultiBuildItem { | ||
|
||
private final String awsClientName; | ||
private final DotName className; | ||
private final RuntimeValue<SdkAsyncHttpClient.Builder> clientBuilder; | ||
|
||
public AmazonClientAsyncTransportBuildItem(String awsClientName, | ||
DotName className, | ||
RuntimeValue<SdkAsyncHttpClient.Builder> clientBuilder) { | ||
this.awsClientName = awsClientName; | ||
this.className = className; | ||
this.clientBuilder = clientBuilder; | ||
} | ||
|
||
public String getAwsClientName() { | ||
return awsClientName; | ||
} | ||
|
||
public DotName getClassName() { | ||
return className; | ||
} | ||
|
||
public RuntimeValue<SdkAsyncHttpClient.Builder> getClientBuilder() { | ||
return clientBuilder; | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
...src/main/java/io/quarkus/amazon/common/deployment/AmazonClientSyncTransportBuildItem.java
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,34 @@ | ||
package io.quarkus.amazon.common.deployment; | ||
|
||
import org.jboss.jandex.DotName; | ||
|
||
import io.quarkus.builder.item.MultiBuildItem; | ||
import io.quarkus.runtime.RuntimeValue; | ||
import software.amazon.awssdk.http.SdkHttpClient; | ||
|
||
public final class AmazonClientSyncTransportBuildItem extends MultiBuildItem { | ||
|
||
private final String awsClientName; | ||
private final DotName className; | ||
private final RuntimeValue<SdkHttpClient.Builder> clientBuilder; | ||
|
||
public AmazonClientSyncTransportBuildItem(String awsClientName, | ||
DotName className, | ||
RuntimeValue<SdkHttpClient.Builder> clientBuilder) { | ||
this.awsClientName = awsClientName; | ||
this.className = className; | ||
this.clientBuilder = clientBuilder; | ||
} | ||
|
||
public String getAwsClientName() { | ||
return awsClientName; | ||
} | ||
|
||
public DotName getClassName() { | ||
return className; | ||
} | ||
|
||
public RuntimeValue<SdkHttpClient.Builder> getClientBuilder() { | ||
return clientBuilder; | ||
} | ||
} |
51 changes: 0 additions & 51 deletions
51
...nt/src/main/java/io/quarkus/amazon/common/deployment/AmazonClientTransportsBuildItem.java
This file was deleted.
Oops, something went wrong.
46 changes: 46 additions & 0 deletions
46
...ommon/deployment/src/main/java/io/quarkus/amazon/common/deployment/AmazonHttpClients.java
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,46 @@ | ||
package io.quarkus.amazon.common.deployment; | ||
|
||
import java.util.function.BooleanSupplier; | ||
|
||
public class AmazonHttpClients { | ||
|
||
public static final String APACHE_HTTP_SERVICE = "software.amazon.awssdk.http.apache.ApacheSdkHttpService"; | ||
public static final String NETTY_HTTP_SERVICE = "software.amazon.awssdk.http.nio.netty.NettySdkAsyncHttpService"; | ||
public static final String URL_CONNECTION_HTTP_SERVICE = "software.amazon.awssdk.http.urlconnection.UrlConnectionSdkHttpService"; | ||
|
||
public static class IsAmazonApacheHttpServicePresent implements BooleanSupplier { | ||
@Override | ||
public boolean getAsBoolean() { | ||
try { | ||
Class.forName(APACHE_HTTP_SERVICE); | ||
return true; | ||
} catch (Exception e) { | ||
return false; | ||
} | ||
} | ||
}; | ||
|
||
public static class IsAmazonNettyHttpServicePresent implements BooleanSupplier { | ||
@Override | ||
public boolean getAsBoolean() { | ||
try { | ||
Class.forName(NETTY_HTTP_SERVICE); | ||
return true; | ||
} catch (Exception e) { | ||
return false; | ||
} | ||
} | ||
}; | ||
|
||
public static class IsAmazonUrlConnectionHttpServicePresent implements BooleanSupplier { | ||
@Override | ||
public boolean getAsBoolean() { | ||
try { | ||
Class.forName(URL_CONNECTION_HTTP_SERVICE); | ||
return true; | ||
} catch (Exception e) { | ||
return false; | ||
} | ||
} | ||
}; | ||
} |
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.