Skip to content

Commit

Permalink
Merge pull request #846 from manovotn/weld511
Browse files Browse the repository at this point in the history
Upgrade Weld version, simplify DefaultMethodTest
  • Loading branch information
Ladicek authored Jun 21, 2023
2 parents c260acf + 57af00e commit 332d2a2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 209 deletions.
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

0 comments on commit 332d2a2

Please sign in to comment.