Skip to content

Commit

Permalink
Merge pull request #16859 from pferraro/WFLY-18036
Browse files Browse the repository at this point in the history
WFLY-18036 Marshalling optimizations are not getting applied to @SessionScoped @stateful EJBs
  • Loading branch information
darranl committed May 30, 2023
2 parents 8d6a4c3 + 7f07222 commit 461a97c
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.jboss.marshalling.MarshallingConfiguration;
import org.jboss.marshalling.ModularClassResolver;
import org.jboss.modules.Module;
import org.wildfly.clustering.marshalling.jboss.DynamicClassTable;
import org.wildfly.clustering.marshalling.jboss.DynamicExternalizerObjectTable;
import org.wildfly.clustering.marshalling.jboss.SimpleClassTable;

Expand Down Expand Up @@ -56,6 +57,16 @@ public MarshallingConfiguration apply(Module module) {
return config;
}
},
VERSION_3() {
@Override
public MarshallingConfiguration apply(Module module) {
MarshallingConfiguration config = new MarshallingConfiguration();
config.setClassResolver(ModularClassResolver.getInstance(module.getModuleLoader()));
config.setClassTable(new DynamicClassTable(module.getClassLoader()));
config.setObjectTable(new DynamicExternalizerObjectTable(module.getClassLoader()));
return config;
}
},
;
static final JBossMarshallingVersion CURRENT = VERSION_2;
static final JBossMarshallingVersion CURRENT = VERSION_3;
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
*/
public class DistributableWebDeploymentProcessor implements DeploymentUnitProcessor {

private static final String WEB_API = "org.wildfly.clustering.web.api";
private static final String MARSHALLING_API = "org.wildfly.clustering.marshalling.api";
private static final String PROTOSTREAM = "org.infinispan.protostream";
private static final String EL_EXPRESSLY = "org.wildfly.clustering.el.expressly";
private static final String WELD_CORE = "org.wildfly.clustering.weld.core";
Expand All @@ -64,6 +66,8 @@ public void deploy(DeploymentPhaseContext context) throws DeploymentUnitProcessi
ModuleSpecification specification = unit.getAttachment(Attachments.MODULE_SPECIFICATION);
ModuleLoader loader = Module.getBootModuleLoader();

specification.addSystemDependency(new ModuleDependency(loader, WEB_API, false, false, false, false));

if (provider.getSessionManagementConfiguration().getMarshallerFactory() == SessionMarshallerFactory.PROTOSTREAM) {
specification.addSystemDependency(new ModuleDependency(loader, PROTOSTREAM, false, false, false, false));
specification.addSystemDependency(new ModuleDependency(loader, UNDERTOW, false, false, true, false));
Expand All @@ -82,6 +86,8 @@ public void deploy(DeploymentPhaseContext context) throws DeploymentUnitProcessi
throw new IllegalStateException(e);
}
}
} else {
specification.addSystemDependency(new ModuleDependency(loader, MARSHALLING_API, false, false, false, false));
}

if (JsfVersionMarker.getVersion(unit).equals(JsfVersionMarker.JSF_2_0)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class EjbDependencyDeploymentUnitProcessor implements DeploymentUnitProce
private static final String HTTP_EJB = "org.wildfly.http-client.ejb";
private static final String HTTP_TRANSACTION = "org.wildfly.http-client.transaction";
private static final String HTTP_NAMING = "org.wildfly.http-client.naming";

private static final String CLUSTERING_EJB_CLIENT = "org.wildfly.clustering.ejb.client";

/**
* Adds Jakarta EE module as a dependency to any deployment unit which is an Jakarta Enterprise Beans deployment
Expand Down Expand Up @@ -91,6 +91,9 @@ public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitPro
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, HTTP_EJB, false, false, true, false));
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, HTTP_NAMING, false, false, true, false));
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, HTTP_TRANSACTION, false, false, true, false));
// Marshalling support for EJB SessionIDs
// TODO Move this to distributable-ejb subsystem
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, CLUSTERING_EJB_CLIENT, false, false, true, false));

if (IIOPDeploymentMarker.isIIOPDeployment(deploymentUnit)) {
//needed for dynamic IIOP stubs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ public class UndertowDependencyProcessor implements DeploymentUnitProcessor {
private static final String UNDERTOW_SERVLET = "io.undertow.servlet";
private static final String UNDERTOW_JSP = "io.undertow.jsp";
private static final String UNDERTOW_WEBSOCKET = "io.undertow.websocket";
private static final String CLUSTERING_API = "org.wildfly.clustering.web.api";

private static final String SERVLET_API = "jakarta.servlet.api";
private static final String JSP_API = "jakarta.servlet.jsp.api";
Expand Down Expand Up @@ -83,6 +82,5 @@ public void deploy(DeploymentPhaseContext phaseContext) {
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, UNDERTOW_SERVLET, false, false, true, false));
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, UNDERTOW_JSP, false, false, true, false));
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, UNDERTOW_WEBSOCKET, false, false, true, false));
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, CLUSTERING_API, true, false, false, false));
}
}

0 comments on commit 461a97c

Please sign in to comment.