-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change the way Resteasy injection is initialized
Fixes #17628
- Loading branch information
1 parent
cc94f11
commit 7abd7de
Showing
4 changed files
with
19 additions
and
42 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
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
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
17 changes: 1 addition & 16 deletions
17
...ime/src/main/java/io/quarkus/resteasy/common/runtime/ResteasyInjectorFactoryRecorder.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 |
---|---|---|
@@ -1,29 +1,14 @@ | ||
package io.quarkus.resteasy.common.runtime; | ||
|
||
import java.util.List; | ||
import java.util.function.Function; | ||
|
||
import org.jboss.resteasy.spi.InjectorFactory; | ||
|
||
import io.quarkus.arc.runtime.BeanContainer; | ||
import io.quarkus.runtime.RuntimeValue; | ||
import io.quarkus.runtime.annotations.Recorder; | ||
|
||
@Recorder | ||
public class ResteasyInjectorFactoryRecorder { | ||
|
||
public RuntimeValue<InjectorFactory> setup(BeanContainer container, List<Function<Object, Object>> propertyUnwrappers) { | ||
QuarkusInjectorFactory.CONTAINER = container; | ||
QuarkusInjectorFactory.PROXY_UNWRAPPER = new Function<Object, Object>() { | ||
@Override | ||
public Object apply(Object o) { | ||
Object res = o; | ||
for (Function<Object, Object> i : propertyUnwrappers) { | ||
res = i.apply(res); | ||
} | ||
return res; | ||
} | ||
}; | ||
public RuntimeValue<InjectorFactory> setup() { | ||
return new RuntimeValue<>(new QuarkusInjectorFactory()); | ||
} | ||
} |