geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r371145 - in /geronimo/trunk/modules: connector-builder/src/test/org/apache/geronimo/connector/deployment/ j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/ jetty-builder/s...
Date Sun, 22 Jan 2006 00:06:41 GMT
Author: djencks
Date: Sat Jan 21 16:06:27 2006
New Revision: 371145

URL: http://svn.apache.org/viewcvs?rev=371145&view=rev
Log:
GERONIMO-1523 Avoid serializing openejb class in all enc contexts

Added:
    geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/reference/HandleDelegateReference.java
Modified:
    geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java
    geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EJBReferenceBuilder.java
    geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/RefContext.java
    geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/UnavailableEJBReferenceBuilder.java
    geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EJBRefContextTest.java
    geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java
    geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
    geronimo/trunk/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java
    geronimo/trunk/modules/naming-builder/src/test/org/apache/geronimo/naming/deployment/MessageDestinationTest.java
    geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/java/ComponentContextBuilder.java
    geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java

Modified: geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java?rev=371145&r1=371144&r2=371145&view=diff
==============================================================================
--- geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java
(original)
+++ geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java
Sat Jan 21 16:06:27 2006
@@ -114,10 +114,6 @@
             return null;
         }
 
-        public Object createHandleDelegateReference() {
-            return null;
-        }
-
         public Reference getImplicitEJBRemoteRef(URI module, String refName, boolean isSession,
String home, String remote, NamingContext context) {
             return null;
         }

Modified: geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EJBReferenceBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EJBReferenceBuilder.java?rev=371145&r1=371144&r2=371145&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EJBReferenceBuilder.java
(original)
+++ geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EJBReferenceBuilder.java
Sat Jan 21 16:06:27 2006
@@ -35,8 +35,6 @@
 
     Reference createCORBAReference(URI corbaURL, String objectName, ObjectName containerName,
String home) throws DeploymentException;
 
-    Object createHandleDelegateReference() throws DeploymentException;
-
     Reference getImplicitEJBRemoteRef(URI module, String refName, boolean isSession, String
home, String remote, NamingContext context) throws DeploymentException;
 
     Reference getImplicitEJBLocalRef(URI module, String refName, boolean isSession, String
localHome, String local, NamingContext context) throws DeploymentException;

Modified: geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/RefContext.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/RefContext.java?rev=371145&r1=371144&r2=371145&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/RefContext.java
(original)
+++ geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/RefContext.java
Sat Jan 21 16:06:27 2006
@@ -16,17 +16,6 @@
  */
 package org.apache.geronimo.j2ee.deployment;
 
-import java.net.URI;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.HashMap;
-import java.util.Iterator;
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-import javax.naming.Reference;
-import javax.xml.namespace.QName;
-
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.common.UnresolvedReferenceException;
 import org.apache.geronimo.deployment.DeploymentContext;
@@ -35,7 +24,17 @@
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.xbeans.j2ee.MessageDestinationType;
+
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+import javax.naming.Reference;
+import javax.xml.namespace.QName;
+import java.net.URI;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
 
 
 /**
@@ -97,10 +96,6 @@
         return ejbReferenceBuilder.createEJBLocalReference(objectName, null, isSession, localHome,
local);
     }
 
-    public Object getHandleDelegateReference() throws DeploymentException {
-        return ejbReferenceBuilder.createHandleDelegateReference();
-    }
-
     public Reference getEJBRemoteRef(URI module, String ejbLink, boolean isSession, String
home, String remote, NamingContext namingContext) throws DeploymentException {
         GBeanData containerData = locateEjbInApplication(namingContext, isSession, ejbLink,
module);
         return ejbReferenceBuilder.createEJBRemoteReference(containerData.getName().getCanonicalName(),
containerData, isSession, home, remote);
@@ -145,7 +140,7 @@
             if (destinations == null) {
                 StringBuffer sb = new StringBuffer();
                 for (Iterator mapIterator = messageDestinations.keySet().iterator(); mapIterator.hasNext();)
{
-                    sb.append((String) mapIterator.next() + "\n");
+                    sb.append((String) mapIterator.next()).append("\n");
                 }
                 throw new DeploymentException("Unknown module " + targetModule + " when processing
message destination " + messageDestinationLink +
                         "\nKnown modules in deployable unit are:\n" + sb.toString());
@@ -206,7 +201,7 @@
     }
 
     public String getMEJBName() throws DeploymentException {
-        ObjectName query = null;
+        ObjectName query;
         try {
             query = ObjectName.getInstance("*:name=ejb/mgmt/MEJB,*");
         } catch (MalformedObjectNameException e) {
@@ -286,7 +281,7 @@
     }
 
     private GBeanData locateGBeanInContext(String moduleType, String moduleName, String name,
String type, J2eeContext j2eeContext, String queryType, NamingContext context, boolean requireMatch)
throws UnresolvedReferenceException {
-        ObjectName query = null;
+        ObjectName query;
         //TODO make sure this is reasonable
         if (moduleType == null) {
             moduleName = "*";

Modified: geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/UnavailableEJBReferenceBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/UnavailableEJBReferenceBuilder.java?rev=371145&r1=371144&r2=371145&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/UnavailableEJBReferenceBuilder.java
(original)
+++ geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/UnavailableEJBReferenceBuilder.java
Sat Jan 21 16:06:27 2006
@@ -43,10 +43,6 @@
         throw new DeploymentException("EJB references are unavailable in this configuration");
     }
 
-    public Object createHandleDelegateReference() throws DeploymentException {
-        throw new DeploymentException("EJB references are unavailable in this configuration");
-    }
-
     public Reference getImplicitEJBRemoteRef(URI module, String refName, boolean isSession,
String home, String remote, NamingContext context) throws DeploymentException {
         throw new DeploymentException("EJB references are unavailable in this configuration");
     }

Modified: geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EJBRefContextTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EJBRefContextTest.java?rev=371145&r1=371144&r2=371145&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EJBRefContextTest.java
(original)
+++ geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EJBRefContextTest.java
Sat Jan 21 16:06:27 2006
@@ -81,10 +81,6 @@
                 return new FakeReference(objectName);
             }
 
-            public Object createHandleDelegateReference() {
-                return null;
-            }
-
             public Reference getImplicitEJBRemoteRef(URI module, String refName, boolean
isSession, String home, String remote, NamingContext context) throws DeploymentException {
                 return null;
             }

Modified: geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java?rev=371145&r1=371144&r2=371145&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java
(original)
+++ geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java
Sat Jan 21 16:06:27 2006
@@ -87,10 +87,6 @@
         return null;
     }
 
-    public Object createHandleDelegateReference() {
-        return null;
-    }
-
     public Reference getImplicitEJBRemoteRef(URI module, String refName, boolean isSession,
String home, String remote, NamingContext context) throws DeploymentException {
         return null;
     }

Modified: geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java?rev=371145&r1=371144&r2=371145&view=diff
==============================================================================
--- geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
(original)
+++ geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
Sat Jan 21 16:06:27 2006
@@ -177,10 +177,6 @@
                         return null;
                     }
 
-                    public Object createHandleDelegateReference() {
-                        return null;
-                    }
-
                     public Reference getImplicitEJBRemoteRef(URI module, String refName,
boolean isSession, String home, String remote, NamingContext context) throws DeploymentException
{
                         return null;
                     }

Modified: geronimo/trunk/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java?rev=371145&r1=371144&r2=371145&view=diff
==============================================================================
--- geronimo/trunk/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java
(original)
+++ geronimo/trunk/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java
Sat Jan 21 16:06:27 2006
@@ -759,11 +759,7 @@
                 corbaGBean = refContext.locateUniqueName(earContext, corbaGBean);
             }
             builder.addORB(corbaGBean);
-        }
-
-        Object handleDelegateReference = earContext.getRefContext().getHandleDelegateReference();
-        if (handleDelegateReference != null) {
-            builder.addHandleDelegateReference(handleDelegateReference);
+            builder.addHandleDelegateReference(corbaGBean);
         }
 
         URI moduleURI = module.getConfigId();

Modified: geronimo/trunk/modules/naming-builder/src/test/org/apache/geronimo/naming/deployment/MessageDestinationTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/naming-builder/src/test/org/apache/geronimo/naming/deployment/MessageDestinationTest.java?rev=371145&r1=371144&r2=371145&view=diff
==============================================================================
--- geronimo/trunk/modules/naming-builder/src/test/org/apache/geronimo/naming/deployment/MessageDestinationTest.java
(original)
+++ geronimo/trunk/modules/naming-builder/src/test/org/apache/geronimo/naming/deployment/MessageDestinationTest.java
Sat Jan 21 16:06:27 2006
@@ -64,10 +64,6 @@
                 return null;
             }
 
-            public Object createHandleDelegateReference() throws DeploymentException {
-                return null;
-            }
-
             public Reference getImplicitEJBRemoteRef(URI module, String refName, boolean
isSession, String home, String remote, NamingContext context) throws DeploymentException {
                 return null;
             }

Modified: geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/java/ComponentContextBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/java/ComponentContextBuilder.java?rev=371145&r1=371144&r2=371145&view=diff
==============================================================================
--- geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/java/ComponentContextBuilder.java
(original)
+++ geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/java/ComponentContextBuilder.java
Sat Jan 21 16:06:27 2006
@@ -28,6 +28,7 @@
 import org.apache.geronimo.naming.reference.GBeanProxyReference;
 import org.apache.geronimo.naming.reference.KernelReference;
 import org.apache.geronimo.naming.reference.ORBReference;
+import org.apache.geronimo.naming.reference.HandleDelegateReference;
 
 /**
  * TODO consider removing this class. The only purpose is to slightly hide the internalBind
method.
@@ -50,8 +51,8 @@
         context.put("ORB", new ORBReference(corbaGBeanObjectName));
     }
 
-    public void addHandleDelegateReference(Object handleDelegateReference) {
-        context.put("HandleDelegate", handleDelegateReference);
+    public void addHandleDelegateReference(ObjectName corbaGBeanObjectName) {
+        context.put("HandleDelegate", new HandleDelegateReference(corbaGBeanObjectName));
     }
 
     public void bind(String name, Object value) {

Added: geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/reference/HandleDelegateReference.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/reference/HandleDelegateReference.java?rev=371145&view=auto
==============================================================================
--- geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/reference/HandleDelegateReference.java
(added)
+++ geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/reference/HandleDelegateReference.java
Sat Jan 21 16:06:27 2006
@@ -0,0 +1,47 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ *  Licensed 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.naming.reference;
+
+import javax.management.ObjectName;
+import javax.naming.NameNotFoundException;
+import javax.naming.NamingException;
+
+import org.apache.geronimo.kernel.Kernel;
+
+/**
+ * @version $Rev: 356097 $ $Date: 2005-12-11 17:29:03 -0800 (Sun, 11 Dec 2005) $
+ */
+public class HandleDelegateReference extends SimpleAwareReference {
+    private final ObjectName corbaGBean;
+
+    public HandleDelegateReference(ObjectName corbaGBean) {
+        this.corbaGBean = corbaGBean;
+    }
+
+    public String getClassName() {
+        return "javax.ejb.spi.HandleDelegate";
+    }
+
+    public Object getContent() throws NamingException {
+        Kernel kernel = getKernel();
+        try {
+            return kernel.getAttribute(corbaGBean, "handleDelegate");
+        } catch (Exception e) {
+            throw (NameNotFoundException) new NameNotFoundException("Error getting ORB attribut
from CORBAGBean: objectName=" + corbaGBean).initCause(e);
+        }
+    }
+}

Modified: geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java?rev=371145&r1=371144&r2=371145&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
(original)
+++ geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
Sat Jan 21 16:06:27 2006
@@ -243,10 +243,6 @@
                         return null;
                     }
 
-                    public Object createHandleDelegateReference() {
-                        return null;
-                    }
-
                     public Reference getImplicitEJBRemoteRef(URI module, String refName,
boolean isSession, String home, String remote, NamingContext context) throws DeploymentException
{
                         return null;
                     }



Mime
View raw message