You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by rz...@apache.org on 2026/01/04 19:24:34 UTC

(tomee) branch xbean-4.30-SNAPSHOT updated (f562e364b4 -> 551ac6e38a)

This is an automated email from the ASF dual-hosted git repository.

rzo1 pushed a change to branch xbean-4.30-SNAPSHOT
in repository https://gitbox.apache.org/repos/asf/tomee.git


    from f562e364b4 configurable constructor-types for ServiceProvider
     new dc058c1c62 Add missing constructor-types parsing
     new 551ac6e38a Implement constructor-types matching for geronimo transaction manager case

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../openejb/config/ConfigurationFactory.java       | 24 +++++++++++++++++++++-
 .../org/apache/openejb/config/sys/JaxbOpenejb.java |  1 +
 .../apache/openejb/config/sys/ServiceProvider.java |  1 +
 .../META-INF/org.apache.openejb/service-jar.xml    | 15 +++++++-------
 4 files changed, 33 insertions(+), 8 deletions(-)


(tomee) 02/02: Implement constructor-types matching for geronimo transaction manager case

Posted by rz...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rzo1 pushed a commit to branch xbean-4.30-SNAPSHOT
in repository https://gitbox.apache.org/repos/asf/tomee.git

commit 551ac6e38aa1dbd790baca4b919eb0340a98e2ac
Author: Richard Zowalla <rz...@apache.org>
AuthorDate: Sun Jan 4 20:24:24 2026 +0100

    Implement constructor-types matching for geronimo transaction manager case
---
 .../openejb/config/ConfigurationFactory.java       | 24 +++++++++++++++++++++-
 .../apache/openejb/config/sys/ServiceProvider.java |  1 +
 .../META-INF/org.apache.openejb/service-jar.xml    | 15 +++++++-------
 3 files changed, 32 insertions(+), 8 deletions(-)

diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigurationFactory.java b/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigurationFactory.java
index 5428f049b8..4f92eb779d 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigurationFactory.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/config/ConfigurationFactory.java
@@ -107,6 +107,7 @@ import jakarta.ejb.embeddable.EJBContainer;
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
+import java.lang.reflect.Array;
 import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URISyntaxException;
@@ -1612,7 +1613,7 @@ public class ConfigurationFactory implements OpenEjbConfigurationFactory {
         return parseList(service.getConstructorTypes()).stream()
                 .map(it -> {
                     try {
-                        return Class.forName(it);
+                        return getClassForType(it);
                     } catch (final ClassNotFoundException e) {
                         throw new OpenEJBRuntimeException(e);
                     }
@@ -1620,6 +1621,27 @@ public class ConfigurationFactory implements OpenEjbConfigurationFactory {
                 .collect(Collectors.toUnmodifiableList());
     }
 
+    private Class<?> getClassForType(String typeName) throws ClassNotFoundException {
+        if (typeName.endsWith("[]")) {
+            final String elementType = typeName.substring(0, typeName.length() - 2);
+            final Class<?> elementClass = getClassForType(elementType); // recursion
+            return Array.newInstance(elementClass, 0).getClass();
+        }
+
+        return switch (typeName) {
+            case "boolean" -> boolean.class;
+            case "byte"    -> byte.class;
+            case "char"    -> char.class;
+            case "short"   -> short.class;
+            case "int"     -> int.class;
+            case "long"    -> long.class;
+            case "float"   -> float.class;
+            case "double"  -> double.class;
+            case "void"    -> void.class;
+            default -> Class.forName(typeName); // regular case
+        };
+    }
+
     protected List<String> getResourceIds() {
         return getResourceIds(null);
     }
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/sys/ServiceProvider.java b/container/openejb-core/src/main/java/org/apache/openejb/config/sys/ServiceProvider.java
index cfcf8a6c71..1b2c042298 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/config/sys/ServiceProvider.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/config/sys/ServiceProvider.java
@@ -46,6 +46,7 @@ import java.util.Properties;
  *       &lt;attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
  *       &lt;attribute name="provider-type" use="required" type="{http://www.openejb.org/Service/Configuration}ProviderTypes" /&gt;
  *       &lt;attribute name="constructor" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
+ *       &lt;attribute name="constructor-types" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
  *       &lt;attribute name="factory-name" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
  *     &lt;/extension&gt;
  *   &lt;/simpleContent&gt;
diff --git a/container/openejb-core/src/main/resources/META-INF/org.apache.openejb/service-jar.xml b/container/openejb-core/src/main/resources/META-INF/org.apache.openejb/service-jar.xml
index 50ef7c58eb..5a16c882b6 100644
--- a/container/openejb-core/src/main/resources/META-INF/org.apache.openejb/service-jar.xml
+++ b/container/openejb-core/src/main/resources/META-INF/org.apache.openejb/service-jar.xml
@@ -125,7 +125,7 @@
     # side of the pool reaches its `MaxAge`, it is also immediately
     # replaced.  Replacement is done in a background queue using the
     # number of threads specified by `CallbackThreads`.
-    
+
     MinSize = 0
 
     # StrictPooling tells the container what to do when the pool
@@ -362,7 +362,7 @@
     # annotation is used.
 
     AccessTimeout = 30 seconds
-    
+
   </ServiceProvider>
 
 
@@ -428,10 +428,10 @@
     # override this setting for the bean where the annotation is used.
 
     TimeOut 20
-    
-    # Specifies the frequency (in seconds) at which the bean cache is checked for 
+
+    # Specifies the frequency (in seconds) at which the bean cache is checked for
     # idle beans.
-    
+
     Frequency 60
 
     # Specifies the size of the bean pools for this
@@ -510,8 +510,8 @@
           service="SecurityService"
           types="SecurityService"
           class-name="org.apache.openejb.core.security.SecurityServiceImpl">
-  
-    DefaultUser guest         
+
+    DefaultUser guest
   </ServiceProvider>
 
   <ServiceProvider
@@ -531,6 +531,7 @@
             types="TransactionManager"
             factory-name="create"
             constructor="defaultTransactionTimeoutSeconds, defaultTransactionTimeout, TxRecovery, tmId, bufferClassName, bufferSizeKb, checksumEnabled, adler32Checksum, flushSleepTimeMilliseconds, flushSleepTime, logFileDir, logFileExt, logFileName, maxBlocksPerFile, maxBuffers, maxLogFiles, minBuffers, threadsWaitingForceThreshold"
+            constructor-types="java.lang.Integer, org.apache.openejb.util.Duration, boolean, byte[], java.lang.String, int, boolean, boolean, java.lang.Integer, org.apache.openejb.util.Duration, java.lang.String, java.lang.String, java.lang.String, int, int, int, int, int"
             class-name="org.apache.openejb.resource.GeronimoTransactionManagerFactory">
       defaultTransactionTimeout 10 minutes
 


(tomee) 01/02: Add missing constructor-types parsing

Posted by rz...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rzo1 pushed a commit to branch xbean-4.30-SNAPSHOT
in repository https://gitbox.apache.org/repos/asf/tomee.git

commit dc058c1c62b0cf96ca4b2c3046724d1294c0f9bc
Author: Richard Zowalla <rz...@apache.org>
AuthorDate: Sun Jan 4 20:23:50 2026 +0100

    Add missing constructor-types parsing
---
 .../src/main/java/org/apache/openejb/config/sys/JaxbOpenejb.java         | 1 +
 1 file changed, 1 insertion(+)

diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/sys/JaxbOpenejb.java b/container/openejb-core/src/main/java/org/apache/openejb/config/sys/JaxbOpenejb.java
index ba7f06779a..f65cc788c2 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/config/sys/JaxbOpenejb.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/config/sys/JaxbOpenejb.java
@@ -481,6 +481,7 @@ public abstract class JaxbOpenejb {
             provider.setService(att.getValue("", "service"));
             provider.setFactoryName(att.getValue("", "factory-name"));
             provider.setConstructor(att.getValue("", "constructor"));
+            provider.setConstructorTypes(att.getValue("", "constructor-types"));
             provider.setClassName(att.getValue("", "class-name"));
             provider.setParent(att.getValue("", "parent"));
             final String typesString = att.getValue("", "types");