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

Upgrade Weld version, simplify DefaultMethodTest #846

Merged
merged 2 commits into from
Jun 21, 2023
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
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<version.rxjava3>3.1.6</version.rxjava3>
<version.testng>6.14.3</version.testng>
<version.weld-api>5.0.SP3</version.weld-api>
<version.weld-core>5.1.0.Final</version.weld-core>
<version.weld-core>5.1.1.Final</version.weld-core>
<version.weld-junit5>4.0.0.Final</version.weld-junit5>

<version.jacoco-maven-plugin>0.8.10</version.jacoco-maven-plugin>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,19 @@ public void rememberInterfaces(@Observes @WithAnnotations(RegisterInterfaceBased
}
}

@SuppressWarnings({ "rawtypes", "unchecked" })
public void registerBeans(@Observes AfterBeanDiscovery abd, BeanManager beanManager) {
for (Class<?> iface : interfaces) {
for (Class iface : interfaces) {
abd.addBean()
.beanClass(iface)
.types(iface)
.scope(Dependent.class)
.qualifiers(Default.Literal.INSTANCE, Any.Literal.INSTANCE, InterfaceBased.Literal.INSTANCE)
.createWith(ctx -> {
Object target = Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(),
Object instance = Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(),
new Class[] { iface }, InterfaceBasedExtension::invoke);
return Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(),
new Class[] { iface }, new InterceptingInvocationHandler(iface, target, beanManager));
return beanManager.createInterceptionFactory(ctx, iface)
.createInterceptedInstance(instance);
});
LOG.info("Registered bean for " + iface);
}
Expand Down