geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r385487 [2/3] - in /geronimo/branches/1.1: applications/console-core/src/java/org/apache/geronimo/console/util/ modules/axis-builder/src/test/org/apache/geronimo/axis/builder/ modules/client-builder/src/java/org/apache/geronimo/client/build...
Date Mon, 13 Mar 2006 10:07:58 GMT
Modified: geronimo/branches/1.1/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java?rev=385487&r1=385486&r2=385487&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java (original)
+++ geronimo/branches/1.1/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java Mon Mar 13 02:07:53 2006
@@ -26,6 +26,7 @@
 import org.apache.geronimo.deployment.xbeans.EnvironmentType;
 import org.apache.geronimo.deployment.xbeans.GbeanType;
 import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
+import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
@@ -34,17 +35,16 @@
 import org.apache.geronimo.j2ee.deployment.ModuleBuilder;
 import org.apache.geronimo.j2ee.deployment.WebModule;
 import org.apache.geronimo.j2ee.deployment.WebServiceBuilder;
-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.jetty.JettyFilterHolder;
 import org.apache.geronimo.jetty.JettyFilterMapping;
 import org.apache.geronimo.jetty.JettyServletHolder;
 import org.apache.geronimo.jetty.JettyWebAppContext;
+import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.config.ConfigurationData;
+import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.kernel.repository.Repository;
@@ -88,10 +88,9 @@
 import org.mortbay.http.DigestAuthenticator;
 import org.mortbay.jetty.servlet.FormAuthenticator;
 
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
 import javax.servlet.Servlet;
 import javax.transaction.UserTransaction;
+import javax.management.MalformedObjectNameException;
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.IOException;
@@ -122,7 +121,7 @@
 public class JettyModuleBuilder extends AbstractWebModuleBuilder {
     private final static Log log = LogFactory.getLog(JettyModuleBuilder.class);
     private final Environment defaultEnvironment;
-    private final ObjectName jettyContainerObjectName;
+    private final AbstractName jettyContainerObjectName;
     private final Collection defaultServlets;
     private final Collection defaultFilters;
     private final Collection defaultFilterMappings;
@@ -140,7 +139,7 @@
                               Integer defaultSessionTimeoutSeconds,
                               boolean defaultContextPriorityClassloader,
                               List defaultWelcomeFiles,
-                              ObjectName jettyContainerObjectName,
+                              AbstractName jettyContainerName,
                               Collection defaultServlets,
                               Collection defaultFilters,
                               Collection defaultFilterMappings,
@@ -151,7 +150,7 @@
         this.defaultEnvironment = defaultEnvironment;
         this.defaultSessionTimeoutSeconds = (defaultSessionTimeoutSeconds == null) ? new Integer(30 * 60) : defaultSessionTimeoutSeconds;
         this.defaultContextPriorityClassloader = defaultContextPriorityClassloader;
-        this.jettyContainerObjectName = jettyContainerObjectName;
+        this.jettyContainerObjectName = jettyContainerName;
         this.defaultServlets = defaultServlets;
         this.defaultFilters = defaultFilters;
         this.defaultFilterMappings = defaultFilterMappings;
@@ -167,11 +166,11 @@
         if (template == null) {
             return null;
         }
-        ObjectName templateName = kernel.getProxyManager().getProxyTarget(template);
+        AbstractName templateName = kernel.getProxyManager().getProxyTarget(template);
         return kernel.getGBeanData(templateName);
     }
 
-    protected Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl, boolean standAlone, String contextRoot) throws DeploymentException {
+    protected Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl, boolean standAlone, String contextRoot, AbstractName earName) throws DeploymentException {
         assert moduleFile != null: "moduleFile is null";
         assert targetPath != null: "targetPath is null";
         assert !targetPath.endsWith("/"): "targetPath must not end with a '/'";
@@ -235,8 +234,18 @@
         } catch (MalformedURLException e) {
             //no descriptor
         }
+        AbstractName moduleName;
+        if (earName == null) {
+            try {
+                moduleName = NameFactory.buildModuleName(environment.getProperties(), environment.getConfigId(), ConfigurationModuleType.WAR, null);
+            } catch (MalformedObjectNameException e) {
+                throw new DeploymentException("Could not construct standalone web module name", e);
+            }
+        } else {
+            moduleName = NameFactory.getChildName(earName, NameFactory.WEB_MODULE, targetPath, null);
+        }
 
-        return new WebModule(standAlone, environment, moduleFile, targetPath, webApp, jettyWebApp, specDD, contextRoot, portMap, JETTY_NAMESPACE);
+        return new WebModule(standAlone, moduleName, environment, moduleFile, targetPath, webApp, jettyWebApp, specDD, contextRoot, portMap, JETTY_NAMESPACE);
     }
 
     JettyWebAppType getJettyWebApp(Object plan, JarFile moduleFile, boolean standAlone, String targetPath, WebAppType webApp) throws DeploymentException {
@@ -313,34 +322,22 @@
 
     public void addGBeans(EARContext earContext, Module module, ClassLoader cl, Repository repository) throws DeploymentException {
         EARContext moduleContext = module.getEarContext();
-        Configuration knownParent = null;
-        if (!module.isStandAlone()) {
-            knownParent = earContext.getConfiguration(null);
-        }
-        ClassLoader moduleClassLoader = moduleContext.getClassLoader(knownParent);
-        J2eeContext earJ2eeContext = moduleContext.getModuleName();
-        J2eeContext moduleJ2eeContext = J2eeContextImpl.newModuleContextFromApplication(earJ2eeContext, NameFactory.WEB_MODULE, module.getName());
+        ClassLoader moduleClassLoader = moduleContext.getClassLoader();
+        AbstractName moduleName = moduleContext.getModuleName();
         WebModule webModule = (WebModule) module;
 
         WebAppType webApp = (WebAppType) webModule.getSpecDD();
         JettyWebAppType jettyWebApp = (JettyWebAppType) webModule.getVendorDD();
 
         GbeanType[] gbeans = jettyWebApp.getGbeanArray();
-        ServiceConfigBuilder.addGBeans(gbeans, moduleClassLoader, moduleJ2eeContext, moduleContext);
-
-        ObjectName webModuleName;
-        try {
-            webModuleName = NameFactory.getModuleName(null, null, null, null, null, moduleJ2eeContext);
-        } catch (MalformedObjectNameException e) {
-            throw new DeploymentException("Could not construct module name", e);
-        }
+        ServiceConfigBuilder.addGBeans(gbeans, moduleClassLoader, moduleName, moduleContext);
 
         UserTransaction userTransaction = new OnlineUserTransaction();
         //this may add to the web classpath with enhanced classes.
         //N.B. we use the ear context which has all the gbeans we could possibly be looking up from this ear.
         Map compContext = buildComponentContext(earContext, webModule, webApp, jettyWebApp, userTransaction, moduleClassLoader);
 
-        GBeanData webModuleData = new GBeanData(webModuleName, JettyWebAppContext.GBEAN_INFO);
+        GBeanData webModuleData = new GBeanData(moduleName, JettyWebAppContext.GBEAN_INFO);
         try {
             webModuleData.setReferencePattern("J2EEServer", moduleContext.getServerObjectName());
             if (!moduleContext.getJ2EEApplicationName().equals("null")) {
@@ -535,7 +532,7 @@
             }
 
             //"previous" filter mapping for linked list to keep dd's ordering.
-            ObjectName previous = null;
+            AbstractName previous = null;
 
             //add default filters
             if (defaultFilters != null) {
@@ -543,19 +540,19 @@
                     Object defaultFilter = iterator.next();
                     GBeanData filterGBeanData = getGBeanData(kernel, defaultFilter);
                     String filterName = (String) filterGBeanData.getAttribute("filterName");
-                    ObjectName defaultFilterObjectName = NameFactory.getWebComponentName(null, null, null, null, filterName, NameFactory.WEB_FILTER, moduleJ2eeContext);
-                    filterGBeanData.setName(defaultFilterObjectName);
-                    filterGBeanData.setReferencePattern("JettyServletRegistration", webModuleName);
+                    AbstractName defaultFilterAbstractName = NameFactory.getChildName(moduleName, NameFactory.WEB_FILTER, filterName, null);
+                    filterGBeanData.setAbstractName(defaultFilterAbstractName);
+                    filterGBeanData.setReferencePattern("JettyServletRegistration", moduleName);
                     moduleContext.addGBean(filterGBeanData);
                     //add a mapping to /*
 
                     GBeanData filterMappingGBeanData = new GBeanData(JettyFilterMapping.GBEAN_INFO);
                     filterMappingGBeanData.setReferencePattern("Previous", previous);
-                    filterMappingGBeanData.setReferencePattern("JettyServletRegistration", webModuleName);
+                    filterMappingGBeanData.setReferencePattern("JettyServletRegistration", moduleName);
                     String urlPattern = "/*";
                     filterMappingGBeanData.setAttribute("urlPattern", urlPattern);
-                    ObjectName filterMappingName = NameFactory.getWebFilterMappingName(null, null, null, null, filterName, null, urlPattern, moduleJ2eeContext);
-                    filterMappingGBeanData.setName(filterMappingName);
+                    AbstractName filterMappingName = NameFactory.getChildName(defaultFilterAbstractName, NameFactory.URL_WEB_FILTER_MAPPING, urlPattern, null);
+                    filterMappingGBeanData.setAbstractName(filterMappingName);
                     previous = filterMappingName;
 
 
@@ -563,7 +560,7 @@
                     filterMappingGBeanData.setAttribute("forwardDispatch", Boolean.TRUE);
                     filterMappingGBeanData.setAttribute("includeDispatch", Boolean.TRUE);
                     filterMappingGBeanData.setAttribute("errorDispatch", Boolean.FALSE);
-                    filterMappingGBeanData.setReferencePattern("Filter", defaultFilterObjectName);
+                    filterMappingGBeanData.setReferencePattern("Filter", defaultFilterAbstractName);
                     moduleContext.addGBean(filterMappingGBeanData);
                 }
             }
@@ -577,7 +574,7 @@
 //                    ObjectName defaultFilterMappingObjectName;
 //                    if (filterMappingGBeanData.getAttribute("urlPattern") != null) {
 //                        String urlPattern = (String) filterMappingGBeanData.getAttribute("urlPattern");
-//                        defaultFilterMappingObjectName = NameFactory.getWebFilterMappingName(null, null, null, null, filterName, null, urlPattern, moduleJ2eeContext);
+//                        defaultFilterMappingObjectName = NameFactory.getWebFilterMappingName(null, null, null, null, filterName, null, urlPattern, moduleName);
 //                    } else {
 //                        Set servletNames = filterMappingGBeanData.getReferencePatterns("Servlet");
 //                        if (servletNames == null || servletNames.size() != 1) {
@@ -585,7 +582,7 @@
 //                        }
 //                        ObjectName servletObjectName = (ObjectName) servletNames.iterator().next();
 //                        String servletName = servletObjectName.getKeyProperty("name");
-//                        defaultFilterMappingObjectName = NameFactory.getWebFilterMappingName(null, null, null, null, filterName, servletName, null, moduleJ2eeContext);
+//                        defaultFilterMappingObjectName = NameFactory.getWebFilterMappingName(null, null, null, null, filterName, servletName, null, moduleName);
 //                    }
 //                    filterMappingGBeanData.setName(defaultFilterMappingObjectName);
 //                    filterMappingGBeanData.setReferencePattern("JettyFilterMappingRegistration", webModuleName);
@@ -599,22 +596,22 @@
                 String filterName = filterMappingType.getFilterName().getStringValue().trim();
                 GBeanData filterMappingData = new GBeanData(JettyFilterMapping.GBEAN_INFO);
                 filterMappingData.setReferencePattern("Previous", previous);
-                filterMappingData.setReferencePattern("JettyServletRegistration", webModuleName);
+                filterMappingData.setReferencePattern("JettyServletRegistration", moduleName);
+                AbstractName filterAbstractName = NameFactory.getChildName(moduleName, NameFactory.WEB_FILTER, filterName, null);
 
-                ObjectName filterMappingName = null;
+                AbstractName filterMappingName = null;
                 if (filterMappingType.isSetUrlPattern()) {
-                    //do not trim!
                     String urlPattern = filterMappingType.getUrlPattern().getStringValue().trim();
                     filterMappingData.setAttribute("urlPattern", urlPattern);
-                    filterMappingName = NameFactory.getWebFilterMappingName(null, null, null, null, filterName, null, urlPattern, moduleJ2eeContext);
+                    filterMappingName = NameFactory.getChildName(filterAbstractName, NameFactory.URL_WEB_FILTER_MAPPING, urlPattern, null);
                 }
                 if (filterMappingType.isSetServletName()) {
                     String servletName = filterMappingType.getServletName().getStringValue().trim();
-                    ObjectName servletObjectName = NameFactory.getWebComponentName(null, null, null, null, servletName, NameFactory.SERVLET, moduleJ2eeContext);
-                    filterMappingData.setReferencePattern("Servlet", servletObjectName);
-                    filterMappingName = NameFactory.getWebFilterMappingName(null, null, null, null, filterName, servletName, null, moduleJ2eeContext);
+                    AbstractName servletAbstractName = NameFactory.getChildName(moduleName, NameFactory.SERVLET, servletName, null);
+                    filterMappingData.setReferencePattern("Servlet", servletAbstractName);
+                    filterMappingName = NameFactory.getChildName(filterAbstractName, NameFactory.SERVLET_WEB_FILTER_MAPPING, servletName, null);
                 }
-                filterMappingData.setName(filterMappingName);
+                filterMappingData.setAbstractName(filterMappingName);
                 previous = filterMappingName;
 
                 boolean request = filterMappingType.getDispatcherArray().length == 0;
@@ -637,8 +634,7 @@
                 filterMappingData.setAttribute("forwardDispatch", Boolean.valueOf(forward));
                 filterMappingData.setAttribute("includeDispatch", Boolean.valueOf(include));
                 filterMappingData.setAttribute("errorDispatch", Boolean.valueOf(error));
-                ObjectName filterObjectName = NameFactory.getWebComponentName(null, null, null, null, filterName, NameFactory.WEB_FILTER, moduleJ2eeContext);
-                filterMappingData.setReferencePattern("Filter", filterObjectName);
+                filterMappingData.setReferencePattern("Filter", filterAbstractName);
                 moduleContext.addGBean(filterMappingData);
             }
 
@@ -646,8 +642,8 @@
             for (int i = 0; i < filterArray.length; i++) {
                 FilterType filterType = filterArray[i];
                 String filterName = filterType.getFilterName().getStringValue().trim();
-                ObjectName filterObjectName = NameFactory.getWebComponentName(null, null, null, null, filterName, NameFactory.WEB_FILTER, moduleJ2eeContext);
-                GBeanData filterData = new GBeanData(filterObjectName, JettyFilterHolder.GBEAN_INFO);
+                AbstractName filterAbstractName = NameFactory.getChildName(moduleName, NameFactory.WEB_FILTER, filterName, null);
+                GBeanData filterData = new GBeanData(filterAbstractName, JettyFilterHolder.GBEAN_INFO);
                 filterData.setAttribute("filterName", filterName);
                 filterData.setAttribute("filterClass", filterType.getFilterClass().getStringValue().trim());
                 Map initParams = new HashMap();
@@ -657,7 +653,7 @@
                     initParams.put(paramValueType.getParamName().getStringValue().trim(), paramValueType.getParamValue().getStringValue().trim());
                 }
                 filterData.setAttribute("initParams", initParams);
-                filterData.setReferencePattern("JettyServletRegistration", webModuleName);
+                filterData.setReferencePattern("JettyServletRegistration", moduleName);
                 moduleContext.addGBean(filterData);
             }
 
@@ -666,9 +662,9 @@
                 for (Iterator iterator = defaultServlets.iterator(); iterator.hasNext();) {
                     Object defaultServlet = iterator.next();
                     GBeanData servletGBeanData = getGBeanData(kernel, defaultServlet);
-                    ObjectName defaultServletObjectName = NameFactory.getWebComponentName(null, null, null, null, (String) servletGBeanData.getAttribute("servletName"), NameFactory.SERVLET, moduleJ2eeContext);
-                    servletGBeanData.setName(defaultServletObjectName);
-                    servletGBeanData.setReferencePattern("JettyServletRegistration", webModuleName);
+                    AbstractName defaultServletObjectName = NameFactory.getChildName(moduleName, NameFactory.SERVLET, (String) servletGBeanData.getAttribute("servletName"), null);
+                    servletGBeanData.setAbstractName(defaultServletObjectName);
+                    servletGBeanData.setReferencePattern("JettyServletRegistration", moduleName);
                     Set defaultServletMappings = new HashSet((Collection) servletGBeanData.getAttribute("servletMappings"));
                     defaultServletMappings.removeAll(knownServletMappings);
                     servletGBeanData.setAttribute("servletMappings", defaultServletMappings);
@@ -679,11 +675,11 @@
             //set up servlet gbeans.
             Map portMap = webModule.getPortMap();
 
-            addServlets(webModuleName, webModule.getModuleFile(), servletTypes, servletMappings, securityRoles, rolePermissions, portMap, moduleClassLoader, moduleJ2eeContext, moduleContext);
+            addServlets(moduleName, webModule.getModuleFile(), servletTypes, servletMappings, securityRoles, rolePermissions, portMap, moduleClassLoader, moduleContext);
 
             if (jettyWebApp.isSetSecurityRealmName()) {
                 if (earContext.getSecurityConfiguration() == null) {
-                     throw new DeploymentException("You have specified a <security-realm-name> for the webapp " + webModuleName + " but no <security> configuration (role mapping) is supplied in the Geronimo plan for the web application (or the Geronimo plan for the EAR if the web app is in an EAR)");
+                     throw new DeploymentException("You have specified a <security-realm-name> for the webapp " + moduleName + " but no <security> configuration (role mapping) is supplied in the Geronimo plan for the web application (or the Geronimo plan for the EAR if the web app is in an EAR)");
                 }
                 String securityRealmName = jettyWebApp.getSecurityRealmName().trim();
                 webModuleData.setAttribute("securityRealmName", securityRealmName);
@@ -691,7 +687,7 @@
                 /**
                  * TODO - go back to commented version when possible.
                  */
-                String policyContextID = webModuleName.getCanonicalName().replaceAll("[, :]", "_");
+                String policyContextID = moduleName.toString().replaceAll("[, :]", "_");
                 //String policyContextID = webModuleName.getCanonicalName();
                 webModuleData.setAttribute("policyContextID", policyContextID);
 
@@ -739,20 +735,17 @@
      * @param rolePermissions   a <code>Map</code> value
      * @param portMap           a <code>Map</code> value
      * @param webClassLoader    a <code>ClassLoader</code> value
-     * @param moduleJ2eeContext a <code>J2eeContext</code> value
      * @param earContext        an <code>EARContext</code> value
-     * @throws MalformedObjectNameException if an error occurs
      * @throws DeploymentException          if an error occurs
      */
-    private void addServlets(ObjectName webModuleName,
+    private void addServlets(AbstractName webModuleName,
                              JarFile moduleFile,
                              ServletType[] servletTypes,
                              Map servletMappings,
                              Set securityRoles,
                              Map rolePermissions, Map portMap,
                              ClassLoader webClassLoader,
-                             J2eeContext moduleJ2eeContext,
-                             EARContext earContext) throws MalformedObjectNameException, DeploymentException {
+                             EARContext earContext) throws DeploymentException {
 
         // this TreeSet will order the ServletTypes based on whether
         // they have a load-on-startup element and what its value is
@@ -775,7 +768,7 @@
         ServletType previousServlet = null;
         for (Iterator servlets = loadOrder.iterator(); servlets.hasNext();) {
             ServletType servletType = (ServletType) servlets.next();
-            addServlet(webModuleName, moduleFile, previousServlet, servletType, servletMappings, securityRoles, rolePermissions, portMap, webClassLoader, moduleJ2eeContext, earContext);
+            addServlet(webModuleName, moduleFile, previousServlet, servletType, servletMappings, securityRoles, rolePermissions, portMap, webClassLoader, earContext);
             previousServlet = servletType;
         }
 
@@ -783,7 +776,7 @@
         addUnmappedJSPPermissions(securityRoles, rolePermissions);
     }
 
-    private void addServlet(ObjectName webModuleName,
+    private void addServlet(AbstractName webModuleName,
                             JarFile moduleFile,
                             ServletType previousServlet,
                             ServletType servletType,
@@ -791,10 +784,9 @@
                             Set securityRoles,
                             Map rolePermissions, Map portMap,
                             ClassLoader webClassLoader,
-                            J2eeContext moduleJ2eeContext,
-                            EARContext earContext) throws MalformedObjectNameException, DeploymentException {
+                            EARContext earContext) throws DeploymentException {
         String servletName = servletType.getServletName().getStringValue().trim();
-        ObjectName servletObjectName = NameFactory.getWebComponentName(null, null, null, null, servletName, NameFactory.SERVLET, moduleJ2eeContext);
+        AbstractName servletObjectName = NameFactory.getChildName(webModuleName, NameFactory.SERVLET, servletName, null);
         GBeanData servletData;
         if (servletType.isSetServletClass()) {
             String servletClassName = servletType.getServletClass().getStringValue().trim();
@@ -815,7 +807,7 @@
                 servletData.setAttribute("servletClass", servletClassName);
             } else {
                 servletData = new GBeanData(pojoWebServiceTemplate);
-                servletData.setName(servletObjectName);
+                servletData.setAbstractName(servletObjectName);
                 //let the web service builder deal with configuring the gbean with the web service stack
                 Object portInfo = portMap.get(servletName);
                 if (portInfo == null) {
@@ -837,7 +829,7 @@
         // http://issues.apache.org/jira/browse/GERONIMO-645
         if (null != previousServlet) {
             String name = previousServlet.getServletName().getStringValue().trim();
-            ObjectName oName = NameFactory.getWebComponentName(null, null, null, null, name, NameFactory.SERVLET, moduleJ2eeContext);
+            AbstractName oName = NameFactory.getChildName(webModuleName, NameFactory.SERVLET, name, null);
             servletData.setReferencePattern("Previous", oName);
         }
 
@@ -866,7 +858,11 @@
 
         processRoleRefPermissions(servletType, securityRoles, rolePermissions);
 
-        earContext.addGBean(servletData);
+        try {
+            earContext.addGBean(servletData);
+        } catch (GBeanAlreadyExistsException e) {
+            throw new DeploymentException("Could not add servlet gbean to context", e);
+        }
     }
 
     private Map buildComponentContext(EARContext earContext, Module webModule, WebAppType webApp, JettyWebAppType jettyWebApp, UserTransaction userTransaction, ClassLoader cl) throws DeploymentException {
@@ -892,7 +888,7 @@
         infoBuilder.addAttribute("defaultSessionTimeoutSeconds", Integer.class, true, true);
         infoBuilder.addAttribute("defaultContextPriorityClassloader", boolean.class, true, true);
         infoBuilder.addAttribute("defaultWelcomeFiles", List.class, true, true);
-        infoBuilder.addAttribute("jettyContainerObjectName", ObjectName.class, true, true);
+        infoBuilder.addAttribute("jettyContainerObjectName", AbstractName.class, true, true);
         infoBuilder.addReference("DefaultServlets", Object.class, NameFactory.DEFAULT_SERVLET);
         infoBuilder.addReference("DefaultFilters", Object.class);
         infoBuilder.addReference("DefaultFilterMappings", Object.class);

Modified: geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyFilterMapping.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyFilterMapping.java?rev=385487&r1=385486&r2=385487&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyFilterMapping.java (original)
+++ geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyFilterMapping.java Mon Mar 13 02:07:53 2006
@@ -138,7 +138,7 @@
     public static final GBeanInfo GBEAN_INFO;
 
     static {
-        GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(JettyFilterMapping.class, NameFactory.WEB_FILTER_MAPPING);
+        GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(JettyFilterMapping.class, NameFactory.URL_WEB_FILTER_MAPPING);
         infoBuilder.addAttribute("urlPattern", String.class, true);
         infoBuilder.addAttribute("requestDispatch", boolean.class, true);
         infoBuilder.addAttribute("forwardDispatch", boolean.class, true);
@@ -147,7 +147,7 @@
 
         infoBuilder.addReference("Filter", JettyFilterHolder.class, NameFactory.WEB_FILTER);
         infoBuilder.addReference("Servlet", JettyServletHolder.class, NameFactory.SERVLET);
-        infoBuilder.addReference("Previous", JettyFilterMapping.class, NameFactory.WEB_FILTER_MAPPING);
+        infoBuilder.addReference("Previous", JettyFilterMapping.class, NameFactory.URL_WEB_FILTER_MAPPING);
         infoBuilder.addReference("JettyServletRegistration", JettyServletRegistration.class, NameFactory.WEB_MODULE);
 
         infoBuilder.setConstructor(new String[]{"urlPattern",

Modified: geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyManagerImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyManagerImpl.java?rev=385487&r1=385486&r2=385487&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyManagerImpl.java (original)
+++ geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyManagerImpl.java Mon Mar 13 02:07:53 2006
@@ -21,7 +21,6 @@
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
-import org.apache.geronimo.gbean.GBeanQuery;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.gbean.ReferencePatterns;
@@ -38,10 +37,7 @@
 import org.apache.geronimo.kernel.config.InvalidConfigException;
 import org.apache.geronimo.management.geronimo.WebManager;
 
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
 import java.util.ArrayList;
-import java.util.Hashtable;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
@@ -110,16 +106,10 @@
     /**
      * Get a list of containers for this web implementation.
      */
-    public String[] getContainers() {
-        GBeanQuery query = new GBeanQuery(null, JettyContainer.class.getName());
+    public AbstractName[] getContainers() {
+        AbstractNameQuery query = new AbstractNameQuery(JettyContainer.class.getName());
         Set names = kernel.listGBeans(query);
-        String[] result = new String[names.size()];
-        int i = 0;
-        for (Iterator it = names.iterator(); it.hasNext();) {
-            ObjectName name = (ObjectName) it.next();
-            result[i++] = name.getCanonicalName();
-        }
-        return result;
+        return (AbstractName[]) names.toArray(new AbstractName[names.size()]);
     }
 
     /**
@@ -175,133 +165,91 @@
      *
      * @param protocol A protocol as returned by getSupportedProtocols
      */
-    public String[] getConnectors(String protocol) {
-        GBeanQuery query = new GBeanQuery(null, JettyWebConnector.class.getName());
+    public AbstractName[] getConnectors(String protocol) {
+        AbstractNameQuery query = new AbstractNameQuery(JettyWebConnector.class.getName());
         Set names = kernel.listGBeans(query);
         List result = new ArrayList();
         for (Iterator it = names.iterator(); it.hasNext();) {
-            ObjectName name = (ObjectName) it.next();
+            AbstractName name = (AbstractName) it.next();
             try {
                 if (kernel.getAttribute(name, "protocol").equals(protocol)) {
-                    result.add(name.getCanonicalName());
+                    result.add(name);
                 }
             } catch (Exception e) {
                 log.error("Unable to check the protocol for a connector", e);
             }
         }
-        return (String[]) result.toArray(new String[result.size()]);
+        return (AbstractName[]) result.toArray(new AbstractName[result.size()]);
     }
 
-    public String getAccessLog(String containerObjectName) {
-        GBeanQuery query = new GBeanQuery(null, JettyLogManager.class.getName());
+    public AbstractName getAccessLog(String containerObjectName) {
+        AbstractNameQuery query = new AbstractNameQuery(JettyLogManager.class.getName());
         Set names = kernel.listGBeans(query);
         if(names.size() == 0) {
             return null;
         } else if(names.size() > 1) {
             throw new IllegalStateException("Should not be more than one Jetty access log manager");
         }
-        return ((ObjectName)names.iterator().next()).getCanonicalName();
+        return (AbstractName)names.iterator().next();
     }
 
     /**
      * Gets the ObjectNames of any existing connectors.
      */
-    public String[] getConnectors() {
-        GBeanQuery query = new GBeanQuery(null, JettyWebConnector.class.getName());
+    public AbstractName[] getConnectors() {
+        AbstractNameQuery query = new AbstractNameQuery(JettyWebConnector.class.getName());
         Set names = kernel.listGBeans(query);
-        String[] result = new String[names.size()];
-        int i = 0;
-        for (Iterator it = names.iterator(); it.hasNext();) {
-            ObjectName name = (ObjectName) it.next();
-            result[i++] = name.getCanonicalName();
-        }
-        return result;
+        return (AbstractName[]) names.toArray(new AbstractName[names.size()]);
     }
 
-    public String[] getConnectorsForContainer(String containerObjectName, String protocol) {
+    public AbstractName[] getConnectorsForContainer(AbstractName containerName, String protocol) {
         if(protocol == null) {
-            return getConnectorsForContainer(containerObjectName);
+            return getConnectorsForContainer(containerName);
         }
         try {
-            ObjectName containerName = ObjectName.getInstance(containerObjectName);
             List results = new ArrayList();
-            GBeanQuery query = new GBeanQuery(null, JettyWebConnector.class.getName());
+            AbstractNameQuery query = new AbstractNameQuery(JettyWebConnector.class.getName());
             Set set = kernel.listGBeans(query); // all Jetty connectors
             for (Iterator it = set.iterator(); it.hasNext();) {
-                ObjectName name = (ObjectName) it.next(); // a single Jetty connector
+                AbstractName name = (AbstractName) it.next(); // a single Jetty connector
                 GBeanData data = kernel.getGBeanData(name);
                 ReferencePatterns refs = data.getReferencePatterns(JettyConnector.CONNECTOR_CONTAINER_REFERENCE);
-                for (Iterator refit = refs.iterator(); refit.hasNext();) {
-                    ObjectName ref = (ObjectName) refit.next();
-                    boolean match = false;
-                    if(ref.isPattern()) {
-                        Set matches = kernel.listGBeans(ref);
-                        if(matches.size() != 1) {
-                            log.error("Unable to compare a connector->container reference that's a pattern to a fixed container name: "+ref.getCanonicalName());
-                        } else {
-                            ref = (ObjectName)matches.iterator().next();
-                            if(ref.equals(containerName)) {
-                                match = true;
-                            }
-                        }
-                    } else {
-                        if(ref.equals(containerName)) {
-                            match = true;
+                //TODO configid need to verify that the refpattern is resolved
+                if(containerName.equals(refs.getAbstractName())) {
+                    try {
+                        String testProtocol = (String) kernel.getAttribute(name, "protocol");
+                        if(testProtocol != null && testProtocol.equals(protocol)) {
+                            results.add(name);
                         }
+                    } catch (Exception e) {
+                        log.error("Unable to look up protocol for connector '"+name+"'",e);
                     }
-                    if(match) {
-                        try {
-                            String testProtocol = (String) kernel.getAttribute(name, "protocol");
-                            if(testProtocol != null && testProtocol.equals(protocol)) {
-                                results.add(name.getCanonicalName());
-                            }
-                        } catch (Exception e) {
-                            log.error("Unable to look up protocol for connector '"+name+"'",e);
-                        }
-                        break;
-                    }
+                    break;
                 }
             }
-            return (String[]) results.toArray(new String[results.size()]);
+            return (AbstractName[]) results.toArray(new AbstractName[results.size()]);
         } catch (Exception e) {
-            throw new IllegalArgumentException("Unable to look up connectors for Jetty container '"+containerObjectName+"': "+e);
+            throw new IllegalArgumentException("Unable to look up connectors for Jetty container '"+containerName +"': "+e);
         }
     }
 
-    public String[] getConnectorsForContainer(String containerObjectName) {
+    public AbstractName[] getConnectorsForContainer(AbstractName containerName) {
         try {
-            ObjectName containerName = ObjectName.getInstance(containerObjectName);
             List results = new ArrayList();
-            GBeanQuery query = new GBeanQuery(null, JettyWebConnector.class.getName());
+            AbstractNameQuery query = new AbstractNameQuery(JettyWebConnector.class.getName());
             Set set = kernel.listGBeans(query); // all Jetty connectors
             for (Iterator it = set.iterator(); it.hasNext();) {
-                ObjectName name = (ObjectName) it.next(); // a single Jetty connector
+                AbstractName name = (AbstractName) it.next(); // a single Jetty connector
                 GBeanData data = kernel.getGBeanData(name);
-                Set refs = data.getReferencePatterns(JettyConnector.CONNECTOR_CONTAINER_REFERENCE);
-                for (Iterator refit = refs.iterator(); refit.hasNext();) {
-                    ObjectName ref = (ObjectName) refit.next();
-                    if(ref.isPattern()) {
-                        Set matches = kernel.listGBeans(ref);
-                        if(matches.size() != 1) {
-                            log.error("Unable to compare a connector->container reference that's a pattern to a fixed container name: "+ref.getCanonicalName());
-                        } else {
-                            ref = (ObjectName)matches.iterator().next();
-                            if(ref.equals(containerName)) {
-                                results.add(name.getCanonicalName());
-                                break;
-                            }
-                        }
-                    } else {
-                        if(ref.equals(containerName)) {
-                            results.add(name.getCanonicalName());
-                            break;
-                        }
-                    }
+                ReferencePatterns refs = data.getReferencePatterns(JettyConnector.CONNECTOR_CONTAINER_REFERENCE);
+                //TODO configid need to verify that the refpattern is resolved
+                if (containerName.equals(refs.getAbstractName())) {
+                    results.add(name);
                 }
             }
-            return (String[]) results.toArray(new String[results.size()]);
+            return (AbstractName[]) results.toArray(new AbstractName[results.size()]);
         } catch (Exception e) {
-            throw new IllegalArgumentException("Unable to look up connectors for Jetty container '"+containerObjectName+"': "+e);
+            throw new IllegalArgumentException("Unable to look up connectors for Jetty container '"+containerName +"': "+e);
         }
     }
 

Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/AbstractName.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/AbstractName.java?rev=385487&r1=385486&r2=385487&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/AbstractName.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/AbstractName.java Mon Mar 13 02:07:53 2006
@@ -25,7 +25,6 @@
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
-import java.util.Arrays;
 
 /**
  * @version $Rev:$ $Date:$
@@ -95,9 +94,8 @@
         final AbstractName that = (AbstractName) o;
 
         if (artifact != null ? !artifact.equals(that.artifact) : that.artifact != null) return false;
-        if (name != null ? !name.equals(that.name) : that.name != null) return false;
+        return !(name != null ? !name.equals(that.name) : that.name != null);
 
-        return true;
     }
 
     public int hashCode() {

Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/Kernel.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/Kernel.java?rev=385487&r1=385486&r2=385487&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/Kernel.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/Kernel.java Mon Mar 13 02:07:53 2006
@@ -267,7 +267,7 @@
      * returns an ObjectName for it.  If the argument is not a service or the
      * kernel cannot produce an ObjectName for it, returns null.
      */
-    ObjectName getObjectNameFor(Object service);
+    AbstractName getAbstractNameFor(Object service);
 
     /**
      * Brings the kernel online

Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/KernelGBean.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/KernelGBean.java?rev=385487&r1=385486&r2=385487&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/KernelGBean.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/KernelGBean.java Mon Mar 13 02:07:53 2006
@@ -223,8 +223,8 @@
         kernel.shutdown();
     }
 
-    public ObjectName getObjectNameFor(Object service) {
-        return kernel.getObjectNameFor(service);
+    public AbstractName getAbstractNameFor(Object service) {
+        return kernel.getAbstractNameFor(service);
     }
 
     public static final GBeanInfo GBEAN_INFO;

Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicKernel.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicKernel.java?rev=385487&r1=385486&r2=385487&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicKernel.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicKernel.java Mon Mar 13 02:07:53 2006
@@ -408,7 +408,7 @@
         return results;
     }
 
-    public ObjectName getObjectNameFor(Object service) {
+    public AbstractName getAbstractNameFor(Object service) {
         if(!running) {return null;}
         return proxyManager.getProxyTarget(service);
     }

Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicProxyManager.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicProxyManager.java?rev=385487&r1=385486&r2=385487&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicProxyManager.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicProxyManager.java Mon Mar 13 02:07:53 2006
@@ -188,12 +188,12 @@
         return interceptors.containsKey(proxy);
     }
 
-    public ObjectName getProxyTarget(Object proxy) {
+    public AbstractName getProxyTarget(Object proxy) {
         MethodInterceptor methodInterceptor = (MethodInterceptor) interceptors.get(proxy);
         if (methodInterceptor == null) {
             return null;
         }
-        return getAbstractName(methodInterceptor).getObjectName();
+        return getAbstractName(methodInterceptor);
     }
 
     private class ManagedProxyFactory implements ProxyFactory {

Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/ProxyMethodInterceptor.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/ProxyMethodInterceptor.java?rev=385487&r1=385486&r2=385487&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/ProxyMethodInterceptor.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/ProxyMethodInterceptor.java Mon Mar 13 02:07:53 2006
@@ -16,32 +16,31 @@
  */
 package org.apache.geronimo.kernel.basic;
 
-import java.lang.reflect.Method;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-import java.util.HashSet;
-import java.beans.Introspector;
-import javax.management.ObjectName;
-
 import net.sf.cglib.asm.Type;
 import net.sf.cglib.core.Signature;
 import net.sf.cglib.proxy.MethodInterceptor;
 import net.sf.cglib.proxy.MethodProxy;
 import net.sf.cglib.reflect.FastClass;
-import org.apache.geronimo.gbean.GOperationSignature;
-import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.GAttributeInfo;
-import org.apache.geronimo.gbean.GOperationInfo;
 import org.apache.geronimo.gbean.GBeanData;
-import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GOperationInfo;
+import org.apache.geronimo.gbean.GOperationSignature;
 import org.apache.geronimo.gbean.runtime.GBeanInstance;
 import org.apache.geronimo.gbean.runtime.RawInvoker;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.management.State;
 import org.apache.geronimo.kernel.proxy.DeadProxyException;
-import org.apache.geronimo.kernel.proxy.ProxyManager;
 import org.apache.geronimo.kernel.proxy.GeronimoManagedBean;
+import org.apache.geronimo.kernel.proxy.ProxyManager;
+
+import java.beans.Introspector;
+import java.lang.reflect.Method;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
 
 /**
  * @version $Rev$ $Date$
@@ -55,8 +54,6 @@
     /**
      * The object name to which we are connected.
      */
-//    private final ObjectName objectName;
-
     private final AbstractName abstractName;
 
     /**
@@ -78,10 +75,6 @@
         gbeanInvokers = null;
     }
 
-//    public ObjectName getObjectName() {
-//        return objectName;
-//    }
-
     public AbstractName getAbstractName() {
         return abstractName;
     }
@@ -308,7 +301,7 @@
         }
 
         public Object invoke(AbstractName abstractName, Object[] arguments) throws Throwable {
-            ObjectName proxyTarget = proxyManager.getProxyTarget(arguments[0]);
+            AbstractName proxyTarget = proxyManager.getProxyTarget(arguments[0]);
             return Boolean.valueOf(abstractName.equals(proxyTarget));
         }
     }

Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/jmx/JMXProxyMethodInterceptor.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/jmx/JMXProxyMethodInterceptor.java?rev=385487&r1=385486&r2=385487&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/jmx/JMXProxyMethodInterceptor.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/jmx/JMXProxyMethodInterceptor.java Mon Mar 13 02:07:53 2006
@@ -16,25 +16,24 @@
  */
 package org.apache.geronimo.kernel.jmx;
 
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import javax.management.ObjectName;
-
 import net.sf.cglib.asm.Type;
 import net.sf.cglib.core.Signature;
 import net.sf.cglib.proxy.MethodInterceptor;
 import net.sf.cglib.proxy.MethodProxy;
 import net.sf.cglib.reflect.FastClass;
+import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.kernel.management.State;
 import org.apache.geronimo.kernel.basic.KernelGetAttributeInvoker;
 import org.apache.geronimo.kernel.basic.KernelOperationInvoker;
 import org.apache.geronimo.kernel.basic.KernelSetAttributeInvoker;
 import org.apache.geronimo.kernel.basic.ProxyInvoker;
+import org.apache.geronimo.kernel.management.State;
 import org.apache.geronimo.kernel.proxy.DeadProxyException;
-import org.apache.geronimo.kernel.proxy.ProxyManager;
 import org.apache.geronimo.kernel.proxy.GeronimoManagedBean;
-import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.kernel.proxy.ProxyManager;
+
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
 
 /**
  * @version $Rev$ $Date$
@@ -186,7 +185,7 @@
         }
 
         public Object invoke(AbstractName abstractName, Object[] arguments) throws Throwable {
-            ObjectName proxyTarget = proxyManager.getProxyTarget(arguments[0]);
+            AbstractName proxyTarget = proxyManager.getProxyTarget(arguments[0]);
             return Boolean.valueOf(abstractName.equals(proxyTarget));
         }
     }

Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/jmx/KernelDelegate.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/jmx/KernelDelegate.java?rev=385487&r1=385486&r2=385487&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/jmx/KernelDelegate.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/jmx/KernelDelegate.java Mon Mar 13 02:07:53 2006
@@ -436,7 +436,7 @@
         }
     }
 
-    public ObjectName getObjectNameFor(Object service) {
+    public AbstractName getAbstractNameFor(Object service) {
         return proxyManager.getProxyTarget(service);
     }
 

Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/proxy/ProxyManager.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/proxy/ProxyManager.java?rev=385487&r1=385486&r2=385487&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/proxy/ProxyManager.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/proxy/ProxyManager.java Mon Mar 13 02:07:53 2006
@@ -111,5 +111,5 @@
      * @param proxy the proxy to get the target object name from
      * @return the object name of the target
      */
-    public ObjectName getProxyTarget(Object proxy);
+    public AbstractName getProxyTarget(Object proxy);
 }

Modified: geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/NetworkManager.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/NetworkManager.java?rev=385487&r1=385486&r2=385487&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/NetworkManager.java (original)
+++ geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/NetworkManager.java Mon Mar 13 02:07:53 2006
@@ -32,7 +32,7 @@
     /**
      * Gets the network containers.
      */
-    public String[] getContainers();
+    public AbstractName[] getContainers();
 
     /**
      * Gets the protocols which this container can configure connectors for.
@@ -53,25 +53,27 @@
      *
      * @param protocol A protocol as returned by getSupportedProtocols
      */
-    public String[] getConnectors(String protocol);
+    public AbstractName[] getConnectors(String protocol);
 
     /**
      * Gets the ObjectNames of any existing connectors associated with this
      * network technology.
      */
-    public String[] getConnectors();
+    public AbstractName[] getConnectors();
 
     /**
      * Gets the ObjectNames of any existing connectors for the specified
      * container for the specified protocol.
      *
+     * @param containerName
      * @param protocol A protocol as returned by getSupportedProtocols
      */
-    public String[] getConnectorsForContainer(String containerObjectName, String protocol);
+    public AbstractName[] getConnectorsForContainer(AbstractName containerName, String protocol);
 
     /**
      * Gets the ObjectNames of any existing connectors for the specified
      * container.
+     * @param containerName
      */
-    public String[] getConnectorsForContainer(String containerObjectName);
+    public AbstractName[] getConnectorsForContainer(AbstractName containerName);
 }

Modified: geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/WebManager.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/WebManager.java?rev=385487&r1=385486&r2=385487&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/WebManager.java (original)
+++ geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/WebManager.java Mon Mar 13 02:07:53 2006
@@ -56,8 +56,7 @@
      * container.  May be null if the access log cannot be managed.
      *
      * @param containerObjectName The ObjectName of the container whose access
-     *                            log you're interested in.
      *
      */
-    public String getAccessLog(String containerObjectName);
+    public AbstractName getAccessLog(String containerObjectName);
 }

Modified: geronimo/branches/1.1/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java?rev=385487&r1=385486&r2=385487&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java (original)
+++ geronimo/branches/1.1/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java Mon Mar 13 02:07:53 2006
@@ -175,7 +175,7 @@
                     AbstractNameQuery containerId = getResourceContainerId(name, j2eeType, moduleURI, gerResourceRef, earContext);
 
                     //TODO configid not sure what knownParent is supposed to be
-                    ref = refContext.getConnectionFactoryRef(containerId, iface, earContext.getConfiguration(null));
+                    ref = refContext.getConnectionFactoryRef(containerId, iface, earContext.getConfiguration());
                     builder.bind(name, ref);
                 } catch (UnresolvedReferenceException e) {
                     throw new DeploymentException("Unable to resolve resource reference '" + name + "' (" + (e.isMultiple() ? "found multiple matching resources" : "no matching resources found") + ")");
@@ -220,7 +220,7 @@
             try {
                 AbstractNameQuery containerId = getAdminObjectContainerId(name, gerResourceEnvRef, earContext);
                 //TODO not sure what knownParent is supposed to be
-                Reference ref = earContext.getRefContext().getAdminObjectRef(containerId, iface, earContext.getConfiguration(null));
+                Reference ref = earContext.getRefContext().getAdminObjectRef(containerId, iface, earContext.getConfiguration());
 
                 builder.bind(name, ref);
             } catch (UnresolvedReferenceException e) {
@@ -283,7 +283,7 @@
             //throws exception if it can't locate ref.
             AbstractNameQuery containerId = buildAbstractNameQuery(moduleURI, NameFactory.JCA_ADMIN_OBJECT, linkName);
             //TODO configid not sure what knwonParent is suppsed to be
-            Reference ref = refContext.getAdminObjectRef(containerId, iface, earContext.getConfiguration(null));
+            Reference ref = refContext.getAdminObjectRef(containerId, iface, earContext.getConfiguration());
             builder.bind(name, ref);
 
         }
@@ -743,7 +743,7 @@
     }
 
     //TODO consider including target interface
-    private static AbstractNameQuery buildAbstractNameQuery(GerPatternType pattern, String type) {
+    public static AbstractNameQuery buildAbstractNameQuery(GerPatternType pattern, String type) {
         String groupId = pattern.isSetGroupId() ? pattern.getGroupId().trim() : null;
         String artifactid = pattern.isSetArtifactId() ? pattern.getArtifactId().trim() : null;
         String version = pattern.isSetVersion() ? pattern.getVersion().trim() : null;
@@ -762,7 +762,7 @@
         return new AbstractNameQuery(artifact, nameMap, Collections.EMPTY_SET);
     }
 
-    private static AbstractNameQuery buildAbstractNameQuery(String module, String type, String name) {
+    public static AbstractNameQuery buildAbstractNameQuery(String module, String type, String name) {
         Map nameMap = new HashMap();
         nameMap.put("name", name);
         if (type != null) {

Modified: geronimo/branches/1.1/modules/security/src/java/org/apache/geronimo/security/jaas/JaasLoginModuleUse.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/security/src/java/org/apache/geronimo/security/jaas/JaasLoginModuleUse.java?rev=385487&r1=385486&r2=385487&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/security/src/java/org/apache/geronimo/security/jaas/JaasLoginModuleUse.java (original)
+++ geronimo/branches/1.1/modules/security/src/java/org/apache/geronimo/security/jaas/JaasLoginModuleUse.java Mon Mar 13 02:07:53 2006
@@ -72,14 +72,14 @@
     }
 
     public String getLoginModuleName() {
-        return kernel.getObjectNameFor(loginModule).getCanonicalName();
+        return kernel.getAbstractNameFor(loginModule).getObjectName().getCanonicalName();
     }
 
     public String getNextName() {
         if(next == null) {
             return null;
         }
-        return kernel.getObjectNameFor(next).getCanonicalName();
+        return kernel.getAbstractNameFor(next).getObjectName().getCanonicalName();
     }
 
     public String getControlFlag() {

Modified: geronimo/branches/1.1/modules/security/src/java/org/apache/geronimo/security/realm/GenericSecurityRealm.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/security/src/java/org/apache/geronimo/security/realm/GenericSecurityRealm.java?rev=385487&r1=385486&r2=385487&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/security/src/java/org/apache/geronimo/security/realm/GenericSecurityRealm.java (original)
+++ geronimo/branches/1.1/modules/security/src/java/org/apache/geronimo/security/realm/GenericSecurityRealm.java Mon Mar 13 02:07:53 2006
@@ -110,7 +110,7 @@
     }
 
     public String getLoginModuleChainName() {
-        return kernel.getObjectNameFor(loginModuleUse).getCanonicalName();
+        return kernel.getAbstractNameFor(loginModuleUse).getObjectName().getCanonicalName();
     }
 
     /**

Modified: geronimo/branches/1.1/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java?rev=385487&r1=385486&r2=385487&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java (original)
+++ geronimo/branches/1.1/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java Mon Mar 13 02:07:53 2006
@@ -26,6 +26,7 @@
 import org.apache.geronimo.deployment.xbeans.EnvironmentType;
 import org.apache.geronimo.deployment.xbeans.GbeanType;
 import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
+import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
@@ -34,13 +35,11 @@
 import org.apache.geronimo.j2ee.deployment.ModuleBuilder;
 import org.apache.geronimo.j2ee.deployment.WebModule;
 import org.apache.geronimo.j2ee.deployment.WebServiceBuilder;
-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.StoredObject;
-import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.config.ConfigurationData;
+import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.kernel.repository.Repository;
@@ -71,9 +70,8 @@
 import org.apache.xmlbeans.XmlException;
 import org.apache.xmlbeans.XmlObject;
 
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
 import javax.transaction.UserTransaction;
+import javax.management.MalformedObjectNameException;
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.IOException;
@@ -101,7 +99,7 @@
 
     private final Environment defaultEnvironment;
     private final boolean defaultContextPriorityClassloader;
-    private final ObjectName tomcatContainerObjectName;
+    private final AbstractName tomcatContainerObjectName;
 
     private final WebServiceBuilder webServiceBuilder;
 
@@ -109,18 +107,18 @@
 
     public TomcatModuleBuilder(Environment defaultEnvironment,
                                boolean defaultContextPriorityClassloader,
-                               ObjectName tomcatContainerObjectName,
+                               AbstractName tomcatContainerName,
                                WebServiceBuilder webServiceBuilder,
                                Kernel kernel) {
         super(kernel);
         this.defaultEnvironment = defaultEnvironment;
 
         this.defaultContextPriorityClassloader = defaultContextPriorityClassloader;
-        this.tomcatContainerObjectName = tomcatContainerObjectName;
+        this.tomcatContainerObjectName = tomcatContainerName;
         this.webServiceBuilder = webServiceBuilder;
     }
 
-    protected Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl, boolean standAlone, String contextRoot) throws DeploymentException {
+    protected Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl, boolean standAlone, String contextRoot, AbstractName earName) throws DeploymentException {
         assert moduleFile != null: "moduleFile is null";
         assert targetPath != null: "targetPath is null";
         assert !targetPath.endsWith("/"): "targetPath must not end with a '/'";
@@ -185,8 +183,18 @@
         } catch (MalformedURLException e) {
             //no descriptor
         }
+        AbstractName moduleName;
+        if (earName == null) {
+            try {
+                moduleName = NameFactory.buildModuleName(environment.getProperties(), environment.getConfigId(), ConfigurationModuleType.WAR, null);
+            } catch (MalformedObjectNameException e) {
+                throw new DeploymentException("Could not construct standalone web module name", e);
+            }
+        } else {
+            moduleName = NameFactory.getChildName(earName, NameFactory.WEB_MODULE, targetPath, null);
+        }
 
-        return new WebModule(standAlone, environment, moduleFile, targetPath, webApp, tomcatWebApp, specDD, contextRoot, portMap, TOMCAT_NAMESPACE);
+        return new WebModule(standAlone, moduleName, environment, moduleFile, targetPath, webApp, tomcatWebApp, specDD, contextRoot, portMap, TOMCAT_NAMESPACE);
     }
 
 
@@ -265,34 +273,23 @@
 
     public void addGBeans(EARContext earContext, Module module, ClassLoader cl, Repository repository) throws DeploymentException {
         EARContext moduleContext = module.getEarContext();
-        Configuration knownParent = null;
-        if (!module.isStandAlone()) {
-            knownParent = earContext.getConfiguration(null);
-        }
-        ClassLoader moduleClassLoader = moduleContext.getClassLoader(knownParent);
-        J2eeContext earJ2eeContext = moduleContext.getModuleName();
-        J2eeContext moduleJ2eeContext = J2eeContextImpl.newModuleContextFromApplication(earJ2eeContext, NameFactory.WEB_MODULE, module.getName());
+        ClassLoader moduleClassLoader = moduleContext.getClassLoader();
+        AbstractName moduleName = moduleContext.getModuleName();
         WebModule webModule = (WebModule) module;
 
         WebAppType webApp = (WebAppType) webModule.getSpecDD();
         TomcatWebAppType tomcatWebApp = (TomcatWebAppType) webModule.getVendorDD();
 
         GbeanType[] gbeans = tomcatWebApp.getGbeanArray();
-        ServiceConfigBuilder.addGBeans(gbeans, moduleClassLoader, moduleJ2eeContext, moduleContext);
+        ServiceConfigBuilder.addGBeans(gbeans, moduleClassLoader, moduleName, moduleContext);
 
-        ObjectName webModuleName;
-        try {
-            webModuleName = NameFactory.getModuleName(null, null, null, null, null, moduleJ2eeContext);
-        } catch (MalformedObjectNameException e) {
-            throw new DeploymentException("Could not construct module name", e);
-        }
 
         UserTransaction userTransaction = new OnlineUserTransaction();
         //this may add to the web classpath with enhanced classes.
         //N.B. we use the ear context which has all the gbeans we could possibly be looking up from this ear.
         Map compContext = buildComponentContext(earContext, webModule, webApp, tomcatWebApp, userTransaction, moduleClassLoader);
 
-        GBeanData webModuleData = new GBeanData(webModuleName, TomcatWebAppContext.GBEAN_INFO);
+        GBeanData webModuleData = new GBeanData(moduleName, TomcatWebAppContext.GBEAN_INFO);
         try {
             webModuleData.setReferencePattern("J2EEServer", moduleContext.getServerObjectName());
             if (!moduleContext.getJ2EEApplicationName().equals("null")) {
@@ -336,24 +333,24 @@
             }
             if (tomcatWebApp.isSetTomcatRealm()) {
                 String tomcatRealm = tomcatWebApp.getTomcatRealm().trim();
-                ObjectName realmName = NameFactory.getComponentName(null, null, null, null, tomcatRealm, RealmGBean.GBEAN_INFO.getJ2eeType(), moduleJ2eeContext);
+                AbstractName realmName = NameFactory.getChildName(moduleName, RealmGBean.GBEAN_INFO.getJ2eeType(), tomcatRealm, null);
                 webModuleData.setReferencePattern("TomcatRealm", realmName);
             }
             if (tomcatWebApp.isSetValveChain()) {
                 String valveChain = tomcatWebApp.getValveChain().trim();
-                ObjectName valveName = NameFactory.getComponentName(null, null, null, null, valveChain, ValveGBean.J2EE_TYPE, moduleJ2eeContext);
+                AbstractName valveName = NameFactory.getChildName(moduleName, ValveGBean.J2EE_TYPE, valveChain, null);
                 webModuleData.setReferencePattern("TomcatValveChain", valveName);
             }
 
             if (tomcatWebApp.isSetCluster()) {
                 String cluster = tomcatWebApp.getCluster().trim();
-                ObjectName clusterName = NameFactory.getComponentName(null, null, null, null, cluster, CatalinaClusterGBean.J2EE_TYPE, moduleJ2eeContext);
+                AbstractName clusterName = NameFactory.getChildName(moduleName, CatalinaClusterGBean.J2EE_TYPE, cluster, null);
                 webModuleData.setReferencePattern("Cluster", clusterName);
             }
 
             if (tomcatWebApp.isSetManager()) {
                 String manager = tomcatWebApp.getManager().trim();
-                ObjectName managerName = NameFactory.getComponentName(null, null, null, null, manager, ManagerGBean.J2EE_TYPE, moduleJ2eeContext);
+                AbstractName managerName = NameFactory.getChildName(moduleName, ManagerGBean.J2EE_TYPE, manager, null);
                 webModuleData.setReferencePattern("Manager", managerName);
             }
             Map portMap = webModule.getPortMap();
@@ -393,7 +390,7 @@
 
             if (tomcatWebApp.isSetSecurityRealmName()) {
                 if (earContext.getSecurityConfiguration() == null) {
-                     throw new DeploymentException("You have specified a <security-realm-name> for the webapp " + webModuleName + " but no <security> configuration (role mapping) is supplied in the Geronimo plan for the web application (or the Geronimo plan for the EAR if the web app is in an EAR)");
+                     throw new DeploymentException("You have specified a <security-realm-name> for the webapp " + moduleName + " but no <security> configuration (role mapping) is supplied in the Geronimo plan for the web application (or the Geronimo plan for the EAR if the web app is in an EAR)");
                 }
 
                 SecurityHolder securityHolder = new SecurityHolder();
@@ -402,7 +399,7 @@
                 /**
                  * TODO - go back to commented version when possible.
                  */
-                String policyContextID = webModuleName.getCanonicalName().replaceAll("[, :]", "_");
+                String policyContextID = moduleName.toString().replaceAll("[, :]", "_");
                 securityHolder.setPolicyContextID(policyContextID);
 
                 ComponentPermissions componentPermissions = buildSpecSecurityConfig(webApp, securityRoles, rolePermissions);
@@ -475,7 +472,7 @@
         GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(TomcatModuleBuilder.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addAttribute("defaultEnvironment", Environment.class, true, true);
         infoBuilder.addAttribute("defaultContextPriorityClassloader", boolean.class, true, true);
-        infoBuilder.addAttribute("tomcatContainerObjectName", ObjectName.class, true, true);
+        infoBuilder.addAttribute("tomcatContainerObjectName", AbstractName.class, true, true);
         infoBuilder.addReference("WebServiceBuilder", WebServiceBuilder.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addAttribute("kernel", Kernel.class, false);
         infoBuilder.addInterface(ModuleBuilder.class);



Mime
View raw message