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

Move to RESTEasy 4 #11

Merged
merged 1 commit into from
Sep 4, 2018
Merged
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package org.jboss.shamrock.jaxrs.runtime.graal;

import java.lang.reflect.Constructor;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionStage;

import javax.ws.rs.WebApplicationException;

Expand All @@ -20,29 +22,31 @@ public ShamrockConstructorInjector(Constructor ctor, ConstructorInjector delegat
}

@Override
public Object construct() {
public CompletionStage<Object> construct(boolean unwrapAsync) {
System.err.println("construct() " + this.ctor);
return this.delegate.construct();
return this.delegate.construct(unwrapAsync);
}

@Override
public Object construct(HttpRequest request, HttpResponse response) throws Failure, WebApplicationException, ApplicationException {
public CompletionStage<Object> construct(HttpRequest request, HttpResponse response, boolean unwrapAsync)
throws Failure, WebApplicationException, ApplicationException {
System.err.println("construct(req,resp) " + this.ctor);
System.err.println("CAN WE CDI? " + ShamrockInjectorFactory.CONTAINER);
if (ShamrockInjectorFactory.CONTAINER == null) {
return delegate.construct(request, response);
return delegate.construct(request, response, unwrapAsync);
}
return ShamrockInjectorFactory.CONTAINER.instance(this.ctor.getDeclaringClass());
return CompletableFuture.completedFuture(ShamrockInjectorFactory.CONTAINER.instance(this.ctor.getDeclaringClass()));
}

@Override
public Object[] injectableArguments() {
return this.delegate.injectableArguments();
public CompletionStage<Object[]> injectableArguments(boolean unwrapAsync) {
return this.delegate.injectableArguments(unwrapAsync);
}

@Override
public Object[] injectableArguments(HttpRequest request, HttpResponse response) throws Failure {
return this.delegate.injectableArguments(request, response);
public CompletionStage<Object[]> injectableArguments(HttpRequest request, HttpResponse response, boolean unwrapAsync)
throws Failure {
return this.delegate.injectableArguments(request, response, unwrapAsync);
}

private final ConstructorInjector delegate;
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

<properties>
<version.org.jandex>2.1.0.Beta1</version.org.jandex>
<resteasy.version>3.5.1.Final</resteasy.version>
<resteasy.version>4.0.0.Beta5</resteasy.version>
<weld-se-core.version>3.0.4.Final</weld-se-core.version>
<undertow.version>2.0.12.Final</undertow.version>
<xnio.version>3.3.8.Final</xnio.version>
Expand Down