geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r153894 - in geronimo/trunk: itests/naming/common/ itests/naming/common/src/java/org/apache/notgeronimo/itests/naming/common/ itests/naming/war/src/java/org/apache/geronimo/itests/naming/war/ itests/naming/war/src/webapp/WEB-INF/ modules/assembly/src/plan/ modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/ modules/j2ee/src/java/org/apache/geronimo/j2ee/mejb/ modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/ modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/
Date Tue, 15 Feb 2005 04:38:28 GMT
Author: djencks
Date: Mon Feb 14 20:38:25 2005
New Revision: 153894

URL: http://svn.apache.org/viewcvs?view=rev&rev=153894
Log:
move stuff around to help in deploying MEJB, MEJB itest

Modified:
    geronimo/trunk/itests/naming/common/project.xml
    geronimo/trunk/itests/naming/common/src/java/org/apache/notgeronimo/itests/naming/common/Test.java
    geronimo/trunk/itests/naming/war/src/java/org/apache/geronimo/itests/naming/war/NamingTestServlet.java
    geronimo/trunk/itests/naming/war/src/webapp/WEB-INF/web.xml
    geronimo/trunk/modules/assembly/src/plan/j2ee-server-plan.xml
    geronimo/trunk/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
    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/EARConfigBuilder.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/ResourceReferenceBuilder.java
    geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EJBRefContextTest.java
    geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/mejb/MEJB.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

Modified: geronimo/trunk/itests/naming/common/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/itests/naming/common/project.xml?view=diff&r1=153893&r2=153894
==============================================================================
--- geronimo/trunk/itests/naming/common/project.xml (original)
+++ geronimo/trunk/itests/naming/common/project.xml Mon Feb 14 20:38:25 2005
@@ -104,8 +104,20 @@
 
         <dependency>
             <groupId>geronimo-spec</groupId>
+            <artifactId>geronimo-spec-ejb</artifactId>
+            <version>${geronimo_spec_ejb_version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo-spec</groupId>
             <artifactId>geronimo-spec-jms</artifactId>
             <version>${geronimo_spec_jms_version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo-spec</groupId>
+            <artifactId>geronimo-spec-j2ee-management</artifactId>
+            <version>${geronimo_spec_j2ee_management_version}</version>
         </dependency>
 
     </dependencies>

Modified: geronimo/trunk/itests/naming/common/src/java/org/apache/notgeronimo/itests/naming/common/Test.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/itests/naming/common/src/java/org/apache/notgeronimo/itests/naming/common/Test.java?view=diff&r1=153893&r2=153894
==============================================================================
--- geronimo/trunk/itests/naming/common/src/java/org/apache/notgeronimo/itests/naming/common/Test.java
(original)
+++ geronimo/trunk/itests/naming/common/src/java/org/apache/notgeronimo/itests/naming/common/Test.java
Mon Feb 14 20:38:25 2005
@@ -22,6 +22,8 @@
 import javax.jms.Topic;
 import javax.jms.Queue;
 import javax.jms.ConnectionFactory;
+import javax.management.j2ee.Management;
+import javax.management.j2ee.ManagementHome;
 
 import org.apache.notgeronimo.itests.naming.common.webservice.interop.InteropLab;
 import org.apache.notgeronimo.itests.naming.common.webservice.interop.InteropTestPortType;
@@ -58,5 +60,13 @@
          o = initialContext.lookup("java:comp/env/jms/Topic");
          Topic jmsTopic = (Topic) o;
      }
-    
+
+    public void testMEJBLookup() throws Exception {
+        InitialContext initialContext = new InitialContext();
+        Object o = initialContext.lookup("java:comp/env/ejb/mgmt/MEJB");
+        ManagementHome home = (ManagementHome)o;
+        Management mejb = home.create();
+        mejb.getMBeanCount();
+    }
+
 }

Modified: geronimo/trunk/itests/naming/war/src/java/org/apache/geronimo/itests/naming/war/NamingTestServlet.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/itests/naming/war/src/java/org/apache/geronimo/itests/naming/war/NamingTestServlet.java?view=diff&r1=153893&r2=153894
==============================================================================
--- geronimo/trunk/itests/naming/war/src/java/org/apache/geronimo/itests/naming/war/NamingTestServlet.java
(original)
+++ geronimo/trunk/itests/naming/war/src/java/org/apache/geronimo/itests/naming/war/NamingTestServlet.java
Mon Feb 14 20:38:25 2005
@@ -26,7 +26,8 @@
 
         Test test = new Test();
         try {
-            test.testWebServiceLookup();
+//            test.testWebServiceLookup();
+            test.testMEJBLookup();
         } catch (Exception e) {
             throw new ServletException(e);
         }

Modified: geronimo/trunk/itests/naming/war/src/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/itests/naming/war/src/webapp/WEB-INF/web.xml?view=diff&r1=153893&r2=153894
==============================================================================
--- geronimo/trunk/itests/naming/war/src/webapp/WEB-INF/web.xml (original)
+++ geronimo/trunk/itests/naming/war/src/webapp/WEB-INF/web.xml Mon Feb 14 20:38:25 2005
@@ -10,11 +10,17 @@
         <url-pattern>/</url-pattern>
     </servlet-mapping>
 
-    <service-ref>
-        <service-ref-name>service/InteropLab</service-ref-name>
-        <service-interface>org.apache.notgeronimo.itests.naming.common.webservice.interop.InteropLab</service-interface>
-        <wsdl-file>WEB-INF/wsdl/interop.wsdl</wsdl-file>
-        <jaxrpc-mapping-file>WEB-INF/wsdl/interop-jaxrpcmapping.xml</jaxrpc-mapping-file>
-        <service-qname xmlns:interop="http://tempuri.org/4s4c/1/3/wsdl/def/interopLab">interop:interopLab</service-qname>
-    </service-ref>
+<!--    <service-ref>-->
+<!--        <service-ref-name>service/InteropLab</service-ref-name>-->
+<!--        <service-interface>org.apache.notgeronimo.itests.naming.common.webservice.interop.InteropLab</service-interface>-->
+<!--        <wsdl-file>WEB-INF/wsdl/interop.wsdl</wsdl-file>-->
+<!--        <jaxrpc-mapping-file>WEB-INF/wsdl/interop-jaxrpcmapping.xml</jaxrpc-mapping-file>-->
+<!--        <service-qname xmlns:interop="http://tempuri.org/4s4c/1/3/wsdl/def/interopLab">interop:interopLab</service-qname>-->
+<!--    </service-ref>-->
+    <ejb-ref>
+        <ejb-ref-name>ejb/mgmt/MEJB</ejb-ref-name>
+        <ejb-ref-type>Session</ejb-ref-type>
+        <home>javax.management.j2ee.ManagementHome</home>
+        <remote>javax.management.j2ee.Management</remote>
+    </ejb-ref>
 </web-app>

Modified: geronimo/trunk/modules/assembly/src/plan/j2ee-server-plan.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/assembly/src/plan/j2ee-server-plan.xml?view=diff&r1=153893&r2=153894
==============================================================================
--- geronimo/trunk/modules/assembly/src/plan/j2ee-server-plan.xml (original)
+++ geronimo/trunk/modules/assembly/src/plan/j2ee-server-plan.xml Mon Feb 14 20:38:25 2005
@@ -288,4 +288,6 @@
 
     <gbean namePart="eis/JAXR" class="org.apache.geronimo.webservices.jaxr.JAXRGBean"/>
 
+    <gbean namePart="ejb/mgmt/MEJB" class="org.openejb.mejb.MEJB"/>
+
 </configuration>

Modified: geronimo/trunk/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java?view=diff&r1=153893&r2=153894
==============================================================================
--- geronimo/trunk/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
(original)
+++ geronimo/trunk/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
Mon Feb 14 20:38:25 2005
@@ -790,14 +790,6 @@
         return new ResourceReference(containerId, iface);
     }
 
-    public ObjectName locateResourceName(ObjectName query) throws DeploymentException {
-        Set names = kernel.listGBeans(query);
-        if (names.size() != 1) {
-            throw new DeploymentException("Unknown or ambiguous resource name query: " +
query + " match count: " + names.size());
-        }
-        return (ObjectName) names.iterator().next();
-    }
-
     public GBeanData locateActivationSpecInfo(ObjectName resourceAdapterModuleName, String
messageListenerInterface) throws DeploymentException {
         Map activationSpecInfos = null;
         try {

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?view=diff&r1=153893&r2=153894
==============================================================================
--- 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
Mon Feb 14 20:38:25 2005
@@ -325,7 +325,7 @@
                         null,
                         new RefContext(ejbReferenceBuilder,
                                 moduleBuilder,
-                                serviceReferenceBuilder));
+                                serviceReferenceBuilder, kernel));
 
                 action.install(moduleBuilder, earContext, module);
                 earContext.getClassLoader(null);

Modified: geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java?view=diff&r1=153893&r2=153894
==============================================================================
--- geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
(original)
+++ geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
Mon Feb 14 20:38:25 2005
@@ -286,7 +286,7 @@
                         connectionTrackerObjectName,
                         transactionalTimerObjectName,
                         nonTransactionalTimerObjectName,
-                        new RefContext(ejbReferenceBuilder, resourceReferenceBuilder, serviceReferenceBuilder));
+                        new RefContext(ejbReferenceBuilder, resourceReferenceBuilder, serviceReferenceBuilder,
kernel));
             } catch (MalformedObjectNameException e) {
                 throw new DeploymentException(e);
             }

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?view=diff&r1=153893&r2=153894
==============================================================================
--- 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
Mon Feb 14 20:38:25 2005
@@ -19,24 +19,23 @@
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.util.HashMap;
-import java.util.Map;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
-
 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.AmbiguousEJBRefException;
+import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.common.UnknownEJBRefException;
 import org.apache.geronimo.common.UnresolvedEJBRefException;
+import org.apache.geronimo.deployment.DeploymentContext;
+import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContext;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
-import org.apache.geronimo.gbean.GBeanData;
-import org.apache.geronimo.deployment.DeploymentContext;
-import org.apache.geronimo.xbeans.j2ee.ServiceRefHandlerType;
+import org.apache.geronimo.kernel.Kernel;
 
 /**
  * @version $Rev: 46019 $ $Date: 2004-09-14 02:56:06 -0700 (Tue, 14 Sep 2004) $
@@ -46,6 +45,7 @@
     private final EJBReferenceBuilder ejbReferenceBuilder;
     private final ResourceReferenceBuilder resourceReferenceBuilder;
     private final ServiceReferenceBuilder serviceReferenceBuilder;
+    private final Kernel kernel;
 
     private final Map ejbRemoteIndex;
     private final Map ejbLocalIndex;
@@ -58,7 +58,7 @@
     private final Map resourceModuleDataMap;
 
 
-    public RefContext(EJBReferenceBuilder ejbReferenceBuilder, ResourceReferenceBuilder resourceReferenceBuilder,
ServiceReferenceBuilder serviceReferenceBuilder) {
+    public RefContext(EJBReferenceBuilder ejbReferenceBuilder, ResourceReferenceBuilder resourceReferenceBuilder,
ServiceReferenceBuilder serviceReferenceBuilder, Kernel kernel) {
         assert ejbReferenceBuilder != null: "ejbReferenceBuilder is null";
         assert resourceReferenceBuilder != null: "resourceReferenceBuilder is null";
         assert serviceReferenceBuilder != null: "serviceReferenceBuilder is null";
@@ -73,6 +73,7 @@
         this.ejbReferenceBuilder = ejbReferenceBuilder;
         this.resourceReferenceBuilder = resourceReferenceBuilder;
         this.serviceReferenceBuilder = serviceReferenceBuilder;
+        this.kernel = kernel;
     }
 
     public static RefContext derivedClientRefContext(RefContext refContext, EJBReferenceBuilder
ejbReferenceBuilder, ResourceReferenceBuilder resourceReferenceBuilder, ServiceReferenceBuilder
serviceReferenceBuilder) {
@@ -87,6 +88,7 @@
         this.ejbReferenceBuilder = ejbReferenceBuilder;
         this.resourceReferenceBuilder = resourceReferenceBuilder;
         this.serviceReferenceBuilder = serviceReferenceBuilder;
+        this.kernel = refContext.kernel;
         this.ejbRemoteIndex = refContext.ejbRemoteIndex;
         this.ejbLocalIndex = new HashMap();//no local ejb refs
         this.ejbInterfaceIndex = refContext.ejbInterfaceIndex;
@@ -246,7 +248,7 @@
             } catch (MalformedObjectNameException e1) {
                 throw new DeploymentException("Could not construct resource adapter object
name query", e);
             }
-            ObjectName containerName = resourceReferenceBuilder.locateResourceName(query);
+            ObjectName containerName = locateUniqueName(query, "resource");
             return containerName.getCanonicalName();
         }
     }
@@ -275,7 +277,7 @@
             } catch (MalformedObjectNameException e1) {
                 throw new DeploymentException("Could not construct connection factory object
name query", e);
             }
-            ObjectName containerName = resourceReferenceBuilder.locateResourceName(query);
+            ObjectName containerName = locateUniqueName(query, "resource");
             return containerName.getCanonicalName();
         }
     }
@@ -295,7 +297,7 @@
             } catch (MalformedObjectNameException e1) {
                 throw new DeploymentException("Could not construct admin object object name
query", e);
             }
-            ObjectName containerName = resourceReferenceBuilder.locateResourceName(query);
+            ObjectName containerName = locateUniqueName(query, "resource");
             return containerName.getCanonicalName();
         }
     }
@@ -424,4 +426,24 @@
     public GBeanData getResourceAdapterModuleData(ObjectName resourceAdapterModuleName) {
         return (GBeanData) resourceModuleDataMap.get(resourceAdapterModuleName);
     }
+
+    public String getMEJBName() throws DeploymentException {
+        ObjectName query = null;
+        try {
+            query = ObjectName.getInstance("*:name=ejb/mgmt/MEJB,*");
+        } catch (MalformedObjectNameException e) {
+            throw new DeploymentException("We built this name...");
+        }
+        ObjectName mejbName = locateUniqueName(query, "Management EJB");
+        return mejbName.getCanonicalName();
+    }
+
+    private ObjectName locateUniqueName(ObjectName query, String type) throws DeploymentException
{
+        Set names = kernel.listGBeans(query);
+        if (names.size() != 1) {
+            throw new DeploymentException("Unknown or ambiguous " + type + " name query:
" + query + " match count: " + names.size());
+        }
+        return (ObjectName) names.iterator().next();
+    }
+
 }

Modified: geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ResourceReferenceBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ResourceReferenceBuilder.java?view=diff&r1=153893&r2=153894
==============================================================================
--- geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ResourceReferenceBuilder.java
(original)
+++ geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ResourceReferenceBuilder.java
Mon Feb 14 20:38:25 2005
@@ -30,8 +30,6 @@
 
     Reference createAdminObjectRef(String containerId, Class iface) throws DeploymentException;
 
-    ObjectName locateResourceName(ObjectName query) throws DeploymentException;
-
     GBeanData locateActivationSpecInfo(ObjectName resourceAdapterName, String messageListenerInterface)
throws DeploymentException;
 
     GBeanData locateResourceAdapterGBeanData(ObjectName resourceAdapterModuleName) throws
DeploymentException;

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?view=diff&r1=153893&r2=153894
==============================================================================
--- 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
Mon Feb 14 20:38:25 2005
@@ -31,6 +31,7 @@
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.deployment.DeploymentContext;
 import org.apache.geronimo.xbeans.j2ee.ServiceRefHandlerType;
+import org.apache.geronimo.kernel.Kernel;
 
 /**
  * @version $Rev$ $Date$
@@ -54,6 +55,7 @@
     private final String car_gt_local = "car_gt_local";
     private final String car_enzo = "car_enzo";
     private final String car_enzo_local = "car_enzo_local";
+    private Kernel kernel = null;
     private RefContext refContext;
 
     public void testSimpleRefs() throws Exception {
@@ -204,7 +206,7 @@
             public Object createService(Class serviceInterface, URI wsdlURI, URI jaxrpcMappingURI,
QName serviceQName, Map portComponentRefMap, List handlerInfos, DeploymentContext deploymentContext,
Module module, ClassLoader classLoader) throws DeploymentException {
                 return null;
             }
-        });
+        }, kernel);
 
         refContext.addEJBRemoteId(coffee, "peaberry", coffee_peaberry, true, "CoffeeHome",
"CoffeeRemote");
         refContext.addEJBLocalId(coffee, "peaberry", coffee_peaberry_local, true, "CoffeeLocalHome",
"CoffeeLocal");

Modified: geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/mejb/MEJB.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/mejb/MEJB.java?view=diff&r1=153893&r2=153894
==============================================================================
--- geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/mejb/MEJB.java (original)
+++ geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/mejb/MEJB.java Mon Feb 14
20:38:25 2005
@@ -40,7 +40,6 @@
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.jmx.MBeanServerDelegate;
-import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
  
 /**
  * GBean implementing Management interface and supplying proxies to act as the MEJB container.
@@ -122,7 +121,7 @@
     public static final GBeanInfo GBEAN_INFO;
 
     static {
-        GBeanInfoBuilder infoBuilder = new GBeanInfoBuilder(MEJB.class, NameFactory.STATELESS_SESSION_BEAN);
+        GBeanInfoBuilder infoBuilder = new GBeanInfoBuilder(MEJB.class);
         infoBuilder.addAttribute("kernel", Kernel.class, false);
         infoBuilder.addInterface(Management.class);
 

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?view=diff&r1=153893&r2=153894
==============================================================================
--- 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
Mon Feb 14 20:38:25 2005
@@ -183,7 +183,7 @@
                             public Object createService(Class serviceInterface, URI wsdlURI,
URI jaxrpcMappingURI, QName serviceQName, Map portComponentRefMap, List handlerInfos, DeploymentContext
deploymentContext, Module module, ClassLoader classLoader) throws DeploymentException {
                                 return null;
                             }
-                        }));
+                        }, kernel));
         return earContext;
     }
 

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?view=diff&r1=153893&r2=153894
==============================================================================
--- 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
Mon Feb 14 20:38:25 2005
@@ -334,40 +334,46 @@
             String home = getStringValue(ejbRef.getHome());
             assureEJBHomeInterface(home, cl);
 
+            Reference ejbReference;
             boolean isSession = "Session".equals(getStringValue(ejbRef.getEjbRefType()));
 
-            String ejbLink = null;
-            GerEjbRefType remoteRef = (GerEjbRefType) ejbRefMap.get(ejbRefName);
-            if (remoteRef != null && remoteRef.isSetEjbLink()) {
-                ejbLink = remoteRef.getEjbLink();
-            } else if (ejbRef.isSetEjbLink()) {
-                ejbLink = getStringValue(ejbRef.getEjbLink());
-            }
+            if (isSession && remote.equals("javax.management.j2ee.Management") &&
home.equals("javax.management.j2ee.ManagementHome")) {
+                String mejbName = refContext.getMEJBName();
+                ejbReference = refContext.getEJBRemoteRef(mejbName, isSession, home, remote);
+            } else {
 
-            Reference ejbReference;
-            if (ejbLink != null) {
-                ejbReference = refContext.getEJBRemoteRef(uri, ejbLink, isSession, home,
remote);
-            } else if (remoteRef != null) {
-                if (remoteRef.isSetTargetName()) {
-                    ejbReference = refContext.getEJBRemoteRef(getStringValue(remoteRef.getTargetName()),
isSession, home, remote);
-                } else {
-                    String containerId = null;
-                    try {
-                        containerId = NameFactory.getEjbComponentNameString(getStringValue(remoteRef.getDomain()),
-                                getStringValue(remoteRef.getServer()),
-                                getStringValue(remoteRef.getApplication()),
-                                getStringValue(remoteRef.getModule()),
-                                getStringValue(remoteRef.getName()),
-                                getStringValue(remoteRef.getType()),
-                                j2eeContext);
-                    } catch (MalformedObjectNameException e) {
-                        throw new DeploymentException("Could not construct ejb object name:
" + remoteRef.getName(), e);
-                    }
-                    ejbReference = refContext.getEJBRemoteRef(containerId, isSession, home,
remote);
+                String ejbLink = null;
+                GerEjbRefType remoteRef = (GerEjbRefType) ejbRefMap.get(ejbRefName);
+                if (remoteRef != null && remoteRef.isSetEjbLink()) {
+                    ejbLink = remoteRef.getEjbLink();
+                } else if (ejbRef.isSetEjbLink()) {
+                    ejbLink = getStringValue(ejbRef.getEjbLink());
+                }
 
+                if (ejbLink != null) {
+                    ejbReference = refContext.getEJBRemoteRef(uri, ejbLink, isSession, home,
remote);
+                } else if (remoteRef != null) {
+                    if (remoteRef.isSetTargetName()) {
+                        ejbReference = refContext.getEJBRemoteRef(getStringValue(remoteRef.getTargetName()),
isSession, home, remote);
+                    } else {
+                        String containerId = null;
+                        try {
+                            containerId = NameFactory.getEjbComponentNameString(getStringValue(remoteRef.getDomain()),
+                                    getStringValue(remoteRef.getServer()),
+                                    getStringValue(remoteRef.getApplication()),
+                                    getStringValue(remoteRef.getModule()),
+                                    getStringValue(remoteRef.getName()),
+                                    getStringValue(remoteRef.getType()),
+                                    j2eeContext);
+                        } catch (MalformedObjectNameException e) {
+                            throw new DeploymentException("Could not construct ejb object
name: " + remoteRef.getName(), e);
+                        }
+                        ejbReference = refContext.getEJBRemoteRef(containerId, isSession,
home, remote);
+
+                    }
+                } else {
+                    ejbReference = refContext.getImplicitEJBRemoteRef(uri, ejbRefName, isSession,
home, remote);
                 }
-            } else {
-                ejbReference = refContext.getImplicitEJBRemoteRef(uri, ejbRefName, isSession,
home, remote);
             }
             try {
                 builder.bind(ejbRefName, ejbReference);
@@ -434,7 +440,7 @@
         }
     }
 
-    //TODO current implementation does not deal with portComponentRefs or handlers.
+    //TODO current implementation does not deal with portComponentRefs.
     public static void addServiceRefs(EARContext earContext, Module module, ServiceRefType[]
serviceRefs, ClassLoader cl, ComponentContextBuilder builder) throws DeploymentException {
         RefContext refContext = earContext.getRefContext();
 



Mime
View raw message