Skip to content
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
10 changes: 9 additions & 1 deletion .github/workflows/ci-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
run: |
JBOSS_HOME=`pwd`'/container/*'
export JBOSS_HOME=`echo $JBOSS_HOME`
mvn clean package -Pupdate-jboss-as -Dtck -f jboss-as/pom.xml
mvn clean package -Pupdate-jboss-as -Pupdate-jakarta-apis -Dtck -f jboss-as/pom.xml
- name: Zip Patched WildFly
run: |
cd container/
Expand All @@ -80,6 +80,8 @@ jobs:
incontainer-tests:
name: "Weld In-container Tests - JDK ${{matrix.java.name}}"
runs-on: ubuntu-latest
# Disabled until baseline WFLY supports EE 11 due to BeanManager#getELResolver calls
if: false
needs: initial-build
timeout-minutes: 120
strategy:
Expand Down Expand Up @@ -144,6 +146,8 @@ jobs:
CDI-TCK:
name: "CDI TCK - JDK ${{matrix.java.name}}"
runs-on: ubuntu-latest
# Disabled until baseline WFLY supports EE 11 due to BeanManager#getELResolver calls
if: false
needs: initial-build
timeout-minutes: 120
strategy:
Expand Down Expand Up @@ -208,6 +212,8 @@ jobs:
relaxed-mode-test:
name: "Relaxed mode testing - JDK ${{matrix.java.name}}"
runs-on: ubuntu-latest
# Disabled until baseline WFLY supports EE 11 due to BeanManager#getELResolver calls
if: false
needs: initial-build
timeout-minutes: 120
strategy:
Expand Down Expand Up @@ -328,6 +334,8 @@ jobs:
name: "Weld Examples build and test - JDK 17}"
runs-on: ubuntu-latest
needs: initial-build
# Disabled until baseline WFLY supports EE 11 due to BeanManager#getELResolver calls
if: false
timeout-minutes: 120
steps:
- uses: actions/checkout@v4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import jakarta.el.ELResolver;
import jakarta.el.ExpressionFactory;
import jakarta.enterprise.inject.spi.BeanManager;
import jakarta.enterprise.inject.spi.el.ELAwareBeanManager;
import jakarta.faces.application.Application;
import jakarta.faces.application.ApplicationWrapper;
import jakarta.faces.context.FacesContext;
Expand Down Expand Up @@ -49,7 +49,7 @@ public LazyBeanManagerIntegrationELResolver() {
delegate = new TransparentELResolver();
}

public void beanManagerReady(BeanManager beanManager) {
public void beanManagerReady(ELAwareBeanManager beanManager) {
this.delegate = beanManager.getELResolver();
}

Expand All @@ -61,7 +61,7 @@ protected ELResolver delegate() {

private LazyBeanManagerIntegrationELResolver elResolver;
private ExpressionFactory expressionFactory;
private BeanManager beanManager;
private ELAwareBeanManager beanManager;

public WeldApplication(Application application) {
super(application);
Expand All @@ -72,7 +72,7 @@ public WeldApplication(Application application) {

private void init() {
ExpressionFactory expressionFactory = this.expressionFactory;
BeanManager beanManager = null;
ELAwareBeanManager beanManager = null;
if (expressionFactory == null && (expressionFactory = super.getExpressionFactory()) != null
&& (beanManager = beanManager()) != null) {
elResolver.beanManagerReady(beanManager);
Expand All @@ -90,15 +90,16 @@ public ExpressionFactory getExpressionFactory() {
}
}

private BeanManager beanManager() {
private ELAwareBeanManager beanManager() {
FacesContext facesContext;
if (beanManager == null && (facesContext = FacesContext.getCurrentInstance()) != null) {
Object obj = facesContext.getExternalContext().getContext();
boolean notFound = false;
try {
if (obj instanceof ServletContext) {
final ServletContext ctx = (ServletContext) obj;
final BeanManager tmp = (BeanManager) ctx.getAttribute(WeldServletLifecycle.BEAN_MANAGER_ATTRIBUTE_NAME);
final ELAwareBeanManager tmp = (ELAwareBeanManager) ctx
.getAttribute(WeldServletLifecycle.BEAN_MANAGER_ATTRIBUTE_NAME);
if (tmp == null) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public abstract class ForwardingBeanManager implements ELAwareBeanManager, Seria

private static final long serialVersionUID = -3116833950882475733L;

public abstract BeanManager delegate();
public abstract ELAwareBeanManager delegate();

@Override
public Object getReference(Bean<?> bean, Type beanType, CreationalContext<?> ctx) {
Expand Down
89 changes: 80 additions & 9 deletions jboss-as/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
as the release plugin won't deal with double evaluation -->
<weld.update.version>7.0.0-SNAPSHOT</weld.update.version>
<!-- These are *NOT* automatically updated and should be reviewed if the relevant profile is to be used -->
<cdi.update.version>4.1.0</cdi.update.version>
<interceptors.update.version>2.2.0</interceptors.update.version>
<cdi.update.version>5.0.0.Alpha1</cdi.update.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -70,7 +69,7 @@
<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>cdi-tck-ext-lib</artifactId>
<version>${cdi.tck-4-1.version}</version>
<version>${cdi.tck.version}</version>
</dependency>
<dependency>
<groupId>jakarta.enterprise</groupId>
Expand All @@ -87,11 +86,6 @@
<artifactId>jakarta.enterprise.lang-model</artifactId>
<version>${cdi.update.version}</version>
</dependency>
<dependency>
<groupId>jakarta.interceptor</groupId>
<artifactId>jakarta.interceptor-api</artifactId>
<version>${interceptors.update.version}</version>
</dependency>
</dependencies>
<profiles>
<profile>
Expand Down Expand Up @@ -227,6 +221,83 @@
</plugins>
</build>
</profile>
<profile>
<!-- Updates CDI API and Interceptors API in target WFLY distribution -->
<!-- This is mainly useful when developing against early CDI versions adding new APIs that aren't in WFLY -->
<id>update-jakarta-apis</id>
<build>
<defaultGoal>package</defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>update-jakarta-apis</id>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<property file="${basedir}/local.build.properties" />
<property file="${basedir}/build.properties" />
<property name="jboss.home" value="${env.JBOSS_HOME}" />

<echo>

=========================================================================

Updating CDI API version

CDI version: ${cdi.update.version}

JBOSS_HOME: ${jboss.home}

=========================================================================

</echo>

<available file="${jboss.home}/modules/system" property="module.dir" value="${jboss.home}/modules/system/layers/base/jakarta/enterprise/api" />

<property name="module.dir" value="${jboss.home}/modules//system/layers/base/jakarta/enterprise/api" />

<property name="cdi.api.file" value="jakarta.enterprise.cdi-api-${cdi.update.version}.jar" />
<property name="cdi.el.api.file" value="jakarta.enterprise.cdi-el-api-${cdi.update.version}.jar" />
<property name="cdi.lang.model.file" value="jakarta.enterprise.lang-model-${cdi.update.version}.jar" />

<delete>
<fileset dir="${module.dir}/main" includes="*.jar" />
</delete>

<copy todir="${module.dir}/main" overwrite="true">
<fileset dir="target/dependency/lib">
<include name="${cdi.api.file}" />
<include name="${cdi.lang.model.file}" />
<include name="${cdi.el.api.file}" />
</fileset>
</copy>


<!-- WFLY doesn't yet have dep. on the EL API part of CDI, this forcibly adds it -->
<replaceregexp file="${module.dir}/main/module.xml" match="path=&quot;jakarta.enterprise.cdi-api.*?&quot;" replace="path=&quot;${cdi.api.file}&quot;" byline="true" />
<replaceregexp file="${module.dir}/main/module.xml" match="path=&quot;jakarta.enterprise.cdi-el-api.*?&quot;" replace="path=&quot;${cdi.el.api.file}&quot;" byline="true" />
<replaceregexp file="${module.dir}/main/module.xml" match="path=&quot;jakarta.enterprise.lang.*?&quot;" replace="path=&quot;${cdi.lang.model.file}&quot;" byline="true" />
</target>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>install-cdi-tck-ext-lib</id>
<activation>
Expand All @@ -250,7 +321,7 @@
<target>
<copy todir="${env.JBOSS_HOME}/standalone/lib/ext" overwrite="true">
<fileset dir="target/dependency/lib">
<include name="cdi-tck-ext-lib-${cdi.tck-4-1.version}.jar" />
<include name="cdi-tck-ext-lib-${cdi.tck.version}.jar" />
</fileset>
</copy>
</target>
Expand Down
14 changes: 7 additions & 7 deletions jboss-tck-runner/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>cdi-tck-api</artifactId>
<version>${cdi.tck-4-1.version}</version>
<version>${cdi.tck.version}</version>
<exclusions>
<exclusion>
<groupId>jakarta.el</groupId>
Expand All @@ -77,7 +77,7 @@
<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>cdi-tck-core-impl</artifactId>
<version>${cdi.tck-4-1.version}</version>
<version>${cdi.tck.version}</version>
<type>xml</type>
<classifier>suite</classifier>
<scope>test</scope>
Expand All @@ -100,7 +100,7 @@
<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>cdi-tck-core-impl</artifactId>
<version>${cdi.tck-4-1.version}</version>
<version>${cdi.tck.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
Expand Down Expand Up @@ -253,7 +253,7 @@
<artifactItem>
<groupId>jakarta.enterprise</groupId>
<artifactId>cdi-tck-core-impl</artifactId>
<version>${cdi.tck-4-1.version}</version>
<version>${cdi.tck.version}</version>
<type>xml</type>
<classifier>suite</classifier>
<overWrite>false</overWrite>
Expand All @@ -262,7 +262,7 @@
<artifactItem>
<groupId>jakarta.tck</groupId>
<artifactId>cdi-tck-ee-impl</artifactId>
<version>${platform.tck-4-1.version}</version>
<version>${platform.tck.version}</version>
<type>xml</type>
<classifier>suite</classifier>
<overWrite>false</overWrite>
Expand Down Expand Up @@ -374,15 +374,15 @@
<dependency>
<groupId>jakarta.tck</groupId>
<artifactId>cdi-tck-ee-impl</artifactId>
<version>${platform.tck-4-1.version}</version>
<version>${platform.tck.version}</version>
<type>xml</type>
<classifier>suite</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>jakarta.tck</groupId>
<artifactId>cdi-tck-ee-impl</artifactId>
<version>${platform.tck-4-1.version}</version>
<version>${platform.tck.version}</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
6 changes: 3 additions & 3 deletions lang-model-tck/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
<artifactId>lang-model-tck</artifactId>

<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>cdi-tck-lang-model</artifactId>
<version>${cdi.tck-4-1.version}</version>
<version>${cdi.tck.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
<arquillian.tomcat.version>1.2.3.Final</arquillian.tomcat.version>
<atinject.tck.version>2.0.1</atinject.tck.version>
<!-- Version of the CDI 4.1 TCK release -->
<cdi.tck-4-1.version>4.1.0</cdi.tck-4-1.version>
<cdi.tck.version>5.0.0.Alpha1</cdi.tck.version>
<!-- Version of the Jakarta Platform TCK 4.1 release -->
<platform.tck-4-1.version>11.0.0-M14</platform.tck-4-1.version>
<platform.tck.version>11.0.0-M14</platform.tck.version>
<!-- By default, each mvn profile uses corresponding file from TCK repo, see jboss-tck-runner/pom.xml -->
<!-- We can also use our own file, needed for relaxed mode testing (see WeldMethodInterceptor) -->
<!-- Our variant is under src/test/tck/tck-tests.xml -->
Expand Down Expand Up @@ -85,7 +85,7 @@
<spotbugs-maven-plugin.version>4.9.1.0</spotbugs-maven-plugin.version>
<spotbugs-annotations-version>4.9.1</spotbugs-annotations-version>
<testng.version>7.9.0</testng.version>
<weld.api.version>6.0.Final</weld.api.version>
<weld.api.version>7.0.Alpha1</weld.api.version>
<weld.logging.tools.version>1.0.3.Final</weld.logging.tools.version>
<wildfly.arquillian.version>5.0.1.Final</wildfly.arquillian.version>
</properties>
Expand Down
2 changes: 1 addition & 1 deletion porting-package/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>cdi-tck-api</artifactId>
<version>${cdi.tck-4-1.version}</version>
<version>${cdi.tck.version}</version>
<exclusions>
<exclusion>
<groupId>jakarta.el</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
import jakarta.ejb.Remove;
import jakarta.ejb.Stateful;
import jakarta.enterprise.context.SessionScoped;
import jakarta.enterprise.inject.spi.BeanManager;
import jakarta.enterprise.inject.spi.el.ELAwareBeanManager;

@SuppressWarnings("serial")
@Stateful
@SessionScoped
public class HelloBean implements IHelloBean, Serializable {
@Resource(mappedName = "java:comp/BeanManager")
private BeanManager beanManager;
private ELAwareBeanManager beanManager;

public String sayHello() {
return "hello";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static boolean isObservedBeforeBeanDiscovery() {
return observedBeforeBeanDiscovery;
}

public void observeBeforeShutdown(@Observes BeforeShutdown beforeShutdown, WeldManager beanManager) {
public void observeBeforeShutdown(@Observes BeforeShutdown beforeShutdown, ELAwareBeanManager beanManager) {
assert beanManager != null;
assert beanManager.getELResolver() != null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@ public List<ClassInfo> superInterfacesDeclarations() {
.collect(Collectors.toList());
}

@Override
public Collection<ClassInfo> permittedSubclasses() {
return Arrays.stream(reflection.getPermittedSubclasses())
.map(it -> new ClassInfoImpl(bm.createAnnotatedType(it), bm))
.collect(Collectors.toList());
}

@Override
public boolean isPlainClass() {
return !isInterface() && !isEnum() && !isAnnotation() && !isRecord();
Expand Down Expand Up @@ -117,6 +124,11 @@ public boolean isFinal() {
return java.lang.reflect.Modifier.isFinal(reflection.getModifiers());
}

@Override
public boolean isSealed() {
return reflection.isSealed();
}

@Override
public int modifiers() {
return reflection.getModifiers();
Expand Down
Loading