geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r707858 - in /geronimo/server/branches/2.1: ./ framework/configs/geronimo-gbean-deployer/src/it/j2ee-system/ framework/configs/geronimo-gbean-deployer/src/it/j2ee-system/src/test/resources/META-INF/ framework/modules/geronimo-kernel/src/mai...
Date Sat, 25 Oct 2008 16:18:41 GMT
Author: djencks
Date: Sat Oct 25 09:18:34 2008
New Revision: 707858

URL: http://svn.apache.org/viewvc?rev=707858&view=rev
Log:
GERONIMO-4375 upgrade xbean to make rebind of auto-bound jca stuff work, fix related upgrade
incompatibilies

Added:
    geronimo/server/branches/2.1/framework/modules/geronimo-naming/src/test/java/org/apache/geronimo/gjndi/MockResourceSource.java
  (with props)
Modified:
    geronimo/server/branches/2.1/framework/configs/geronimo-gbean-deployer/src/it/j2ee-system/pom.xml
    geronimo/server/branches/2.1/framework/configs/geronimo-gbean-deployer/src/it/j2ee-system/src/test/resources/META-INF/geronimo-plugin.xml
    geronimo/server/branches/2.1/framework/configs/geronimo-gbean-deployer/src/it/j2ee-system/src/test/resources/META-INF/plan.xml
    geronimo/server/branches/2.1/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/classloader/TemporaryClassLoader.java
    geronimo/server/branches/2.1/framework/modules/geronimo-naming/src/test/java/org/apache/geronimo/gjndi/JavaCompContextTest.java
    geronimo/server/branches/2.1/framework/modules/geronimo-naming/src/test/java/org/apache/geronimo/gjndi/KernelContextGBeanTest.java
    geronimo/server/branches/2.1/plugins/client/geronimo-client/src/main/java/org/apache/geronimo/client/AppClientContainer.java
    geronimo/server/branches/2.1/plugins/j2ee/j2ee-deployer/pom.xml
    geronimo/server/branches/2.1/pom.xml

Modified: geronimo/server/branches/2.1/framework/configs/geronimo-gbean-deployer/src/it/j2ee-system/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/framework/configs/geronimo-gbean-deployer/src/it/j2ee-system/pom.xml?rev=707858&r1=707857&r2=707858&view=diff
==============================================================================
--- geronimo/server/branches/2.1/framework/configs/geronimo-gbean-deployer/src/it/j2ee-system/pom.xml
(original)
+++ geronimo/server/branches/2.1/framework/configs/geronimo-gbean-deployer/src/it/j2ee-system/pom.xml
Sat Oct 25 09:18:34 2008
@@ -39,7 +39,7 @@
             <artifactId>geronimo-gbean-deployer</artifactId>
             <version>${version}</version>
             <type>car</type>
-            <scope>test</scope>
+            <scope>provided</scope>
         </dependency>
 
         <dependency>
@@ -261,7 +261,7 @@
                         <dependency>
                             <groupId>asm</groupId>
                             <artifactId>asm</artifactId>
-                            <version>2.2.3</version>
+                            <version>3.1</version>
                             <type>jar</type>
                             <import>classes</import>
                         </dependency>
@@ -275,7 +275,7 @@
                         <dependency>
                             <groupId>asm</groupId>
                             <artifactId>asm-commons</artifactId>
-                            <version>2.2.3</version>
+                            <version>3.1</version>
                             <type>jar</type>
                             <import>classes</import>
                         </dependency>

Modified: geronimo/server/branches/2.1/framework/configs/geronimo-gbean-deployer/src/it/j2ee-system/src/test/resources/META-INF/geronimo-plugin.xml
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/framework/configs/geronimo-gbean-deployer/src/it/j2ee-system/src/test/resources/META-INF/geronimo-plugin.xml?rev=707858&r1=707857&r2=707858&view=diff
==============================================================================
--- geronimo/server/branches/2.1/framework/configs/geronimo-gbean-deployer/src/it/j2ee-system/src/test/resources/META-INF/geronimo-plugin.xml
(original)
+++ geronimo/server/branches/2.1/framework/configs/geronimo-gbean-deployer/src/it/j2ee-system/src/test/resources/META-INF/geronimo-plugin.xml
Sat Oct 25 09:18:34 2008
@@ -68,7 +68,7 @@
         <dependency start="false">
             <groupId>asm</groupId>
             <artifactId>asm</artifactId>
-            <version>2.2.3</version>
+            <version>3.1</version>
             <type>jar</type>
         </dependency>
         <dependency start="false">
@@ -80,7 +80,7 @@
         <dependency start="false">
             <groupId>asm</groupId>
             <artifactId>asm-commons</artifactId>
-            <version>2.2.3</version>
+            <version>3.1</version>
             <type>jar</type>
         </dependency>
         <dependency start="false">

Modified: geronimo/server/branches/2.1/framework/configs/geronimo-gbean-deployer/src/it/j2ee-system/src/test/resources/META-INF/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/framework/configs/geronimo-gbean-deployer/src/it/j2ee-system/src/test/resources/META-INF/plan.xml?rev=707858&r1=707857&r2=707858&view=diff
==============================================================================
--- geronimo/server/branches/2.1/framework/configs/geronimo-gbean-deployer/src/it/j2ee-system/src/test/resources/META-INF/plan.xml
(original)
+++ geronimo/server/branches/2.1/framework/configs/geronimo-gbean-deployer/src/it/j2ee-system/src/test/resources/META-INF/plan.xml
Sat Oct 25 09:18:34 2008
@@ -74,7 +74,7 @@
       <dependency>
         <groupId>asm</groupId>
         <artifactId>asm</artifactId>
-        <version>2.2.3</version>
+        <version>3.1</version>
         <type>jar</type>
         <import>classes</import>
       </dependency>
@@ -88,7 +88,7 @@
       <dependency>
         <groupId>asm</groupId>
         <artifactId>asm-commons</artifactId>
-        <version>2.2.3</version>
+        <version>3.1</version>
         <type>jar</type>
         <import>classes</import>
       </dependency>

Modified: geronimo/server/branches/2.1/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/classloader/TemporaryClassLoader.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/classloader/TemporaryClassLoader.java?rev=707858&r1=707857&r2=707858&view=diff
==============================================================================
--- geronimo/server/branches/2.1/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/classloader/TemporaryClassLoader.java
(original)
+++ geronimo/server/branches/2.1/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/classloader/TemporaryClassLoader.java
Sat Oct 25 09:18:34 2008
@@ -129,7 +129,7 @@
    private static boolean isAnnotationClass(byte[] bytes) {
        IsAnnotationVisitor isAnnotationVisitor = new IsAnnotationVisitor();
        ClassReader classReader = new ClassReader(bytes);
-       classReader.accept(isAnnotationVisitor, true);
+       classReader.accept(isAnnotationVisitor, ClassReader.SKIP_DEBUG);
        return isAnnotationVisitor.isAnnotation;
    }
 

Modified: geronimo/server/branches/2.1/framework/modules/geronimo-naming/src/test/java/org/apache/geronimo/gjndi/JavaCompContextTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/framework/modules/geronimo-naming/src/test/java/org/apache/geronimo/gjndi/JavaCompContextTest.java?rev=707858&r1=707857&r2=707858&view=diff
==============================================================================
--- geronimo/server/branches/2.1/framework/modules/geronimo-naming/src/test/java/org/apache/geronimo/gjndi/JavaCompContextTest.java
(original)
+++ geronimo/server/branches/2.1/framework/modules/geronimo-naming/src/test/java/org/apache/geronimo/gjndi/JavaCompContextTest.java
Sat Oct 25 09:18:34 2008
@@ -195,7 +195,7 @@
         RootContext.setComponentContext(readOnlyContext);
 
         Context javaCompContext = new JavaCompContextGBean();
-        Context globalContext = new ImmutableContext(Collections.singletonMap(javaCompContext.getNameInNamespace(),
javaCompContext));
+        Context globalContext = new ImmutableContext(Collections.<String, Object>singletonMap(javaCompContext.getNameInNamespace(),
javaCompContext));
         GlobalContextManager.setGlobalContext(globalContext);
 
         initialContext = new InitialContext();

Modified: geronimo/server/branches/2.1/framework/modules/geronimo-naming/src/test/java/org/apache/geronimo/gjndi/KernelContextGBeanTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/framework/modules/geronimo-naming/src/test/java/org/apache/geronimo/gjndi/KernelContextGBeanTest.java?rev=707858&r1=707857&r2=707858&view=diff
==============================================================================
--- geronimo/server/branches/2.1/framework/modules/geronimo-naming/src/test/java/org/apache/geronimo/gjndi/KernelContextGBeanTest.java
(original)
+++ geronimo/server/branches/2.1/framework/modules/geronimo-naming/src/test/java/org/apache/geronimo/gjndi/KernelContextGBeanTest.java
Sat Oct 25 09:18:34 2008
@@ -16,10 +16,21 @@
  */
 package org.apache.geronimo.gjndi;
 
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.sql.DataSource;
+
+import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
-import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.KernelFactory;
 import org.apache.geronimo.kernel.config.ConfigurationData;
@@ -30,17 +41,11 @@
 import org.apache.geronimo.kernel.repository.DefaultArtifactManager;
 import org.apache.geronimo.kernel.repository.DefaultArtifactResolver;
 import org.apache.geronimo.naming.java.RootContext;
+import org.apache.geronimo.gjndi.binding.GBeanFormatBinding;
+import org.apache.geronimo.gjndi.binding.ResourceBinding;
 import org.apache.xbean.naming.context.ImmutableContext;
 import org.apache.xbean.naming.global.GlobalContextManager;
 
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Map;
-import java.util.Iterator;
-import java.util.Collections;
-
 /**
  * @version $Rev$ $Date$
  */
@@ -52,13 +57,15 @@
     private Hashtable contextEnv;
 
     public void test() throws Exception {
-        Map globalBindings = new HashMap();
-        globalBindings.put("java:comp/string", "foo");
-        globalBindings.put("java:comp/nested/context/string", "bar");
-        globalBindings.put("java:comp/a/b/c/d/e/string", "beer");
-        globalBindings.put("java:comp/a/b/c/d/e/one", new Integer(1));
-        globalBindings.put("java:comp/a/b/c/d/e/two", new Integer(2));
-        globalBindings.put("java:comp/a/b/c/d/e/three", new Integer(3));
+        HashMap javaCompOnlyBindings = new HashMap();
+        javaCompOnlyBindings.put("java:comp/string", "foo");
+        javaCompOnlyBindings.put("java:comp/nested/context/string", "bar");
+        javaCompOnlyBindings.put("java:comp/a/b/c/d/e/string", "beer");
+        javaCompOnlyBindings.put("java:comp/a/b/c/d/e/one", new Integer(1));
+        javaCompOnlyBindings.put("java:comp/a/b/c/d/e/two", new Integer(2));
+        javaCompOnlyBindings.put("java:comp/a/b/c/d/e/three", new Integer(3));
+
+        Map globalBindings = new HashMap(javaCompOnlyBindings);
         globalBindings.put("test/env/foo", new Integer(42));
         globalBindings.put("test/baz", "caz");
 
@@ -86,9 +93,7 @@
         //
         kernel.stopGBean(testName);
 
-        HashMap javaCompOnlyBindings = new HashMap(globalBindings);
-        javaCompOnlyBindings.remove("test/env/foo");
-        javaCompOnlyBindings.remove("test/baz");
+
         assertEq(javaCompOnlyBindings, ctx);
 
         //
@@ -98,7 +103,6 @@
 
         assertEq(Collections.EMPTY_MAP, ctx);
 
-
         //
         // restart java context
         //
@@ -114,6 +118,45 @@
         assertEq(globalBindings, ctx);
     }
 
+    public void testGBeanFormatBinding() throws Exception {
+        setUpJcaContext();
+        configurationManager.loadConfiguration(configurationData);
+        configurationManager.startConfiguration(configurationData.getId());
+
+        InitialContext ctx = new InitialContext(contextEnv);
+        Context fooCtx = ctx.createSubcontext("jca:foo");
+        fooCtx.createSubcontext("bar");
+        ctx.bind("jca:foo/bar/baz", 1);
+        assertEquals(ctx.lookup("jca:foo/bar/baz"), 1);
+        ctx.rebind("jca:foo/bar/baz", 2);
+        assertEquals(ctx.lookup("jca:foo/bar/baz"), 2);
+
+    }
+
+    public void testGBeanFormatReBinding() throws Exception {
+        setUpJcaContext();
+        configurationData.addGBean("resourceSource", MockResourceSource.GBEAN_INFO);
+
+        configurationManager.loadConfiguration(configurationData);
+        configurationManager.startConfiguration(configurationData.getId());
+
+        InitialContext ctx = new InitialContext(contextEnv);
+        assertTrue(ctx.lookup("jca:/test/test/GBean/resourceSource") instanceof DataSource);
+        Context context = (Context)ctx.lookup("jca:/test/test");
+        assertTrue(context.lookup("GBean/resourceSource") instanceof DataSource);
+
+        ctx.rebind("jca:/test/test/GBean/resourceSource", 2);
+        assertEquals(2, ctx.lookup("jca:/test/test/GBean/resourceSource"));
+
+    }
+
+    private void setUpJcaContext() {
+        GBeanData jca = configurationData.addGBean("jca", ResourceBinding.GBEAN_INFO);
+        jca.setAttribute("format","{groupId}/{artifactId}/{j2eeType}/{name}");
+        jca.setAttribute("nameInNamespace", "jca:");
+        jca.setAttribute("abstractNameQuery", new AbstractNameQuery("org.apache.geronimo.naming.ResourceSource"));
+    }
+
     protected Map getNestedBindings(Map globalBindings, String nestedPath) {
         HashMap nestedBindings = new HashMap();
         for (Iterator iterator = globalBindings.entrySet().iterator(); iterator.hasNext();)
{
@@ -154,7 +197,7 @@
         configurationData.addGBean("GlobalContext", GlobalContextGBean.GBEAN_INFO);
 
         GBeanInfoBuilder builder = new GBeanInfoBuilder(ImmutableContext.class);
-        builder.setConstructor(new String[] {"nameInNamespace", "bindings", "cacheReferences"});
+        builder.setConstructor(new String[]{"nameInNamespace", "bindings", "cacheReferences"});
         builder.addAttribute("nameInNamespace", String.class, true);
         builder.addAttribute("bindings", Map.class, true);
         builder.addAttribute("cacheReferences", boolean.class, true);

Added: geronimo/server/branches/2.1/framework/modules/geronimo-naming/src/test/java/org/apache/geronimo/gjndi/MockResourceSource.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/framework/modules/geronimo-naming/src/test/java/org/apache/geronimo/gjndi/MockResourceSource.java?rev=707858&view=auto
==============================================================================
--- geronimo/server/branches/2.1/framework/modules/geronimo-naming/src/test/java/org/apache/geronimo/gjndi/MockResourceSource.java
(added)
+++ geronimo/server/branches/2.1/framework/modules/geronimo-naming/src/test/java/org/apache/geronimo/gjndi/MockResourceSource.java
Sat Oct 25 09:18:34 2008
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+package org.apache.geronimo.gjndi;
+
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.naming.ResourceSource;
+import org.apache.geronimo.gjndi.binding.MockDataSource;
+
+
+/**
+ * @version $Rev$ $Date$
+ */
+
+public class MockResourceSource implements ResourceSource {
+    
+    public Object $getResource() throws Throwable {
+        return new MockDataSource();
+    }
+    
+    public static final GBeanInfo GBEAN_INFO;
+
+    public static GBeanInfo getGBeanInfo() {
+        return MockDataSource.GBEAN_INFO;
+    }
+
+    static {
+        GBeanInfoBuilder builder = GBeanInfoBuilder.createStatic(MockResourceSource.class,
"GBean");
+        GBEAN_INFO = builder.getBeanInfo();
+    }
+}

Propchange: geronimo/server/branches/2.1/framework/modules/geronimo-naming/src/test/java/org/apache/geronimo/gjndi/MockResourceSource.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/2.1/framework/modules/geronimo-naming/src/test/java/org/apache/geronimo/gjndi/MockResourceSource.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/branches/2.1/framework/modules/geronimo-naming/src/test/java/org/apache/geronimo/gjndi/MockResourceSource.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/branches/2.1/plugins/client/geronimo-client/src/main/java/org/apache/geronimo/client/AppClientContainer.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/client/geronimo-client/src/main/java/org/apache/geronimo/client/AppClientContainer.java?rev=707858&r1=707857&r2=707858&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/client/geronimo-client/src/main/java/org/apache/geronimo/client/AppClientContainer.java
(original)
+++ geronimo/server/branches/2.1/plugins/client/geronimo-client/src/main/java/org/apache/geronimo/client/AppClientContainer.java
Sat Oct 25 09:18:34 2008
@@ -134,11 +134,11 @@
                 clientSubject = loginContext.getSubject();
             }
             ContextManager.setCallers(clientSubject, clientSubject);
-            ObjectRecipe objectRecipe = new ObjectRecipe(mainClassName);
+            Class mainClass = classLoader.loadClass(mainClassName);
+            ObjectRecipe objectRecipe = new ObjectRecipe(mainClass);
             objectRecipe.allow(Option.FIELD_INJECTION);
             objectRecipe.allow(Option.PRIVATE_PROPERTIES);
             objectRecipe.allow(Option.STATIC_PROPERTIES);
-            Class mainClass = classLoader.loadClass(mainClassName);
             List<Injection> injections = new ArrayList<Injection>();
             while (mainClass != null && mainClass != Object.class) {
                 List<Injection> perClass = holder.getInjections(mainClass.getName());
@@ -170,7 +170,7 @@
                     throw new Exception("Some objects to be injected were not found in jndi:
" + problems);
                 }
             }
-            Class clazz = objectRecipe.setStaticProperties(classLoader);
+            Class clazz = objectRecipe.setStaticProperties();
             if (holder.getPostConstruct() != null) {
                 Holder.apply(null, clazz, holder.getPostConstruct());
             }

Modified: geronimo/server/branches/2.1/plugins/j2ee/j2ee-deployer/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/j2ee/j2ee-deployer/pom.xml?rev=707858&r1=707857&r2=707858&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/j2ee/j2ee-deployer/pom.xml (original)
+++ geronimo/server/branches/2.1/plugins/j2ee/j2ee-deployer/pom.xml Sat Oct 25 09:18:34 2008
@@ -211,7 +211,7 @@
                         <dependency>
                             <groupId>org.apache.xbean</groupId>
                             <artifactId>xbean-finder</artifactId>
-                            <version>3.3</version>
+                            <version>${xbeanVersion}</version>
                             <type>jar</type>
                             <import>classes</import>
                         </dependency>

Modified: geronimo/server/branches/2.1/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/pom.xml?rev=707858&r1=707857&r2=707858&view=diff
==============================================================================
--- geronimo/server/branches/2.1/pom.xml (original)
+++ geronimo/server/branches/2.1/pom.xml Sat Oct 25 09:18:34 2008
@@ -82,7 +82,7 @@
         <springVersion>2.0.5</springVersion>
         <plutoVersion>1.1.6-G643117</plutoVersion>
         <openjpaVersion>1.2.0</openjpaVersion>
-        <xbeanVersion>3.3</xbeanVersion>
+        <xbeanVersion>3.5-SNAPSHOT</xbeanVersion>
         <wadiVersion>2.0</wadiVersion>
 
         <!-- Deployers -->
@@ -347,13 +347,19 @@
             <dependency>
                 <groupId>asm</groupId>
                 <artifactId>asm</artifactId>
-                <version>2.2.3</version>
+                <version>3.1</version>
             </dependency>
 
             <dependency>
                 <groupId>asm</groupId>
                 <artifactId>asm-commons</artifactId>
-                <version>2.2.3</version>
+                <version>3.1</version>
+                <exclusions>
+                    <exclusion>
+                        <groupId>asm</groupId>
+                        <artifactId>asm-tree</artifactId>
+                    </exclusion>
+                </exclusions>
             </dependency>
 
             <dependency>



Mime
View raw message