Repository: tomee
Updated Branches:
  refs/heads/master 00ce92127 -> 50339ce99


fixing resource ids passed to container for post construct method - not sure 
why it slipped through


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/50339ce9
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/50339ce9
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/50339ce9

Branch: refs/heads/master
Commit: 50339ce992d03458be065f1fe0da621730a3daaa
Parents: 00ce921
Author: Romain Manni-Bucau <rmannibu...@apache.org>
Authored: Wed Apr 29 13:18:04 2015 +0200
Committer: Romain Manni-Bucau <rmannibu...@apache.org>
Committed: Wed Apr 29 13:18:04 2015 +0200

----------------------------------------------------------------------
 .../org/apache/openejb/assembler/classic/Assembler.java     | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/50339ce9/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
----------------------------------------------------------------------
diff --git 
a/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
 
b/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
index 5e50b64..840a42d 100644
--- 
a/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
+++ 
b/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
@@ -549,6 +549,7 @@ public class Assembler extends AssemblerTool implements 
org.apache.openejb.spi.A
         final Set<String> rIds = new 
HashSet<>(configInfo.facilities.resources.size());
         for (final ResourceInfo resourceInfo : 
configInfo.facilities.resources) {
             createResource(resourceInfo);
+            rIds.add(resourceInfo.id);
         }
         postConstructResources(rIds, ParentClassLoaderFinder.Helper.get(), 
systemInstance.getComponent(ContainerSystem.class).getJNDIContext(), null);
 
@@ -1105,17 +1106,21 @@ public class Assembler extends AssemblerTool implements 
org.apache.openejb.spi.A
         }
     }
 
-    private void postConstructResources(final Set<String> inResourceIds, final 
ClassLoader classLoader, final Context containerSystemContext, final AppContext 
appContext) throws NamingException, OpenEJBException {
+    private void postConstructResources(
+            final Set<String> resourceIds, final ClassLoader classLoader,
+            final Context containerSystemContext, final AppContext appContext) 
throws NamingException, OpenEJBException {
         final Thread thread = Thread.currentThread();
         final ClassLoader oldCl = thread.getContextClassLoader();
 
         try {
             thread.setContextClassLoader(classLoader);
 
-            final Set<String> resourceIds = new HashSet<>(inResourceIds);
             final List<ResourceInfo> resourceList = 
config.facilities.resources;
 
             for (final ResourceInfo resourceInfo : resourceList) {
+                if (!resourceIds.contains(resourceInfo.id)) {
+                    continue;
+                }
                 if (isTemplatizedResource(resourceInfo)) {
                     continue;
                 }

Reply via email to