Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Poc/compile jdk17 #905

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions mule-http-connector/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@
<bcmail-fips.version>1.0.4</bcmail-fips.version>
<bc-fips.version>1.0.2.5</bc-fips.version>

<extensionsAnnotationProcessor>
org.mule.runtime.ast.extension.api.loader.ASTExtensionResourcesGeneratorAnnotationProcessor
</extensionsAnnotationProcessor>
<annotations.processor.mule.version>4.6.0</annotations.processor.mule.version>
<mule.extensions.ast.loader.version>1.7.0</mule.extensions.ast.loader.version>

<surefire.args>
--add-opens=java.base/java.lang=ALL-UNNAMED
--add-opens=java.base/java.lang.reflect=ALL-UNNAMED
Expand Down Expand Up @@ -225,6 +231,81 @@
</dependency>
</dependencies>
</plugin>



<plugin>
<groupId>org.bsc.maven</groupId>
<artifactId>maven-processor-plugin</artifactId>
<executions>
<execution>
<id>process</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<configuration>
<encoding>ISO-8859-1</encoding>
<source>1.8</source>
<target>1.8</target>
<release>8</release>
<proc></proc>
<parameters>true</parameters>
<annotationProcessorPaths>
<path>
<groupId>org.mule.runtime</groupId>
<artifactId>mule-extension-ast-loader</artifactId>
<version>${mule.extensions.ast.loader.version}</version>
</path>
<path>
<groupId>org.mule.runtime</groupId>
<artifactId>mule-module-extensions-spring-support</artifactId>
<version>${annotations.processor.mule.version}</version>
</path>
<path>
<groupId>org.mule.runtime</groupId>
<artifactId>mule-module-extensions-soap-support</artifactId>
<version>${annotations.processor.mule.version}</version>
</path>
</annotationProcessorPaths>
<annotationProcessors>
<annotationProcessors>${extensionsAnnotationProcessor}</annotationProcessors>
</annotationProcessors>
<compilerArgs>
<arg>-Aextension.version=${project.version}</arg>
<arg>-Aextension.resources=${project.build.resources[0].directory}</arg>
<arg>-AexportedPackagesValidator.skip=${exportedPackagesValidator.skip}</arg>
<arg>-AexportedPackagesValidator.strictValidation=${exportedPackagesValidator.strictValidation}</arg>
</compilerArgs>
</configuration>
<dependencies>
<dependency>
<groupId>org.mule.sdk</groupId>
<artifactId>mule-sdk-api</artifactId>
<version>${muleSdkApiVersion}</version>
</dependency>
</dependencies>
<executions>
<!-- Do just the annotation processing part, but with access to the compiled classes -->
<execution>
<phase>compile</phase>
<id>post-compile-annotaiton-processing</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<proc>only</proc>
<compilerArgs combine.children="append">
<arg>-Aextension.classes=${project.build.outputDirectory}</arg>
</compilerArgs>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.mule.runtime.extension.api.annotation.param.Parameter;

import java.security.cert.Certificate;
import java.util.Collections;
import java.util.Map;
import java.util.function.Supplier;

Expand Down Expand Up @@ -147,6 +148,13 @@ public HttpRequestAttributes(MultiMap<String, String> headers, String listenerPa
uriParams, "", remoteAddress, () -> clientCertificate);
}

public HttpRequestAttributes() {
this(MultiMap.emptyMultiMap(), "/", null, "HTTP/1.1",
"http", "GET", "/", null, "",
MultiMap.emptyMultiMap(), Collections.emptyMap(), "/",
null);
}

HttpRequestAttributes(MultiMap<String, String> headers, String listenerPath, String relativePath, String maskedRequestPath,
String version, String scheme, String method, String requestPath, String rawRequestPath,
String requestUri, String rawRequestUri, String queryString, MultiMap<String, String> queryParams,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import javax.inject.Inject;
import java.net.CookieManager;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;

Expand Down Expand Up @@ -237,6 +238,30 @@ public void initialise() throws InitialisationException {
new HttpRequesterTestRequestBuilder(requestBody, requestHeaders, requestQueryParams, requestUriParams, expressionManager);
}

@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (null == o || getClass() != o.getClass())
return false;
HttpConnectivityValidator that = (HttpConnectivityValidator) o;
return followRedirects == that.followRedirects && Objects.equals(requestPath, that.requestPath)
&& Objects.equals(requestMethod, that.requestMethod) && Objects.equals(responseTimeout, that.responseTimeout)
&& responseTimeoutUnit == that.responseTimeoutUnit && Objects.equals(requestBody, that.requestBody)
&& Objects.equals(requestHeaders, that.requestHeaders) && Objects.equals(requestQueryParams, that.requestQueryParams)
&& Objects.equals(requestUriParams, that.requestUriParams) && Objects.equals(responseValidator, that.responseValidator)
&& Objects.equals(expressionManager, that.expressionManager) && Objects.equals(requestBuilder, that.requestBuilder)
&& Objects.equals(defaultStatusCodeValidator, that.defaultStatusCodeValidator)
&& Objects.equals(muleContext, that.muleContext);
}

@Override
public int hashCode() {
return Objects.hash(requestPath, requestMethod, followRedirects, responseTimeout, responseTimeoutUnit, requestBody,
requestHeaders, requestQueryParams, requestUriParams, responseValidator, expressionManager,
requestBuilder, defaultStatusCodeValidator, muleContext);
}

private static class VoidHttpRequesterCookieConfig implements HttpRequesterCookieConfig {

@Override
Expand Down