geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: rev 56692 - in geronimo/trunk/modules: client-builder/src/java/org/apache/geronimo/client/builder connector-builder/src/java/org/apache/geronimo/connector/deployment connector-builder/src/test/org/apache/geronimo/connector/deployment connector/src/test/org/apache/geronimo/connector connector/src/test/org/apache/geronimo/connector/outbound j2ee/src/java/org/apache/geronimo/j2ee/deployment j2ee/src/java/org/apache/geronimo/j2ee/deployment/j2eeobjectnames j2ee/src/java/org/apache/geronimo/j2ee/j2eeobjectnames jetty/src/java/org/apache/geronimo/jetty/deployment naming/src/java/org/apache/geronimo/naming/deployment
Date Fri, 05 Nov 2004 19:09:41 GMT
Author: djencks
Date: Fri Nov  5 11:09:40 2004
New Revision: 56692

Added:
   geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/j2eeobjectnames/
      - copied from rev 56568, geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment/j2eeobjectnames/
Removed:
   geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment/j2eeobjectnames/
Modified:
   geronimo/trunk/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
   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/RAR_1_0ConfigBuilderTest.java
   geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/RAR_1_5ConfigBuilderTest.java
   geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/AdminObjectWrapperTest.java
   geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapperTest.java
   geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
   geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment/EARContext.java
   geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment/RefContext.java
   geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/j2eeobjectnames/J2eeContext.java
   geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/j2eeobjectnames/J2eeContextImpl.java
   geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/j2eeobjectnames/NameFactory.java
   geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
   geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java
Log:
move j2ee name helper classes out of deployment.  They are useful at runtime

Modified: geronimo/trunk/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
==============================================================================
--- geronimo/trunk/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java	(original)
+++ geronimo/trunk/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java	Fri Nov  5 11:09:40 2004
@@ -30,6 +30,7 @@
 import java.util.jar.JarFile;
 import java.util.jar.Manifest;
 import java.util.zip.ZipEntry;
+import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
 
 import org.apache.geronimo.deployment.DeploymentContext;
@@ -47,8 +48,8 @@
 import org.apache.geronimo.j2ee.deployment.ModuleBuilder;
 import org.apache.geronimo.j2ee.deployment.RefContext;
 import org.apache.geronimo.j2ee.deployment.ResourceReferenceBuilder;
-import org.apache.geronimo.j2ee.deployment.j2eeobjectnames.J2eeContext;
-import org.apache.geronimo.j2ee.deployment.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContext;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.j2ee.management.impl.J2EEAppClientModuleImpl;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
@@ -278,7 +279,12 @@
         }
 
         // generate the object name for the app client
-        ObjectName appClientModuleName = NameFactory.getModuleName(null, null, null, appClientModule.getName(), NameFactory.APP_CLIENT_MODULE, earJ2eeContext);
+        ObjectName appClientModuleName = null;
+        try {
+            appClientModuleName = NameFactory.getModuleName(null, null, null, appClientModule.getName(), NameFactory.APP_CLIENT_MODULE, earJ2eeContext);
+        } catch (MalformedObjectNameException e) {
+            throw new DeploymentException("Could not construct module name", e);
+        }
 
         // create a gbean for the app client module and add it to the ear
         ReadOnlyContext componentContext;

Modified: geronimo/trunk/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
==============================================================================
--- 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	Fri Nov  5 11:09:40 2004
@@ -65,9 +65,9 @@
 import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.j2ee.deployment.ModuleBuilder;
 import org.apache.geronimo.j2ee.deployment.ResourceReferenceBuilder;
-import org.apache.geronimo.j2ee.deployment.j2eeobjectnames.J2eeContext;
-import org.apache.geronimo.j2ee.deployment.j2eeobjectnames.J2eeContextImpl;
-import org.apache.geronimo.j2ee.deployment.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContext;
+import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContextImpl;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.naming.reference.GBeanGetResourceRefAddr;
 import org.apache.geronimo.naming.reference.RefAddrContentObjectFactory;
@@ -285,7 +285,12 @@
                     GerConnectiondefinitionInstanceType[] connectionDefinitionInstances = connectionDefinition.getConnectiondefinitionInstanceArray();
                     for (int j = 0; j < connectionDefinitionInstances.length; j++) {
                         GerConnectiondefinitionInstanceType connectionDefinitionInstance = connectionDefinitionInstances[j];
-                        String containerId = NameFactory.getResourceComponentNameString(null, null, null, null, connectionDefinitionInstance.getName(), NameFactory.JCA_MANAGED_CONNECTION_FACTORY, moduleJ2eeContext);
+                        String containerId = null;
+                        try {
+                            containerId = NameFactory.getResourceComponentNameString(null, null, null, null, connectionDefinitionInstance.getName(), NameFactory.JCA_MANAGED_CONNECTION_FACTORY, moduleJ2eeContext);
+                        } catch (MalformedObjectNameException e) {
+                            throw new DeploymentException("Could not construct resource object name", e);
+                        }
                         earContext.getRefContext().addConnectionFactoryId(module.getModuleURI(), connectionDefinitionInstance.getName(), containerId);
                     }
                 }
@@ -296,7 +301,12 @@
             for (int j = 0; j < gerAdminObject.getAdminobjectInstanceArray().length; j++) {
                 GerAdminobjectInstanceType gerAdminObjectInstance = gerAdminObject.getAdminobjectInstanceArray()[j];
 
-                String adminObjectObjectName = NameFactory.getResourceComponentNameString(null, null, null, null, gerAdminObjectInstance.getMessageDestinationName(), NameFactory.JCA_ADMIN_OBJECT, moduleJ2eeContext);
+                String adminObjectObjectName = null;
+                try {
+                    adminObjectObjectName = NameFactory.getResourceComponentNameString(null, null, null, null, gerAdminObjectInstance.getMessageDestinationName(), NameFactory.JCA_ADMIN_OBJECT, moduleJ2eeContext);
+                } catch (MalformedObjectNameException e) {
+                    throw new DeploymentException("Could not construct resource object name", e);
+                }
                 earContext.getRefContext().addAdminObjectId(module.getModuleURI(), gerAdminObjectInstance.getMessageDestinationName(), adminObjectObjectName);
             }
         }
@@ -328,7 +338,12 @@
 
     private ObjectName addResourceAdapterModuleGBean(EARContext earContext, J2eeContext moduleJ2eeContext, String originalSpecDD, ClassLoader cl) throws DeploymentException {
         // build the objectName
-        ObjectName resourceAdapterModuleName = NameFactory.getModuleName(null, null, null, null, NameFactory.RESOURCE_ADAPTER_MODULE, moduleJ2eeContext);
+        ObjectName resourceAdapterModuleName = null;
+        try {
+            resourceAdapterModuleName = NameFactory.getModuleName(null, null, null, null, NameFactory.RESOURCE_ADAPTER_MODULE, moduleJ2eeContext);
+        } catch (MalformedObjectNameException e) {
+            throw new DeploymentException("Could not construct module name", e);
+        }
 
         // initalize the GBean
         GBeanMBean resourceAdapterModule = new GBeanMBean(ResourceAdapterModuleImpl.GBEAN_INFO, cl);
@@ -408,11 +423,20 @@
                 }
 
                 // set the work manager name
-                ObjectName workManagerName = NameFactory.getComponentName(null, null, geronimoResourceAdapter.getResourceadapterInstance().getWorkmanagerName().trim(), NameFactory.JCA_WORK_MANAGER, moduleJ2eeContext);
+                ObjectName workManagerName = null;
+                try {
+                    workManagerName = NameFactory.getComponentName(null, null, geronimoResourceAdapter.getResourceadapterInstance().getWorkmanagerName().trim(), NameFactory.JCA_WORK_MANAGER, moduleJ2eeContext);
+                } catch (MalformedObjectNameException e) {
+                    throw new DeploymentException("Could not construct work manager object name", e);
+                }
                 resourceAdapterGBean.setReferencePattern("WorkManager", workManagerName);
 
                 // add it
-                resourceAdapterObjectName = NameFactory.getResourceComponentName(null, null, null, null, resourceAdapterName, NameFactory.JCA_RESOURCE_ADAPTER, moduleJ2eeContext);
+                try {
+                    resourceAdapterObjectName = NameFactory.getResourceComponentName(null, null, null, null, resourceAdapterName, NameFactory.JCA_RESOURCE_ADAPTER, moduleJ2eeContext);
+                } catch (MalformedObjectNameException e) {
+                    throw new DeploymentException("Could not construct resource adapter object name", e);
+                }
                 earContext.addGBean(resourceAdapterObjectName, resourceAdapterGBean);
             }
 
@@ -494,7 +518,12 @@
                 }
 
                 // add it
-                ObjectName adminObjectObjectName = NameFactory.getResourceComponentName(null, null, null, null, gerAdminObjectInstance.getMessageDestinationName(), NameFactory.JCA_ADMIN_OBJECT, moduleJ2eeContext);
+                ObjectName adminObjectObjectName = null;
+                try {
+                    adminObjectObjectName = NameFactory.getResourceComponentName(null, null, null, null, gerAdminObjectInstance.getMessageDestinationName(), NameFactory.JCA_ADMIN_OBJECT, moduleJ2eeContext);
+                } catch (MalformedObjectNameException e) {
+                    throw new DeploymentException("Could not construct admin object object name", e);
+                }
                 earContext.addGBean(adminObjectObjectName, adminObjectGBean);
             }
         }
@@ -732,7 +761,12 @@
         }
 
         // add it
-        ObjectName connectionManagerObjectName = NameFactory.getResourceComponentName(null, null, null, null, connectionfactoryInstance.getName(), NameFactory.JCA_CONNECTION_MANAGER, j2eeContext);
+        ObjectName connectionManagerObjectName = null;
+        try {
+            connectionManagerObjectName = NameFactory.getResourceComponentName(null, null, null, null, connectionfactoryInstance.getName(), NameFactory.JCA_CONNECTION_MANAGER, j2eeContext);
+        } catch (MalformedObjectNameException e) {
+            throw new DeploymentException("Could not construct connection manager object name", e);
+        }
         earContext.addGBean(connectionManagerObjectName, connectionManagerGBean);
         return connectionManagerObjectName;
     }
@@ -775,7 +809,12 @@
             throw new DeploymentException(e);
         }
 
-        ObjectName managedConnectionFactoryObjectName = NameFactory.getResourceComponentName(null, null, null, null, connectiondefinitionInstance.getName(), NameFactory.JCA_MANAGED_CONNECTION_FACTORY, j2eeContext);
+        ObjectName managedConnectionFactoryObjectName = null;
+        try {
+            managedConnectionFactoryObjectName = NameFactory.getResourceComponentName(null, null, null, null, connectiondefinitionInstance.getName(), NameFactory.JCA_MANAGED_CONNECTION_FACTORY, j2eeContext);
+        } catch (MalformedObjectNameException e) {
+            throw new DeploymentException("Could not construct managed connection factory object name", e);
+        }
         earContext.addGBean(managedConnectionFactoryObjectName, managedConnectionFactoryGBean);
 
         // ConnectionFactory
@@ -787,7 +826,12 @@
             throw new DeploymentException("Could not initialize JCAConnectionFactory", e);
         }
 
-        ObjectName connectionFactoryObjectName = NameFactory.getResourceComponentName(null, null, null, null, connectiondefinitionInstance.getName(), NameFactory.JCA_CONNECTION_FACTORY, j2eeContext);
+        ObjectName connectionFactoryObjectName = null;
+        try {
+            connectionFactoryObjectName = NameFactory.getResourceComponentName(null, null, null, null, connectiondefinitionInstance.getName(), NameFactory.JCA_CONNECTION_FACTORY, j2eeContext);
+        } catch (MalformedObjectNameException e) {
+            throw new DeploymentException("Could not construct connection factory object name", e);
+        }
         earContext.addGBean(connectionFactoryObjectName, connectionFactory);
     }
 

Modified: geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/RAR_1_0ConfigBuilderTest.java
==============================================================================
--- geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/RAR_1_0ConfigBuilderTest.java	(original)
+++ geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/RAR_1_0ConfigBuilderTest.java	Fri Nov  5 11:09:40 2004
@@ -45,10 +45,12 @@
 import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.j2ee.deployment.ModuleBuilder;
 import org.apache.geronimo.j2ee.deployment.RefContext;
-import org.apache.geronimo.j2ee.deployment.j2eeobjectnames.J2eeContextImpl;
-import org.apache.geronimo.j2ee.deployment.j2eeobjectnames.J2eeContext;
-import org.apache.geronimo.j2ee.deployment.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContextImpl;
+import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContext;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.j2ee.management.impl.J2EEServerImpl;
+import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContext;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.management.State;
 import org.apache.geronimo.system.serverinfo.ServerInfo;

Modified: geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/RAR_1_5ConfigBuilderTest.java
==============================================================================
--- geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/RAR_1_5ConfigBuilderTest.java	(original)
+++ geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/RAR_1_5ConfigBuilderTest.java	Fri Nov  5 11:09:40 2004
@@ -44,10 +44,13 @@
 import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.j2ee.deployment.ModuleBuilder;
 import org.apache.geronimo.j2ee.deployment.RefContext;
-import org.apache.geronimo.j2ee.deployment.j2eeobjectnames.J2eeContext;
-import org.apache.geronimo.j2ee.deployment.j2eeobjectnames.J2eeContextImpl;
-import org.apache.geronimo.j2ee.deployment.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContext;
+import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContextImpl;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.j2ee.management.impl.J2EEServerImpl;
+import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContext;
+import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContextImpl;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.management.State;
 import org.apache.geronimo.system.serverinfo.ServerInfo;

Modified: geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/AdminObjectWrapperTest.java
==============================================================================
--- geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/AdminObjectWrapperTest.java	(original)
+++ geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/AdminObjectWrapperTest.java	Fri Nov  5 11:09:40 2004
@@ -27,9 +27,11 @@
 import org.apache.geronimo.connector.mock.MockAdminObject;
 import org.apache.geronimo.connector.mock.MockAdminObjectImpl;
 import org.apache.geronimo.gbean.jmx.GBeanMBean;
-import org.apache.geronimo.j2ee.deployment.j2eeobjectnames.J2eeContext;
-import org.apache.geronimo.j2ee.deployment.j2eeobjectnames.J2eeContextImpl;
-import org.apache.geronimo.j2ee.deployment.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContext;
+import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContextImpl;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContext;
+import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContextImpl;
 import org.apache.geronimo.kernel.Kernel;
 
 /**

Modified: geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapperTest.java
==============================================================================
--- geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapperTest.java	(original)
+++ geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapperTest.java	Fri Nov  5 11:09:40 2004
@@ -42,9 +42,11 @@
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.jmx.GBeanMBean;
-import org.apache.geronimo.j2ee.deployment.j2eeobjectnames.J2eeContext;
-import org.apache.geronimo.j2ee.deployment.j2eeobjectnames.J2eeContextImpl;
-import org.apache.geronimo.j2ee.deployment.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContext;
+import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContextImpl;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContext;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.Kernel;
 
 /**

Modified: geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
==============================================================================
--- geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java	(original)
+++ geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java	Fri Nov  5 11:09:40 2004
@@ -46,7 +46,7 @@
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.jmx.GBeanMBean;
 import org.apache.geronimo.j2ee.ApplicationInfo;
-import org.apache.geronimo.j2ee.deployment.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.j2ee.management.impl.J2EEApplicationImpl;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;

Modified: geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment/EARContext.java
==============================================================================
--- geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment/EARContext.java	(original)
+++ geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment/EARContext.java	Fri Nov  5 11:09:40 2004
@@ -23,9 +23,9 @@
 
 import org.apache.geronimo.deployment.DeploymentContext;
 import org.apache.geronimo.deployment.DeploymentException;
-import org.apache.geronimo.j2ee.deployment.j2eeobjectnames.J2eeContext;
-import org.apache.geronimo.j2ee.deployment.j2eeobjectnames.J2eeContextImpl;
-import org.apache.geronimo.j2ee.deployment.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContext;
+import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContextImpl;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 
@@ -33,7 +33,7 @@
  * @version $Rev$ $Date$
  */
 public class EARContext extends DeploymentContext {
-    private final ObjectName domainObjectName;
+    private final ObjectName domainObjectName;                    
     private final ObjectName serverObjectName;
     private final ObjectName applicationObjectName;
 

Modified: geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment/RefContext.java
==============================================================================
--- geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment/RefContext.java	(original)
+++ geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment/RefContext.java	Fri Nov  5 11:09:40 2004
@@ -21,11 +21,13 @@
 import java.util.HashMap;
 import java.util.Map;
 import javax.management.ObjectName;
+import javax.management.MalformedObjectNameException;
 import javax.naming.Reference;
 
 import org.apache.geronimo.deployment.DeploymentException;
-import org.apache.geronimo.j2ee.deployment.j2eeobjectnames.J2eeContext;
-import org.apache.geronimo.j2ee.deployment.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContext;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 
 /**
  * @version $Rev: 46019 $ $Date: 2004-09-14 02:56:06 -0700 (Tue, 14 Sep 2004) $
@@ -224,7 +226,12 @@
         try {
             return getContainerId(module, resourceLink, (Map) connectionFactoryIndex.get(name));
         } catch (UnknownEJBRefException e) {
-            ObjectName query = NameFactory.getComponentRestrictedQueryName(null, null, name, NameFactory.JCA_RESOURCE_ADAPTER, j2eeContext);
+            ObjectName query = null;
+            try {
+                query = NameFactory.getComponentRestrictedQueryName(null, null, name, NameFactory.JCA_RESOURCE_ADAPTER, j2eeContext);
+            } catch (MalformedObjectNameException e1) {
+                throw new DeploymentException("Could not construct resource adapter object name query", e);
+            }
             ObjectName containerName = resourceReferenceBuilder.locateResourceName(query);
             return containerName.getCanonicalName();
         }
@@ -235,7 +242,12 @@
         try {
             return getContainerId(module, resourceLink, (Map) connectionFactoryIndex.get(name));
         } catch (UnknownEJBRefException e) {
-            ObjectName query = NameFactory.getComponentRestrictedQueryName(null, null, name, NameFactory.JCA_MANAGED_CONNECTION_FACTORY, j2eeContext);
+            ObjectName query = null;
+            try {
+                query = NameFactory.getComponentRestrictedQueryName(null, null, name, NameFactory.JCA_MANAGED_CONNECTION_FACTORY, j2eeContext);
+            } catch (MalformedObjectNameException e1) {
+                throw new DeploymentException("Could not construct connection factory object name query", e);
+            }
             ObjectName containerName = resourceReferenceBuilder.locateResourceName(query);
             return containerName.getCanonicalName();
         }
@@ -250,7 +262,12 @@
         try {
             return getContainerId(module, resourceLink, (Map) adminObjectIndex.get(name));
         } catch (UnknownEJBRefException e) {
-            ObjectName query = NameFactory.getComponentRestrictedQueryName(null, null, name, NameFactory.JCA_ADMIN_OBJECT, j2eeContext);
+            ObjectName query = null;
+            try {
+                query = NameFactory.getComponentRestrictedQueryName(null, null, name, NameFactory.JCA_ADMIN_OBJECT, j2eeContext);
+            } catch (MalformedObjectNameException e1) {
+                throw new DeploymentException("Could not construct admin object object name query", e);
+            }
             ObjectName containerName = resourceReferenceBuilder.locateResourceName(query);
             return containerName.getCanonicalName();
         }

Modified: geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/j2eeobjectnames/J2eeContext.java
==============================================================================
--- geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment/j2eeobjectnames/J2eeContext.java	(original)
+++ geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/j2eeobjectnames/J2eeContext.java	Fri Nov  5 11:09:40 2004
@@ -1,6 +1,23 @@
-package org.apache.geronimo.j2ee.deployment.j2eeobjectnames;
+/**
+ *
+ * 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.j2ee.j2eeobjectnames;
 
 /**
+ * @version $Rev: $ $Date: $
  */
 public interface J2eeContext {
 

Modified: geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/j2eeobjectnames/J2eeContextImpl.java
==============================================================================
--- geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment/j2eeobjectnames/J2eeContextImpl.java	(original)
+++ geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/j2eeobjectnames/J2eeContextImpl.java	Fri Nov  5 11:09:40 2004
@@ -1,6 +1,25 @@
-package org.apache.geronimo.j2ee.deployment.j2eeobjectnames;
+/**
+ *
+ * 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.j2ee.j2eeobjectnames;
+
+import javax.management.ObjectName;
 
 /**
+ * @version $Rev: $ $Date: $
  */
 public class J2eeContextImpl implements J2eeContext {
 
@@ -18,6 +37,15 @@
         this.moduleName = moduleName;
         this.j2eeName = j2eeName;
         this.j2eeType = j2eeType;
+    }
+
+    public J2eeContextImpl(ObjectName source, String moduleType) {
+        this.domainName = source.getDomain();
+        this.serverName = source.getKeyProperty(NameFactory.J2EE_SERVER);
+        this.applicationName = source.getKeyProperty(NameFactory.J2EE_APPLICATION);
+        this.moduleName = source.getKeyProperty(moduleType);
+        this.j2eeType = source.getKeyProperty(NameFactory.J2EE_TYPE);
+        this.j2eeName = source.getKeyProperty(NameFactory.J2EE_NAME);
     }
 
 

Modified: geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/j2eeobjectnames/NameFactory.java
==============================================================================
--- geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment/j2eeobjectnames/NameFactory.java	(original)
+++ geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/j2eeobjectnames/NameFactory.java	Fri Nov  5 11:09:40 2004
@@ -1,12 +1,27 @@
-package org.apache.geronimo.j2ee.deployment.j2eeobjectnames;
+/**
+ *
+ * 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.j2ee.j2eeobjectnames;
 
 import java.util.Properties;
 import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
 
-import org.apache.geronimo.deployment.DeploymentException;
-
 /**
+ * @version $Rev: $ $Date: $
  */
 public class NameFactory {
 
@@ -59,72 +74,52 @@
     public static final String JCA_WORK_MANAGER = "JCAWorkManager";
     public static final String JCA_CONNECTION_MANAGER = "JCAConnectionManager";
 
-    public static ObjectName getDomainName(String j2eeDomainName, J2eeContext context) throws DeploymentException {
+    public static ObjectName getDomainName(String j2eeDomainName, J2eeContext context) throws MalformedObjectNameException {
         Properties props = new Properties();
         props.put(J2EE_TYPE, J2EE_DOMAIN);
         props.put(J2EE_NAME, context.getJ2eeDomainName(j2eeDomainName));
-        try {
-            return ObjectName.getInstance(context.getJ2eeDomainName(j2eeDomainName), props);
-        } catch (MalformedObjectNameException e) {
-            throw new DeploymentException("Invalid domain name", e);
-        }
+        return ObjectName.getInstance(context.getJ2eeDomainName(j2eeDomainName), props);
     }
 
-    public static ObjectName getServerName(String j2eeDomainName, String j2eeServerName, J2eeContext context) throws DeploymentException {
+    public static ObjectName getServerName(String j2eeDomainName, String j2eeServerName, J2eeContext context) throws MalformedObjectNameException {
         Properties props = new Properties();
         props.put(J2EE_TYPE, J2EE_SERVER);
         props.put(J2EE_NAME, context.getJ2eeServerName(j2eeServerName));
-        try {
-            return ObjectName.getInstance(context.getJ2eeDomainName(j2eeDomainName), props);
-        } catch (MalformedObjectNameException e) {
-            throw new DeploymentException("Invalid server name", e);
-        }
+        return ObjectName.getInstance(context.getJ2eeDomainName(j2eeDomainName), props);
     }
 
-    public static ObjectName getApplicationName(String j2eeDomainName, String j2eeServerName, String j2eeApplicationName, J2eeContext context) throws DeploymentException {
+    public static ObjectName getApplicationName(String j2eeDomainName, String j2eeServerName, String j2eeApplicationName, J2eeContext context) throws MalformedObjectNameException {
         Properties props = new Properties();
         props.put(J2EE_TYPE, J2EE_APPLICATION);
         props.put(J2EE_SERVER, context.getJ2eeServerName(j2eeServerName));
         props.put(J2EE_NAME, context.getJ2eeApplicationName(j2eeApplicationName));
-        try {
-            return ObjectName.getInstance(context.getJ2eeDomainName(j2eeDomainName), props);
-        } catch (MalformedObjectNameException e) {
-            throw new DeploymentException("Invalid application name", e);
-        }
+        return ObjectName.getInstance(context.getJ2eeDomainName(j2eeDomainName), props);
     }
 
-    public static ObjectName getModuleName(String j2eeDomainName, String j2eeServerName, String j2eeApplicationName, String j2eeModuleName, String j2eeType, J2eeContext context) throws DeploymentException {
+    public static ObjectName getModuleName(String j2eeDomainName, String j2eeServerName, String j2eeApplicationName, String j2eeModuleName, String j2eeType, J2eeContext context) throws MalformedObjectNameException {
         Properties props = new Properties();
         props.put(J2EE_TYPE, j2eeType);
         props.put(J2EE_SERVER, context.getJ2eeServerName(j2eeServerName));
         props.put(J2EE_APPLICATION, context.getJ2eeApplicationName(j2eeApplicationName));
         props.put(J2EE_NAME, context.getJ2eeModuleName(j2eeModuleName));
-        try {
-            return ObjectName.getInstance(context.getJ2eeDomainName(j2eeDomainName), props);
-        } catch (MalformedObjectNameException e) {
-            throw new DeploymentException("Invalid module name", e);
-        }
+        return ObjectName.getInstance(context.getJ2eeDomainName(j2eeDomainName), props);
     }
 
-    public static ObjectName getEjbComponentName(String j2eeDomainName, String j2eeServerName, String j2eeApplicationName, String j2eeModuleName, String j2eeName, String j2eeType, J2eeContext context) throws DeploymentException {
+    public static ObjectName getEjbComponentName(String j2eeDomainName, String j2eeServerName, String j2eeApplicationName, String j2eeModuleName, String j2eeName, String j2eeType, J2eeContext context) throws MalformedObjectNameException {
         Properties props = new Properties();
         props.put(J2EE_TYPE, context.getJ2eeType(j2eeType));
         props.put(J2EE_SERVER, context.getJ2eeServerName(j2eeServerName));
         props.put(J2EE_APPLICATION, context.getJ2eeApplicationName(j2eeApplicationName));
         props.put(EJB_MODULE, context.getJ2eeModuleName(j2eeModuleName));
         props.put(J2EE_NAME, context.getJ2eeName(j2eeName));
-        try {
-            return ObjectName.getInstance(context.getJ2eeDomainName(j2eeDomainName), props);
-        } catch (MalformedObjectNameException e) {
-            throw new DeploymentException("Invalid component name", e);
-        }
+        return ObjectName.getInstance(context.getJ2eeDomainName(j2eeDomainName), props);
     }
 
-    public static String getEjbComponentNameString(String j2eeDomainName, String j2eeServerName, String j2eeApplicationName, String j2eeModuleName, String j2eeName, String j2eeType, J2eeContext context) throws DeploymentException {
+    public static String getEjbComponentNameString(String j2eeDomainName, String j2eeServerName, String j2eeApplicationName, String j2eeModuleName, String j2eeName, String j2eeType, J2eeContext context) throws MalformedObjectNameException {
         return getEjbComponentName(j2eeDomainName, j2eeServerName, j2eeApplicationName, j2eeModuleName, j2eeName, j2eeType, context).getCanonicalName();
     }
 
-    public static ObjectName getResourceComponentName(String j2eeDomainName, String j2eeServerName, String j2eeApplicationName, String j2eeModuleName, String j2eeName, String j2eeType, J2eeContext context) throws DeploymentException {
+    public static ObjectName getResourceComponentName(String j2eeDomainName, String j2eeServerName, String j2eeApplicationName, String j2eeModuleName, String j2eeName, String j2eeType, J2eeContext context) throws MalformedObjectNameException {
         Properties props = new Properties();
         props.put(J2EE_TYPE, context.getJ2eeType(j2eeType));
         props.put(J2EE_SERVER, context.getJ2eeServerName(j2eeServerName));
@@ -132,29 +127,26 @@
 //        props.put(RESOURCE_ADAPTER_MODULE, context.getJ2eeModuleName(j2eeModuleName));
         props.put(JCA_RESOURCE, context.getJ2eeModuleName(j2eeModuleName));
         props.put(J2EE_NAME, context.getJ2eeName(j2eeName));
-        try {
-            return ObjectName.getInstance(context.getJ2eeDomainName(j2eeDomainName), props);
-        } catch (MalformedObjectNameException e) {
-            throw new DeploymentException("Invalid component name", e);
-        }
+        return ObjectName.getInstance(context.getJ2eeDomainName(j2eeDomainName), props);
     }
 
-    public static String getResourceComponentNameString(String j2eeDomainName, String j2eeServerName, String j2eeApplicationName, String j2eeModuleName, String j2eeName, String j2eeType, J2eeContext context) throws DeploymentException {
+    public static String getResourceComponentNameString(String j2eeDomainName, String j2eeServerName, String j2eeApplicationName, String j2eeModuleName, String j2eeName, String j2eeType, J2eeContext context) throws MalformedObjectNameException {
         return getResourceComponentName(j2eeDomainName, j2eeServerName, j2eeApplicationName, j2eeModuleName, j2eeName, j2eeType, context).getCanonicalName();
     }
 
     /**
      * Creates a query for components that are in no application with given name.
+     *
      * @param j2eeDomainName
      * @param j2eeServerName
      * @param j2eeName
      * @param j2eeType
      * @param context
      * @return
-     * @throws DeploymentException
+     * @throws MalformedObjectNameException
      */
 
-    public static ObjectName getComponentRestrictedQueryName(String j2eeDomainName, String j2eeServerName, String j2eeName, String j2eeType, J2eeContext context) throws DeploymentException {
+    public static ObjectName getComponentRestrictedQueryName(String j2eeDomainName, String j2eeServerName, String j2eeName, String j2eeType, J2eeContext context) throws MalformedObjectNameException {
 //        Properties props = new Properties();
 //        props.put(J2EE_TYPE, context.getJ2eeType(j2eeType));
 //        props.put(J2EE_SERVER, context.getJ2eeServerName(j2eeServerName));
@@ -167,48 +159,36 @@
 //        } catch (MalformedObjectNameException e) {
 //            throw new DeploymentException("Invalid component name", e);
 //        }
-        StringBuffer buffer = new StringBuffer(context.getJ2eeDomainName())
+        StringBuffer buffer = new StringBuffer(context.getJ2eeDomainName(j2eeDomainName))
                 .append(":" + J2EE_TYPE + "=").append(context.getJ2eeType(j2eeType))
                 .append("," + J2EE_SERVER + "=").append(context.getJ2eeServerName(j2eeServerName))
                 .append("," + J2EE_APPLICATION + "=" + NULL)
                 .append("," + J2EE_NAME + "=").append(context.getJ2eeName(j2eeName))
                 .append(",*");
-        try {
-            return new ObjectName(buffer.toString());
-        } catch (MalformedObjectNameException e) {
-            throw new DeploymentException("Unable to construct ObjectName", e);
-        }
+        return new ObjectName(buffer.toString());
     }
 
-    public static ObjectName getWebComponentName(String j2eeDomainName, String j2eeServerName, String j2eeApplicationName, String j2eeModuleName, String j2eeName, String j2eeType, J2eeContext context) throws DeploymentException {
+    public static ObjectName getWebComponentName(String j2eeDomainName, String j2eeServerName, String j2eeApplicationName, String j2eeModuleName, String j2eeName, String j2eeType, J2eeContext context) throws MalformedObjectNameException {
         Properties props = new Properties();
         props.put(J2EE_TYPE, context.getJ2eeType(j2eeType));
         props.put(J2EE_SERVER, context.getJ2eeServerName(j2eeServerName));
         props.put(J2EE_APPLICATION, context.getJ2eeApplicationName(j2eeApplicationName));
         props.put(WEB_MODULE, context.getJ2eeModuleName(j2eeModuleName));
         props.put(J2EE_NAME, context.getJ2eeName(j2eeName));
-        try {
-            return ObjectName.getInstance(context.getJ2eeDomainName(j2eeDomainName), props);
-        } catch (MalformedObjectNameException e) {
-            throw new DeploymentException("Invalid component name", e);
-        }
+        return ObjectName.getInstance(context.getJ2eeDomainName(j2eeDomainName), props);
     }
 
-    public static String getWebComponentNameString(String j2eeDomainName, String j2eeServerName, String j2eeApplicationName, String j2eeModuleName, String j2eeName, String j2eeType, J2eeContext context) throws DeploymentException {
+    public static String getWebComponentNameString(String j2eeDomainName, String j2eeServerName, String j2eeApplicationName, String j2eeModuleName, String j2eeName, String j2eeType, J2eeContext context) throws MalformedObjectNameException {
         return getResourceComponentName(j2eeDomainName, j2eeServerName, j2eeApplicationName, j2eeModuleName, j2eeName, j2eeType, context).getCanonicalName();
     }
 
     //for non-j2ee-deployable resources such as the transaction manager
-    public static ObjectName getComponentName(String j2eeDomainName, String j2eeServerName, String j2eeName, String j2eeType, J2eeContext context) throws DeploymentException {
+    public static ObjectName getComponentName(String j2eeDomainName, String j2eeServerName, String j2eeName, String j2eeType, J2eeContext context) throws MalformedObjectNameException {
         Properties props = new Properties();
         props.put(J2EE_TYPE, context.getJ2eeType(j2eeType));
         props.put(J2EE_SERVER, context.getJ2eeServerName(j2eeServerName));
         props.put(J2EE_NAME, context.getJ2eeName(j2eeName));
-        try {
-            return ObjectName.getInstance(context.getJ2eeDomainName(j2eeDomainName), props);
-        } catch (MalformedObjectNameException e) {
-            throw new DeploymentException("Invalid component name", e);
-        }
+        return ObjectName.getInstance(context.getJ2eeDomainName(j2eeDomainName), props);
     }
 
 }

Modified: geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
==============================================================================
--- geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java	(original)
+++ geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java	Fri Nov  5 11:09:40 2004
@@ -29,6 +29,7 @@
 import java.util.jar.JarFile;
 import java.util.zip.ZipEntry;
 import javax.management.ObjectName;
+import javax.management.MalformedObjectNameException;
 import javax.transaction.UserTransaction;
 
 import org.apache.geronimo.deployment.DeploymentException;
@@ -41,9 +42,11 @@
 import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.j2ee.deployment.ModuleBuilder;
 import org.apache.geronimo.j2ee.deployment.WebModule;
-import org.apache.geronimo.j2ee.deployment.j2eeobjectnames.J2eeContext;
-import org.apache.geronimo.j2ee.deployment.j2eeobjectnames.J2eeContextImpl;
-import org.apache.geronimo.j2ee.deployment.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContext;
+import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContextImpl;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContext;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.jetty.JettyClassLoader;
 import org.apache.geronimo.jetty.JettyWebAppContext;
 import org.apache.geronimo.jetty.JettyWebAppJACCContext;
@@ -287,7 +290,12 @@
             }
         }
 
-        ObjectName webModuleName = NameFactory.getModuleName(null, null, null, null, NameFactory.WEB_MODULE, moduleJ2eeContext);
+        ObjectName webModuleName = null;
+        try {
+            webModuleName = NameFactory.getModuleName(null, null, null, null, NameFactory.WEB_MODULE, moduleJ2eeContext);
+        } catch (MalformedObjectNameException e) {
+            throw new DeploymentException("Could not construct module name", e);
+        }
 
         UserTransaction userTransaction = new OnlineUserTransaction();
         ReadOnlyContext compContext = buildComponentContext(earContext, webModule, webApp, jettyWebApp, userTransaction, webClassLoader);

Modified: geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java
==============================================================================
--- geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java	(original)
+++ geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java	Fri Nov  5 11:09:40 2004
@@ -25,6 +25,7 @@
 import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
+import javax.management.MalformedObjectNameException;
 import javax.naming.NamingException;
 import javax.naming.Reference;
 import javax.transaction.UserTransaction;
@@ -32,8 +33,8 @@
 import org.apache.geronimo.deployment.DeploymentException;
 import org.apache.geronimo.j2ee.deployment.EARContext;
 import org.apache.geronimo.j2ee.deployment.RefContext;
-import org.apache.geronimo.j2ee.deployment.j2eeobjectnames.J2eeContext;
-import org.apache.geronimo.j2ee.deployment.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContext;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.naming.java.ComponentContextBuilder;
 import org.apache.geronimo.naming.java.ReadOnlyContext;
 import org.apache.geronimo.xbeans.geronimo.naming.GerEjbLocalRefType;
@@ -126,14 +127,18 @@
             containerId = gerResourceRef.getTargetName();
         } else {
             //construct name from components
-            containerId = NameFactory.getResourceComponentNameString(gerResourceRef.getDomain(),
-                    gerResourceRef.getServer(),
-                    gerResourceRef.getApplication(),
-                    gerResourceRef.getModule(),
-                    gerResourceRef.getName(),
-                    //todo determine type from iface class
-                    gerResourceRef.getType() == null ? NameFactory.JCA_MANAGED_CONNECTION_FACTORY : gerResourceRef.getType(),
-                    j2eeContext);
+            try {
+                containerId = NameFactory.getResourceComponentNameString(gerResourceRef.getDomain(),
+                        gerResourceRef.getServer(),
+                        gerResourceRef.getApplication(),
+                        gerResourceRef.getModule(),
+                        gerResourceRef.getName(),
+                        //todo determine type from iface class
+                        gerResourceRef.getType() == null ? NameFactory.JCA_MANAGED_CONNECTION_FACTORY : gerResourceRef.getType(),
+                        j2eeContext);
+            } catch (MalformedObjectNameException e) {
+                throw new DeploymentException("could not construct object name for resource", e);
+            }
         }
         return containerId;
     }
@@ -179,14 +184,18 @@
             containerId = gerResourceEnvRef.getTargetName();
         } else {
             //construct name from components
-            containerId = NameFactory.getResourceComponentNameString(gerResourceEnvRef.getDomain(),
-                    gerResourceEnvRef.getServer(),
-                    gerResourceEnvRef.getApplication(),
-                    gerResourceEnvRef.getModule(),
-                    gerResourceEnvRef.getName(),
-                    NameFactory.JMS_RESOURCE,
-                    //gerResourceEnvRef.getType(),
-                    j2eeContext);
+            try {
+                containerId = NameFactory.getResourceComponentNameString(gerResourceEnvRef.getDomain(),
+                        gerResourceEnvRef.getServer(),
+                        gerResourceEnvRef.getApplication(),
+                        gerResourceEnvRef.getModule(),
+                        gerResourceEnvRef.getName(),
+                        NameFactory.JMS_RESOURCE,
+                        //gerResourceEnvRef.getType(),
+                        j2eeContext);
+            } catch (MalformedObjectNameException e) {
+                throw new DeploymentException("could not construct object name for jms resource", e);
+            }
         }
         return containerId;
     }
@@ -249,13 +258,18 @@
                 if (remoteRef.isSetTargetName()) {
                     ejbReference = refContext.getEJBRemoteRef(remoteRef.getTargetName(), isSession, home, remote);
                 } else {
-                    String containerId = NameFactory.getEjbComponentNameString(remoteRef.getDomain(),
-                            remoteRef.getServer(),
-                            remoteRef.getApplication(),
-                            remoteRef.getModule(),
-                            remoteRef.getName(),
-                            remoteRef.getType(),
-                            j2eeContext);
+                    String containerId = null;
+                    try {
+                        containerId = NameFactory.getEjbComponentNameString(remoteRef.getDomain(),
+                                                    remoteRef.getServer(),
+                                                    remoteRef.getApplication(),
+                                                    remoteRef.getModule(),
+                                                    remoteRef.getName(),
+                                                    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);
 
                 }
@@ -301,13 +315,18 @@
                 if (localRef.isSetTargetName()) {
                     ejbReference = refContext.getEJBLocalRef(localRef.getTargetName(), isSession, localHome, local);
                 } else {
-                    String containerId = NameFactory.getEjbComponentNameString(localRef.getDomain(),
-                            localRef.getServer(),
-                            localRef.getApplication(),
-                            localRef.getModule(),
-                            localRef.getName(),
-                            localRef.getType(),
-                            j2eeContext);
+                    String containerId = null;
+                    try {
+                        containerId = NameFactory.getEjbComponentNameString(localRef.getDomain(),
+                                                    localRef.getServer(),
+                                                    localRef.getApplication(),
+                                                    localRef.getModule(),
+                                                    localRef.getName(),
+                                                    localRef.getType(),
+                                                    j2eeContext);
+                    } catch (MalformedObjectNameException e) {
+                        throw new DeploymentException("Could not construct ejb object name: " + localRef.getName(), e);
+                    }
                     ejbReference = refContext.getEJBLocalRef(containerId, isSession, localHome, local);
 
                 }

Mime
View raw message