You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by rm...@apache.org on 2015/04/27 19:06:10 UTC
tomee git commit: TOMEE-1565 using classname of the resource if types
are not loadable
Repository: tomee
Updated Branches:
refs/heads/master b60431be6 -> 4987d67c3
TOMEE-1565 using classname of the resource if types are not loadable
Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/4987d67c
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/4987d67c
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/4987d67c
Branch: refs/heads/master
Commit: 4987d67c376d1759d47b5ef8ace0e24bdc0ae543
Parents: b60431b
Author: Romain Manni-Bucau <rm...@apache.org>
Authored: Mon Apr 27 19:06:00 2015 +0200
Committer: Romain Manni-Bucau <rm...@apache.org>
Committed: Mon Apr 27 19:06:00 2015 +0200
----------------------------------------------------------------------
.../main/java/org/apache/openejb/config/AutoConfig.java | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tomee/blob/4987d67c/container/openejb-core/src/main/java/org/apache/openejb/config/AutoConfig.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/config/AutoConfig.java b/container/openejb-core/src/main/java/org/apache/openejb/config/AutoConfig.java
index b896367..6661eb2 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/config/AutoConfig.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/config/AutoConfig.java
@@ -956,7 +956,7 @@ public class AutoConfig implements DynamicDeployer, JndiConstants {
final ResourceInfo resourceInfo = configFactory.configureService(resource, ResourceInfo.class);
resourceInfo.originAppName = module.getModuleId();
final ResourceRef resourceRef = new ResourceRef();
- resourceRef.setResType(chooseType(module.getClassLoader(), resourceInfo.types, resource.getType()));
+ resourceRef.setResType(chooseType(module.getClassLoader(), resourceInfo, resource.getType()));
if (shouldGenerateJdbcUrl) {
properties.remove(ORIGIN_FLAG);
@@ -1009,15 +1009,15 @@ public class AutoConfig implements DynamicDeployer, JndiConstants {
}
}
- private static String chooseType(final ClassLoader classLoader, final List<String> types, final String defaultType) {
- if (types != null) {
- for (final String type : types) {
+ private static String chooseType(final ClassLoader classLoader, final ResourceInfo info, final String defaultType) {
+ if (info.types != null) {
+ for (final String type : info.types) {
if (canLoad(classLoader, type)) {
return type;
}
}
}
- return defaultType;
+ return info.className != null ? ((canLoad(classLoader, info.className) ? info.className : defaultType)) : defaultType;
}
private static boolean canLoad(final ClassLoader classLoader, final String type) {