Skip to content
Draft
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
7 changes: 7 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
<interceptor.api.version>2.2.0</interceptor.api.version>
<servlet.api.version>6.1.0</servlet.api.version>
<validation.api.version>3.1.1</validation.api.version>
<el.api.version>6.0.1</el.api.version>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -193,6 +194,12 @@
</exclusions>
</dependency>

<dependency>
<groupId>jakarta.el</groupId>
<artifactId>jakarta.el-api</artifactId>
<version>${el.api.version}</version>
</dependency>

<!-- Configure non-API dependencies (e.g. testing)-->
<dependency>
<groupId>org.testng</groupId>
Expand Down
5 changes: 5 additions & 0 deletions weld-spi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@
<optional>true</optional>
</dependency>

<dependency>
<groupId>jakarta.el</groupId>
<artifactId>jakarta.el-api</artifactId>
<optional>true</optional>
</dependency>

</dependencies>
</project>
40 changes: 40 additions & 0 deletions weld-spi/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Copyright The Weld Authors
* SPDX-License-Identifier: Apache-2.0
*/
module org.jboss.weld.spi {
requires transitive org.jboss.weld.api;
requires static java.naming;
requires static java.desktop;
requires static jakarta.cdi.el;
requires static jakarta.el;
requires static jakarta.persistence;
requires static jakarta.transaction;
requires static jakarta.servlet;
requires static jakarta.validation;
requires static jakarta.ejb;

exports org.jboss.weld.bootstrap.api;
exports org.jboss.weld.bootstrap.api.helpers;
exports org.jboss.weld.bootstrap.spi;
exports org.jboss.weld.bootstrap.spi.helpers;
exports org.jboss.weld.configuration.spi;
exports org.jboss.weld.configuration.spi.helpers;
exports org.jboss.weld.construction.api;
exports org.jboss.weld.ejb.api;
exports org.jboss.weld.ejb.spi;
exports org.jboss.weld.ejb.spi.helpers;
exports org.jboss.weld.injection.spi;
exports org.jboss.weld.injection.spi.helpers;
exports org.jboss.weld.manager.api;
exports org.jboss.weld.resources.spi;
exports org.jboss.weld.resources.spi.helpers;
exports org.jboss.weld.security.spi;
exports org.jboss.weld.serialization.spi;
exports org.jboss.weld.serialization.spi.helpers;
exports org.jboss.weld.servlet.api;
exports org.jboss.weld.servlet.api.helpers;
exports org.jboss.weld.servlet.spi;
exports org.jboss.weld.servlet.spi.helpers;
exports org.jboss.weld.transaction.spi;
}
Original file line number Diff line number Diff line change
Expand Up @@ -194,4 +194,27 @@ public interface CDI11Bootstrap extends Bootstrap {
*
*/
Bootstrap startContainer(String contextId, Environment environment, Deployment deployment);

/**
* Sets a callback for JPMS module access forwarding. When Weld runs on
* the module path, the entry-point module (SE or Servlet) provides a
* forwarder that relays {@code Module.addOpens()} calls so that the
* core module can access user bean packages.
*
* <p>
* The forwarder must be a lambda defined in the entry-point module
* (not the core module) so that the JVM sees the correct caller for
* the {@code addOpens} permission check.
* </p>
*
* <p>
* When running on the classpath (unnamed module), calling this
* method is unnecessary — the forwarder is never invoked.
* </p>
*
* @param forwarder the forwarding callback
*/
default void setModuleAccessForwarder(ModuleAccessForwarder forwarder) {
// no-op by default — overridden in WeldBootstrap
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright The Weld Authors
* SPDX-License-Identifier: Apache-2.0
*/
package org.jboss.weld.bootstrap.api;

/**
* Callback for forwarding JPMS module access from an entry-point module
* (SE or Servlet) to the core module. The entry-point module creates a
* lambda that calls {@link Module#addOpens(String, Module)}, and core
* invokes it lazily before reflective access to user bean packages.
*
* <p>
* The callback must be defined (as a lambda or method reference) in the
* entry-point module so that the JVM's stack-walking check for
* {@code addOpens} sees the correct caller module.
* </p>
*/
@FunctionalInterface
public interface ModuleAccessForwarder {

/**
* Forward access from the source module's package to the target module.
*
* @param sourceModule the module that owns the package to be opened
* @param packageName the package name to open
* @param targetModule the module that needs access
*/
void forwardAccess(Module sourceModule, String packageName, Module targetModule);
}
22 changes: 22 additions & 0 deletions weld/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright The Weld Authors
* SPDX-License-Identifier: Apache-2.0
*/
module org.jboss.weld.api {
requires transitive jakarta.cdi;
requires static jakarta.servlet;

exports org.jboss.weld.bootstrap.event;
exports org.jboss.weld.context;
exports org.jboss.weld.context.activator;
exports org.jboss.weld.context.api;
exports org.jboss.weld.context.bound;
exports org.jboss.weld.context.ejb;
exports org.jboss.weld.context.http;
exports org.jboss.weld.context.unbound;
exports org.jboss.weld.events;
exports org.jboss.weld.inject;
exports org.jboss.weld.interceptor;
exports org.jboss.weld.invoke;
exports org.jboss.weld.proxy;
}