geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r384667 [1/2] - in /geronimo/branches/1.1/modules: client-builder/src/java/org/apache/geronimo/client/builder/ connector-builder/src/java/org/apache/geronimo/connector/deployment/ j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ j...
Date Fri, 10 Mar 2006 01:25:16 GMT
Author: djencks
Date: Thu Mar  9 17:25:07 2006
New Revision: 384667

URL: http://svn.apache.org/viewcvs?rev=384667&view=rev
Log:
Make some more modules compile... gets to j2ee-builder

Added:
    geronimo/branches/1.1/modules/security-builder/src/schema/geronimo-login-config-1.1.xsd
Modified:
    geronimo/branches/1.1/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
    geronimo/branches/1.1/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
    geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
    geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARContext.java
    geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/NamingContext.java
    geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/RefContext.java
    geronimo/branches/1.1/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockNamingContext.java
    geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/j2eeobjectnames/NameFactory.java
    geronimo/branches/1.1/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/AbstractName.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/GBeanData.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/ReferencePatterns.java
    geronimo/branches/1.1/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java
    geronimo/branches/1.1/modules/naming-builder/src/test/org/apache/geronimo/naming/deployment/MessageDestinationTest.java
    geronimo/branches/1.1/modules/security-builder/maven.xml
    geronimo/branches/1.1/modules/security-builder/project.xml
    geronimo/branches/1.1/modules/security-builder/src/java/org/apache/geronimo/security/deployment/LoginConfigBuilder.java
    geronimo/branches/1.1/modules/security-builder/src/java/org/apache/geronimo/security/deployment/SecurityBuilder.java
    geronimo/branches/1.1/modules/security-builder/src/schema/xmlconfig.xml
    geronimo/branches/1.1/modules/service-builder/src/java/org/apache/geronimo/deployment/service/GBeanBuilder.java
    geronimo/branches/1.1/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java
    geronimo/branches/1.1/modules/service-builder/src/java/org/apache/geronimo/deployment/service/XmlReferenceBuilder.java
    geronimo/branches/1.1/modules/service-builder/src/schema/geronimo-config-1.1.xsd
    geronimo/branches/1.1/modules/service-builder/src/test-resources/services/plan1.xml
    geronimo/branches/1.1/modules/service-builder/src/test/org/apache/geronimo/deployment/service/ServiceConfigBuilderTest.java
    geronimo/branches/1.1/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java

Modified: geronimo/branches/1.1/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java?rev=384667&r1=384666&r2=384667&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java (original)
+++ geronimo/branches/1.1/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java Thu Mar  9 17:25:07 2006
@@ -295,7 +295,7 @@
     }
 
     public void addGBeans(EARContext earContext, Module module, ClassLoader earClassLoader, Repository repository) throws DeploymentException {
-        J2eeContext earJ2eeContext = earContext.getJ2eeContext();
+        J2eeContext earJ2eeContext = earContext.getModuleName();
 
         AppClientModule appClientModule = (AppClientModule) module;
 
@@ -338,7 +338,7 @@
         try {
             appClientModuleGBeanData.setReferencePatterns("J2EEServer", Collections.singleton(earContext.getServerObjectName()));
             if (!earContext.getJ2EEApplicationName().equals("null")) {
-                appClientModuleGBeanData.setReferencePatterns("J2EEApplication", Collections.singleton(earContext.getApplicationObjectName()));
+                appClientModuleGBeanData.setReferencePatterns("J2EEApplication", Collections.singleton(earContext.getApplicationName()));
             }
             appClientModuleGBeanData.setAttribute("deploymentDescriptor", appClientModule.getOriginalSpecDD());
 
@@ -374,7 +374,7 @@
                 // pop in all the gbeans declared in the geronimo app client file
                 if (geronimoAppClient != null) {
                     GbeanType[] gbeans = geronimoAppClient.getGbeanArray();
-                    ServiceConfigBuilder.addGBeans(gbeans, appClientClassLoader, appClientDeploymentContext.getJ2eeContext(), appClientDeploymentContext);
+                    ServiceConfigBuilder.addGBeans(gbeans, appClientClassLoader, appClientDeploymentContext.getModuleName(), appClientDeploymentContext);
                     //deploy the resource adapters specified in the geronimo-application.xml
                     Collection resourceModules = new ArrayList();
                     try {

Modified: geronimo/branches/1.1/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java?rev=384667&r1=384666&r2=384667&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java (original)
+++ geronimo/branches/1.1/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java Thu Mar  9 17:25:07 2006
@@ -263,7 +263,7 @@
     }
 
     public void initContext(EARContext earContext, Module module, ClassLoader cl) throws DeploymentException {
-        J2eeContext earJ2eeContext = earContext.getJ2eeContext();
+        J2eeContext earJ2eeContext = earContext.getModuleName();
         J2eeContext moduleJ2eeContext = J2eeContextImpl.newModuleContextFromApplication(earJ2eeContext, NameFactory.RESOURCE_ADAPTER_MODULE, module.getName());
         J2eeContext resourceJ2eeContext = J2eeContextImpl.newModuleContextFromApplication(earJ2eeContext, NameFactory.JCA_RESOURCE, module.getName());
         final ConnectorType connector = (ConnectorType) module.getSpecDD();
@@ -280,7 +280,7 @@
         // initalize the GBean
         resourceAdapterModuleData.setReferencePattern(NameFactory.J2EE_SERVER, earContext.getServerObjectName());
         if (!earContext.getJ2EEApplicationName().equals(NameFactory.NULL)) {
-            resourceAdapterModuleData.setReferencePattern(NameFactory.J2EE_APPLICATION, earContext.getApplicationObjectName());
+            resourceAdapterModuleData.setReferencePattern(NameFactory.J2EE_APPLICATION, earContext.getApplicationName());
         }
 
         resourceAdapterModuleData.setAttribute("deploymentDescriptor", module.getOriginalSpecDD());
@@ -370,7 +370,7 @@
     }
 
     public void addGBeans(EARContext earContext, Module module, ClassLoader cl, Repository repository) throws DeploymentException {
-        J2eeContext earJ2eeContext = earContext.getJ2eeContext();
+        J2eeContext earJ2eeContext = earContext.getModuleName();
         J2eeContext moduleJ2eeContext = J2eeContextImpl.newModuleContextFromApplication(earJ2eeContext, NameFactory.RESOURCE_ADAPTER_MODULE, module.getName());
         J2eeContext resourceJ2eeContext = J2eeContextImpl.newModuleContextFromApplication(earJ2eeContext, NameFactory.JCA_RESOURCE, module.getName());
 

Modified: geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java?rev=384667&r1=384666&r2=384667&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java (original)
+++ geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java Thu Mar  9 17:25:07 2006
@@ -29,6 +29,7 @@
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.j2ee.ApplicationInfo;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.j2ee.management.impl.J2EEApplicationImpl;
@@ -43,6 +44,7 @@
 import org.apache.geronimo.schema.SchemaConversionUtils;
 import org.apache.geronimo.security.deployment.SecurityBuilder;
 import org.apache.geronimo.security.deployment.SecurityConfiguration;
+import org.apache.geronimo.security.jacc.ApplicationPolicyConfigurationManager;
 import org.apache.geronimo.xbeans.geronimo.j2ee.GerApplicationDocument;
 import org.apache.geronimo.xbeans.geronimo.j2ee.GerApplicationType;
 import org.apache.geronimo.xbeans.geronimo.j2ee.GerExtModuleType;
@@ -90,15 +92,15 @@
     private final ServiceReferenceBuilder serviceReferenceBuilder;
 
     private final Environment defaultEnvironment;
-    private final ObjectName transactionContextManagerObjectName;
-    private final ObjectName connectionTrackerObjectName;
-    private final ObjectName transactionalTimerObjectName;
-    private final ObjectName nonTransactionalTimerObjectName;
-    private final ObjectName corbaGBeanObjectName;
+    private final AbstractName transactionContextManagerObjectName;
+    private final AbstractName connectionTrackerObjectName;
+    private final AbstractName transactionalTimerObjectName;
+    private final AbstractName nonTransactionalTimerObjectName;
+    private final AbstractName corbaGBeanObjectName;
     private static final String DEFAULT_GROUPID = "defaultGroupId";
 
 
-    public EARConfigBuilder(Environment defaultEnvironment, ObjectName transactionContextManagerObjectName, ObjectName connectionTrackerObjectName, ObjectName transactionalTimerObjectName, ObjectName nonTransactionalTimerObjectName, ObjectName corbaGBeanObjectName, Repository repository, ModuleBuilder ejbConfigBuilder, EJBReferenceBuilder ejbReferenceBuilder, ModuleBuilder webConfigBuilder, ModuleBuilder connectorConfigBuilder, ResourceReferenceBuilder resourceReferenceBuilder, ModuleBuilder appClientConfigBuilder, ServiceReferenceBuilder serviceReferenceBuilder, Kernel kernel) {
+    public EARConfigBuilder(Environment defaultEnvironment, AbstractName transactionContextManagerAbstractName, AbstractName connectionTrackerAbstractName, AbstractName transactionalTimerAbstractName, AbstractName nonTransactionalTimerAbstractName, AbstractName corbaGBeanAbstractName, Repository repository, ModuleBuilder ejbConfigBuilder, EJBReferenceBuilder ejbReferenceBuilder, ModuleBuilder webConfigBuilder, ModuleBuilder connectorConfigBuilder, ResourceReferenceBuilder resourceReferenceBuilder, ModuleBuilder appClientConfigBuilder, ServiceReferenceBuilder serviceReferenceBuilder, Kernel kernel) {
         this.kernel = kernel;
         this.repository = repository;
         this.defaultEnvironment = defaultEnvironment;
@@ -110,11 +112,11 @@
         this.connectorConfigBuilder = connectorConfigBuilder;
         this.appClientConfigBuilder = appClientConfigBuilder;
         this.serviceReferenceBuilder = serviceReferenceBuilder;
-        this.transactionContextManagerObjectName = transactionContextManagerObjectName;
-        this.connectionTrackerObjectName = connectionTrackerObjectName;
-        this.transactionalTimerObjectName = transactionalTimerObjectName;
-        this.nonTransactionalTimerObjectName = nonTransactionalTimerObjectName;
-        this.corbaGBeanObjectName = corbaGBeanObjectName;
+        this.transactionContextManagerObjectName = transactionContextManagerAbstractName;
+        this.connectionTrackerObjectName = connectionTrackerAbstractName;
+        this.transactionalTimerObjectName = transactionalTimerAbstractName;
+        this.nonTransactionalTimerObjectName = nonTransactionalTimerAbstractName;
+        this.corbaGBeanObjectName = corbaGBeanAbstractName;
     }
 
     public Object getDeploymentPlan(File planFile, JarFile jarFile) throws DeploymentException {
@@ -345,12 +347,12 @@
             // add gbeans declared in the geronimo-application.xml
             if (geronimoApplication != null) {
                 GbeanType[] gbeans = geronimoApplication.getGbeanArray();
-                ServiceConfigBuilder.addGBeans(gbeans, cl, earContext.getJ2eeContext(), earContext);
+                ServiceConfigBuilder.addGBeans(gbeans, cl, earContext.getModuleName(), earContext);
             }
 
             // Create the J2EEApplication managed object
             if (ConfigurationModuleType.EAR == applicationType) {
-                GBeanData gbeanData = new GBeanData(earContext.getApplicationObjectName(), J2EEApplicationImpl.GBEAN_INFO);
+                GBeanData gbeanData = new GBeanData(earContext.getApplicationName(), J2EEApplicationImpl.GBEAN_INFO);
                 try {
                     String originalSpecDD = applicationInfo.getOriginalSpecDD();
                     if (originalSpecDD == null) {
@@ -364,22 +366,6 @@
                 earContext.addGBean(gbeanData);
             }
 
-            //TODO this might need to be constructed only if there is security...
-            ObjectName jaccBeanName = null;
-            String moduleName;
-            if (ConfigurationModuleType.EAR == applicationType) {
-                moduleName = NameFactory.NULL;
-            } else {
-                Module module = (Module) modules.iterator().next();
-                moduleName = module.getName();
-            }
-            try {
-                jaccBeanName = NameFactory.getComponentName(null, null, null, moduleName, NameFactory.JACC_MANAGER, NameFactory.JACC_MANAGER, earContext.getJ2eeContext());
-            } catch (MalformedObjectNameException e) {
-                throw new DeploymentException("Could not construct name for JACCBean", e);
-            }
-            earContext.setJaccManagerName(jaccBeanName);
-
             //look for application plan security config
             if (geronimoApplication != null && geronimoApplication.isSetSecurity()) {
                 SecurityConfiguration securityConfiguration = SecurityBuilder.buildSecurityConfiguration(geronimoApplication.getSecurity(), cl);
@@ -393,9 +379,16 @@
             }
 
             //add the JACC gbean if there is a principal-role mapping
+            //TODO configid verify that the jaccManagerName is not needed before this.  cf. how this is handled in 1.2 branch.
             if (earContext.getSecurityConfiguration() != null) {
-                GBeanData jaccBeanData = SecurityBuilder.configureApplicationPolicyManager(jaccBeanName, earContext.getContextIDToPermissionsMap(), earContext.getSecurityConfiguration());
+                GBeanData jaccBeanData = null;
+                try {
+                    jaccBeanData = SecurityBuilder.configureApplicationPolicyManager(earContext.getModuleName(), earContext.getContextIDToPermissionsMap(), earContext.getSecurityConfiguration());
+                } catch (MalformedObjectNameException e) {
+                    throw new DeploymentException("Could not construct name for JACCBean", e);
+                }
                 earContext.addGBean(jaccBeanData);
+                earContext.setJaccManagerName(jaccBeanData.getAbstractName());
             }
             earContext.close();
             return earContext.getConfigurationData();
@@ -678,11 +671,11 @@
     static {
         GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(EARConfigBuilder.class, NameFactory.CONFIG_BUILDER);
         infoFactory.addAttribute("defaultEnvironment", Environment.class, true, true);
-        infoFactory.addAttribute("transactionContextManagerObjectName", ObjectName.class, true);
-        infoFactory.addAttribute("connectionTrackerObjectName", ObjectName.class, true);
-        infoFactory.addAttribute("transactionalTimerObjectName", ObjectName.class, true);
-        infoFactory.addAttribute("nonTransactionalTimerObjectName", ObjectName.class, true);
-        infoFactory.addAttribute("corbaGBeanObjectName", ObjectName.class, true);
+        infoFactory.addAttribute("transactionContextManagerObjectName", AbstractName.class, true);
+        infoFactory.addAttribute("connectionTrackerObjectName", AbstractName.class, true);
+        infoFactory.addAttribute("transactionalTimerObjectName", AbstractName.class, true);
+        infoFactory.addAttribute("nonTransactionalTimerObjectName", AbstractName.class, true);
+        infoFactory.addAttribute("corbaGBeanObjectName", AbstractName.class, true);
 
         infoFactory.addReference("Repository", Repository.class, NameFactory.GERONIMO_SERVICE);
         infoFactory.addReference("EJBConfigBuilder", ModuleBuilder.class, NameFactory.MODULE_BUILDER);

Modified: geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARContext.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARContext.java?rev=384667&r1=384666&r2=384667&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARContext.java (original)
+++ geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARContext.java Thu Mar  9 17:25:07 2006
@@ -19,11 +19,11 @@
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.DeploymentContext;
 import org.apache.geronimo.kernel.repository.Environment;
-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.config.ConfigurationModuleType;
 import org.apache.geronimo.security.deployment.SecurityConfiguration;
+import org.apache.geronimo.gbean.AbstractName;
 
 import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
@@ -35,36 +35,37 @@
  * @version $Rev$ $Date$
  */
 public class EARContext extends DeploymentContext implements NamingContext {
-    private final ObjectName domainObjectName;
-    private final ObjectName serverObjectName;
-    private final ObjectName applicationObjectName;
+    private final AbstractName domainObjectName;
+    private final AbstractName serverObjectName;
+    private final AbstractName applicationName;
 
-    private final ObjectName transactionContextManagerObjectName;
-    private final ObjectName connectionTrackerObjectName;
+    private final AbstractName transactionContextManagerObjectName;
+    private final AbstractName connectionTrackerObjectName;
 
-    private final ObjectName transactedTimerName;
-    private final ObjectName nonTransactedTimerName;
+    private final AbstractName transactedTimerName;
+    private final AbstractName nonTransactedTimerName;
 
-    private final ObjectName corbaGBeanObjectName;
+    private final AbstractName corbaGBeanObjectName;
 
     private final RefContext refContext;
-    private final J2eeContext j2eeContext;
+    private final AbstractName moduleName;
 
     private final Map contextIDToPermissionsMap = new HashMap();
-    private ObjectName jaccManagerName;
+    private AbstractName jaccManagerName;
     private SecurityConfiguration securityConfiguration;
 
-    public EARContext(File baseDir, Environment environment, ConfigurationModuleType moduleType, Kernel kernel, String j2eeApplicationName, ObjectName transactionContextManagerObjectName, ObjectName connectionTrackerObjectName, ObjectName transactedTimerName, ObjectName nonTransactedTimerName, ObjectName corbaGBeanObjectName, RefContext refContext) throws MalformedObjectNameException, DeploymentException {
+    public EARContext(File baseDir, Environment environment, ConfigurationModuleType moduleType, Kernel kernel, String j2eeApplicationName, AbstractName transactionContextManagerObjectName, AbstractName connectionTrackerObjectName, AbstractName transactedTimerName, AbstractName nonTransactedTimerName, AbstractName corbaGBeanObjectName, RefContext refContext) throws MalformedObjectNameException, DeploymentException {
         super(baseDir, environment, moduleType, kernel);
-        j2eeContext = NameFactory.buildJ2eeContext(environment.getProperties(), j2eeApplicationName == null ? NameFactory.NULL : j2eeApplicationName, NameFactory.J2EE_MODULE, NameFactory.NULL, null, null);
-        domainObjectName = NameFactory.getDomainName(null, j2eeContext);
-        serverObjectName = NameFactory.getServerName(null, null, j2eeContext);
-
-        if (j2eeApplicationName != null) {
-            applicationObjectName = NameFactory.getApplicationName(null, null, null, j2eeContext);
+        if (moduleType.equals(ConfigurationModuleType.EAR)) {
+            moduleName = NameFactory.buildApplicationName(environment.getProperties(), environment.getConfigId());
+            applicationName = moduleName;
         } else {
-            applicationObjectName = null;
+            moduleName = NameFactory.buildModuleName(environment.getProperties(), environment.getConfigId(), moduleType, j2eeApplicationName);
+            applicationName = null;
         }
+        //TODO configId FIXME
+        domainObjectName = null;//NameFactory.getDomainName(null, moduleName);
+        serverObjectName = null;//NameFactory.getServerName(null, null, moduleName);
 
         this.transactionContextManagerObjectName = transactionContextManagerObjectName;
         this.connectionTrackerObjectName = connectionTrackerObjectName;
@@ -75,46 +76,46 @@
     }
 
     public String getJ2EEDomainName() {
-        return j2eeContext.getJ2eeDomainName();
+        return moduleName.getObjectName().getKeyProperty(NameFactory.J2EE_DOMAIN);
     }
 
     public String getJ2EEServerName() {
-        return j2eeContext.getJ2eeServerName();
+        return moduleName.getObjectName().getKeyProperty(NameFactory.J2EE_SERVER);
     }
 
     public String getJ2EEApplicationName() {
-        return j2eeContext.getJ2eeApplicationName();
+        return moduleName.getObjectName().getKeyProperty(NameFactory.J2EE_APPLICATION);
     }
 
-    public ObjectName getDomainObjectName() {
+    public AbstractName getDomainObjectName() {
         return domainObjectName;
     }
 
-    public ObjectName getServerObjectName() {
+    public AbstractName getServerObjectName() {
         return serverObjectName;
     }
 
-    public ObjectName getApplicationObjectName() {
-        return applicationObjectName;
+    public AbstractName getApplicationName() {
+        return applicationName;
     }
 
-    public ObjectName getTransactionContextManagerObjectName() {
+    public AbstractName getTransactionContextManagerObjectName() {
         return transactionContextManagerObjectName;
     }
 
-    public ObjectName getConnectionTrackerObjectName() {
+    public AbstractName getConnectionTrackerObjectName() {
         return connectionTrackerObjectName;
     }
 
-    public ObjectName getTransactedTimerName() {
+    public AbstractName getTransactedTimerName() {
         return transactedTimerName;
     }
 
-    public ObjectName getNonTransactedTimerName() {
+    public AbstractName getNonTransactedTimerName() {
         return nonTransactedTimerName;
     }
 
-    public ObjectName getCORBAGBeanObjectName() {
+    public AbstractName getCORBAGBeanObjectName() {
         return corbaGBeanObjectName;
     }
 
@@ -122,8 +123,8 @@
         return refContext;
     }
 
-    public J2eeContext getJ2eeContext() {
-        return j2eeContext;
+    public AbstractName getModuleName() {
+        return moduleName;
     }
 
     public Map getContextIDToPermissionsMap() {
@@ -137,11 +138,11 @@
         }
     }
 
-    public void setJaccManagerName(ObjectName jaccManagerName) {
+    public void setJaccManagerName(AbstractName jaccManagerName) {
         this.jaccManagerName = jaccManagerName;
     }
 
-    public ObjectName getJaccManagerName() {
+    public AbstractName getJaccManagerName() {
         return jaccManagerName;
     }
 

Modified: geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/NamingContext.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/NamingContext.java?rev=384667&r1=384666&r2=384667&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/NamingContext.java (original)
+++ geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/NamingContext.java Thu Mar  9 17:25:07 2006
@@ -17,6 +17,7 @@
 package org.apache.geronimo.j2ee.deployment;
 
 import org.apache.geronimo.gbean.GBeanData;
+import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContext;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.repository.Artifact;
@@ -29,7 +30,7 @@
  */
 public interface NamingContext {
 
-    J2eeContext getJ2eeContext();
+    AbstractName getModuleName();
 
     void addGBean(GBeanData gbean);
 

Modified: geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/RefContext.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/RefContext.java?rev=384667&r1=384666&r2=384667&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/RefContext.java (original)
+++ geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/RefContext.java Thu Mar  9 17:25:07 2006
@@ -35,7 +35,6 @@
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.xbeans.j2ee.MessageDestinationType;
 
 
 /**
@@ -124,13 +123,13 @@
     }
 
     public String getResourceAdapterContainerId(URI moduleURI, String resourceLink, NamingContext context) throws UnresolvedReferenceException {
-        J2eeContext j2eeContext = context.getJ2eeContext();
+        J2eeContext j2eeContext = context.getModuleName();
         ObjectName containerName = locateComponentName(resourceLink, moduleURI, NameFactory.JCA_RESOURCE, NameFactory.JCA_RESOURCE_ADAPTER, j2eeContext, context, "resource adapter");
         return containerName.getCanonicalName();
     }
 
     public String getConnectionFactoryContainerId(URI moduleURI, String resourceLink, String type, NamingContext context) throws UnresolvedReferenceException {
-        J2eeContext j2eeContext = context.getJ2eeContext();
+        J2eeContext j2eeContext = context.getModuleName();
         ObjectName containerName = locateComponentName(resourceLink, moduleURI, NameFactory.JCA_RESOURCE, type, j2eeContext, context, "connection factory");
         return containerName.getCanonicalName();
     }
@@ -168,7 +167,7 @@
     }
 
     public String getAdminObjectContainerId(URI moduleURI, String resourceLink, NamingContext context) throws DeploymentException {
-        J2eeContext j2eeContext = context.getJ2eeContext();
+        J2eeContext j2eeContext = context.getModuleName();
         ObjectName containerName = locateComponentName(resourceLink, moduleURI, NameFactory.JCA_RESOURCE, NameFactory.JCA_ADMIN_OBJECT, j2eeContext, context, "admin object");
         return containerName.getCanonicalName();
     }
@@ -244,7 +243,7 @@
 
     private GBeanData locateEjbInApplication(NamingContext namingContext, boolean isSession, String ejbLink, URI module) throws UnresolvedReferenceException {
         GBeanData gbeanData;
-        J2eeContext j2eeContext = namingContext.getJ2eeContext();
+        J2eeContext j2eeContext = namingContext.getModuleName();
         if (isSession) {
             gbeanData = locateComponentInApplication(ejbLink, module, NameFactory.EJB_MODULE, NameFactory.STATELESS_SESSION_BEAN, j2eeContext, "remote ejb", namingContext, false);
             if (gbeanData == null) {

Modified: geronimo/branches/1.1/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockNamingContext.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockNamingContext.java?rev=384667&r1=384666&r2=384667&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockNamingContext.java (original)
+++ geronimo/branches/1.1/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockNamingContext.java Thu Mar  9 17:25:07 2006
@@ -22,6 +22,7 @@
 
 import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContext;
 import org.apache.geronimo.gbean.GBeanData;
+import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.deployment.GBeanDataRegistry;
@@ -38,7 +39,7 @@
         this.j2eeContext = j2eeContext;
     }
 
-    public J2eeContext getJ2eeContext() {
+    public AbstractName getModuleName() {
         return j2eeContext;
     }
 

Modified: geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/j2eeobjectnames/NameFactory.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/j2eeobjectnames/NameFactory.java?rev=384667&r1=384666&r2=384667&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/j2eeobjectnames/NameFactory.java (original)
+++ geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/j2eeobjectnames/NameFactory.java Thu Mar  9 17:25:07 2006
@@ -16,8 +16,16 @@
  */
 package org.apache.geronimo.j2ee.j2eeobjectnames;
 
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.kernel.config.ConfigurationModuleType;
+
 import java.util.Properties;
 import java.util.Map;
+import java.util.Hashtable;
+import java.util.HashMap;
+import java.util.Set;
+import java.util.Collections;
 import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
 
@@ -112,30 +120,59 @@
     public static final String CORBA_TSS = "CORBATSS";
     public static final String WEB_SERVICE_LINK = "WSLink";
 
-    public static J2eeContext buildJ2eeContext(Map properties, String applicationName, String moduleType, String moduleName, String j2eeName, String j2eeType) throws MalformedObjectNameException {
+    private static String[] moduleTypeNames = new String[] {
+            J2EE_APPLICATION, //null?? this should never happen
+            EJB_MODULE,
+            APP_CLIENT_MODULE,
+            RESOURCE_ADAPTER_MODULE,
+            WEB_MODULE,
+            J2EE_MODULE,  //this is a bad name here
+            J2EE_MODULE   //should be SpringModule?
+    };
+
+    public static AbstractName buildApplicationName(Map properties, Artifact artifact) throws MalformedObjectNameException {
         String baseNameString = (String) properties.get(JSR77_BASE_NAME_PROPERTY);
         ObjectName baseName = ObjectName.getInstance(baseNameString);
         String domain = baseName.getDomain();
-        String serverName = baseName.getKeyProperty(J2EE_SERVER);
+        Hashtable keys = baseName.getKeyPropertyList();
+        String serverName = (String) keys.get(J2EE_SERVER);
         if (serverName == null) {
             throw new MalformedObjectNameException("No J2EEServer key in " + baseNameString);
         }
-        return new J2eeContextImpl(domain, serverName, applicationName, moduleType, moduleName, j2eeName, j2eeType);
+        Map nameMap = new HashMap();
+        keys.put(J2EE_TYPE, J2EE_APPLICATION);
+        keys.put(J2EE_NAME, artifact.toString());
+        ObjectName moduleObjectName = ObjectName.getInstance(domain, keys);
+        return new AbstractName(artifact, nameMap, Collections.EMPTY_SET, moduleObjectName);
     }
 
-    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));
-        return ObjectName.getInstance(context.getJ2eeDomainName(j2eeDomainName), props);
+    public static AbstractName buildModuleName(Map properties, Artifact artifact, ConfigurationModuleType moduleType, String moduleName) throws MalformedObjectNameException {
+        String moduleTypeString = moduleTypeNames[moduleType.getValue()];
+        String baseNameString = (String) properties.get(JSR77_BASE_NAME_PROPERTY);
+        ObjectName baseName = ObjectName.getInstance(baseNameString);
+        String domain = baseName.getDomain();
+        Hashtable keys = baseName.getKeyPropertyList();
+        String serverName = (String) keys.get(J2EE_SERVER);
+        if (serverName == null) {
+            throw new MalformedObjectNameException("No J2EEServer key in " + baseNameString);
+        }
+        Map nameMap = new HashMap();
+        if (moduleName == null) {
+            //this is a standalone module
+            keys.put(J2EE_APPLICATION, NULL);
+            keys.put(J2EE_TYPE, moduleTypeString);
+            keys.put(J2EE_NAME, artifact.toString());
+        } else {
+            //this is part of an application
+            keys.put(J2EE_APPLICATION, artifact.toString());
+            keys.put(J2EE_TYPE, moduleTypeString);
+            keys.put(J2EE_NAME, moduleName);
+            nameMap.put("module", moduleName);
+        }
+        ObjectName moduleObjectName = ObjectName.getInstance(domain, keys);
+        return new AbstractName(artifact, nameMap, Collections.EMPTY_SET, moduleObjectName);
     }
 
-    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));
-        return ObjectName.getInstance(context.getJ2eeDomainName(j2eeDomainName), props);
-    }
 
     public static ObjectName getApplicationName(String j2eeDomainName, String j2eeServerName, String j2eeApplicationName, J2eeContext context) throws MalformedObjectNameException {
         Properties props = new Properties();
@@ -222,7 +259,7 @@
         try {
             return ObjectName.getInstance(buffer.toString());
         } catch (MalformedObjectNameException e) {
-            throw (MalformedObjectNameException)new MalformedObjectNameException("Could not construct object name: " + buffer.toString()).initCause(e);
+            throw (MalformedObjectNameException) new MalformedObjectNameException("Could not construct object name: " + buffer.toString()).initCause(e);
         }
     }
 
@@ -284,8 +321,27 @@
         return ObjectName.getInstance(context.getJ2eeDomainName(j2eeDomainName), props);
     }
 
-    //TODO parameterize this
-    public static ObjectName getSecurityRealmName(String realmName) throws MalformedObjectNameException {
-        return ObjectName.getInstance("geronimo.security:type=SecurityRealm,name=" + realmName);
+    public static ObjectName getChildName(ObjectName parentObjectName, String type, String name) throws MalformedObjectNameException {
+        String domain = parentObjectName.getDomain();
+        Hashtable parentKeys = parentObjectName.getKeyPropertyList();
+        String parentType = (String) parentKeys.remove(J2EE_TYPE);
+        String parentName = (String) parentKeys.remove(J2EE_NAME);
+        parentKeys.put(parentType, parentName);
+        parentKeys.put(J2EE_TYPE, type);
+        parentKeys.put(J2EE_NAME, name);
+        return ObjectName.getInstance(domain, parentKeys);
+    }
+
+    public static AbstractName getChildName(AbstractName parentAbstractName, String type, String name, Set interfaceTypes) throws MalformedObjectNameException {
+        Artifact artifact = parentAbstractName.getArtifact();
+        Map nameMap = new HashMap(parentAbstractName.getName());
+        ObjectName parentObjectName = parentAbstractName.getObjectName();
+        ObjectName childObjectName = getChildName(parentObjectName, type, name);
+        String parentType = (String) nameMap.remove("type");
+        String parentName = (String) nameMap.remove("name");
+        nameMap.put(parentType, parentName);
+        nameMap.put("type", type);
+        nameMap.put("name", name);
+        return new AbstractName(artifact, nameMap, interfaceTypes, childObjectName);
     }
 }

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=384667&r1=384666&r2=384667&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 Thu Mar  9 17:25:07 2006
@@ -45,9 +45,6 @@
 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.config.ConfigurationStore;
-import org.apache.geronimo.kernel.config.ConfigurationAlreadyExistsException;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.kernel.repository.Repository;
@@ -58,7 +55,6 @@
 import org.apache.geronimo.security.deployment.SecurityBuilder;
 import org.apache.geronimo.security.deployment.SecurityConfiguration;
 import org.apache.geronimo.security.jacc.ComponentPermissions;
-import org.apache.geronimo.security.util.URLPattern;
 import org.apache.geronimo.transaction.context.OnlineUserTransaction;
 import org.apache.geronimo.web.deployment.AbstractWebModuleBuilder;
 import org.apache.geronimo.web.deployment.GenericToSpecificPlanConverter;
@@ -71,7 +67,6 @@
 import org.apache.geronimo.xbeans.j2ee.FilterMappingType;
 import org.apache.geronimo.xbeans.j2ee.FilterType;
 import org.apache.geronimo.xbeans.j2ee.FormLoginConfigType;
-import org.apache.geronimo.xbeans.j2ee.HttpMethodType;
 import org.apache.geronimo.xbeans.j2ee.JspConfigType;
 import org.apache.geronimo.xbeans.j2ee.ListenerType;
 import org.apache.geronimo.xbeans.j2ee.LocaleEncodingMappingListType;
@@ -80,17 +75,11 @@
 import org.apache.geronimo.xbeans.j2ee.MessageDestinationType;
 import org.apache.geronimo.xbeans.j2ee.MimeMappingType;
 import org.apache.geronimo.xbeans.j2ee.ParamValueType;
-import org.apache.geronimo.xbeans.j2ee.RoleNameType;
-import org.apache.geronimo.xbeans.j2ee.SecurityConstraintType;
-import org.apache.geronimo.xbeans.j2ee.SecurityRoleRefType;
-import org.apache.geronimo.xbeans.j2ee.SecurityRoleType;
 import org.apache.geronimo.xbeans.j2ee.ServletMappingType;
 import org.apache.geronimo.xbeans.j2ee.ServletType;
 import org.apache.geronimo.xbeans.j2ee.TaglibType;
-import org.apache.geronimo.xbeans.j2ee.UrlPatternType;
 import org.apache.geronimo.xbeans.j2ee.WebAppDocument;
 import org.apache.geronimo.xbeans.j2ee.WebAppType;
-import org.apache.geronimo.xbeans.j2ee.WebResourceCollectionType;
 import org.apache.geronimo.xbeans.j2ee.WelcomeFileListType;
 import org.apache.xmlbeans.XmlException;
 import org.apache.xmlbeans.XmlObject;
@@ -101,9 +90,6 @@
 
 import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
-import javax.security.jacc.WebResourcePermission;
-import javax.security.jacc.WebRoleRefPermission;
-import javax.security.jacc.WebUserDataPermission;
 import javax.servlet.Servlet;
 import javax.transaction.UserTransaction;
 import java.io.File;
@@ -111,7 +97,6 @@
 import java.io.IOException;
 import java.net.MalformedURLException;
 import java.net.URI;
-import java.net.URISyntaxException;
 import java.net.URL;
 import java.security.Permission;
 import java.security.PermissionCollection;
@@ -129,7 +114,6 @@
 import java.util.Set;
 import java.util.TreeSet;
 import java.util.jar.JarFile;
-import java.util.zip.ZipEntry;
 
 
 /**
@@ -334,7 +318,7 @@
             knownParent = earContext.getConfiguration(repository, null);
         }
         ClassLoader moduleClassLoader = moduleContext.getClassLoader(repository, knownParent);
-        J2eeContext earJ2eeContext = moduleContext.getJ2eeContext();
+        J2eeContext earJ2eeContext = moduleContext.getModuleName();
         J2eeContext moduleJ2eeContext = J2eeContextImpl.newModuleContextFromApplication(earJ2eeContext, NameFactory.WEB_MODULE, module.getName());
         WebModule webModule = (WebModule) module;
 
@@ -360,7 +344,7 @@
         try {
             webModuleData.setReferencePattern("J2EEServer", moduleContext.getServerObjectName());
             if (!moduleContext.getJ2EEApplicationName().equals("null")) {
-                webModuleData.setReferencePattern("J2EEApplication", moduleContext.getApplicationObjectName());
+                webModuleData.setReferencePattern("J2EEApplication", moduleContext.getApplicationName());
             }
 
             webModuleData.setAttribute("deploymentDescriptor", module.getOriginalSpecDD());

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=384667&r1=384666&r2=384667&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 Thu Mar  9 17:25:07 2006
@@ -25,6 +25,7 @@
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
+import java.util.Arrays;
 
 /**
  * @version $Rev:$ $Date:$
@@ -58,7 +59,7 @@
     }
 
     public Map getName() {
-        return name;
+        return Collections.unmodifiableMap(name);
     }
 
     public Set getInterfaceTypes() {

Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/GBeanData.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/GBeanData.java?rev=384667&r1=384666&r2=384667&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/GBeanData.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/GBeanData.java Thu Mar  9 17:25:07 2006
@@ -133,11 +133,22 @@
 
     public void setDependencies(Set dependencies) {
         this.dependencies.clear();
-        this.dependencies.addAll(dependencies);
+        addDependencies(dependencies);
     }
 
     public void addDependencies(Set dependencies) {
-        this.dependencies.addAll(dependencies);
+        for (Iterator iterator = dependencies.iterator(); iterator.hasNext();) {
+            Object o =  iterator.next();
+            if (o instanceof ReferencePatterns) {
+                this.dependencies.add(o);
+            } else if (o instanceof AbstractName) {
+                this.dependencies.add(new ReferencePatterns((AbstractName) o));
+            } else if (o instanceof AbstractNameQuery) {
+                this.dependencies.add(new ReferencePatterns((AbstractNameQuery) o));
+            } else {
+                throw new IllegalArgumentException("Dependency specification is not a ReferencePatterns, AbstractName, nor AbstractNameQuery: " + o);
+            }
+        }
     }
 
     public void addDependency(ReferencePatterns dependency) {
@@ -145,7 +156,7 @@
     }
 
     public void addDependency(AbstractNameQuery refInfo) {
-        this.dependencies.add(new ReferencePatterns(Collections.singleton(refInfo)));
+        this.dependencies.add(new ReferencePatterns(refInfo));
     }
 
     public void addDependency(AbstractName dependency) {

Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/ReferencePatterns.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/ReferencePatterns.java?rev=384667&r1=384666&r2=384667&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/ReferencePatterns.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/ReferencePatterns.java Thu Mar  9 17:25:07 2006
@@ -18,6 +18,8 @@
 package org.apache.geronimo.gbean;
 
 import java.util.Set;
+import java.util.Collections;
+import java.util.Iterator;
 import java.io.Serializable;
 
 /**
@@ -30,6 +32,17 @@
 
     public ReferencePatterns(Set patterns) {
         this.patterns = patterns;
+        this.abstractName = null;
+        for (Iterator iterator = patterns.iterator(); iterator.hasNext();) {
+            Object o = iterator.next();
+            if (!(o instanceof AbstractNameQuery)) {
+                throw new IllegalArgumentException("Item is not an AbstractNameQuery: " + o);
+            }
+        }
+    }
+
+    public ReferencePatterns(AbstractNameQuery abstractNameQuery) {
+        this.patterns = Collections.singleton(abstractNameQuery);
         this.abstractName = null;
     }
 

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=384667&r1=384666&r2=384667&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 Thu Mar  9 17:25:07 2006
@@ -255,7 +255,7 @@
                         getStringValue(gerResourceRef.getModule()),
                         getStringValue(gerResourceRef.getName()),
                         gerResourceRef.getType() == null ? type : gerResourceRef.getType().trim(),
-                        context.getJ2eeContext()).getCanonicalName();
+                        context.getModuleName()).getCanonicalName();
             } catch (MalformedObjectNameException e) {
                 throw new DeploymentException("could not construct object name for resource", e);
             }
@@ -322,7 +322,7 @@
                         getStringValue(gerResourceEnvRef.getName()),
                         NameFactory.JMS_RESOURCE,
                         //gerResourceEnvRef.getType(),
-                        context.getJ2eeContext()).getCanonicalName();
+                        context.getModuleName()).getCanonicalName();
             } catch (MalformedObjectNameException e) {
                 throw new DeploymentException("could not construct object name for jms resource", e);
             }
@@ -375,7 +375,7 @@
     }
 
     static void addEJBRefs(NamingContext earContext, NamingContext ejbContext, RefContext refContext, URI moduleURI, EjbRefType[] ejbRefs, Map ejbRefMap, ClassLoader cl, ComponentContextBuilder builder) throws DeploymentException {
-        J2eeContext j2eeContext = ejbContext.getJ2eeContext();
+        J2eeContext j2eeContext = ejbContext.getModuleName();
         for (int i = 0; i < ejbRefs.length; i++) {
             EjbRefType ejbRef = ejbRefs[i];
 
@@ -414,7 +414,7 @@
                             String cssLink = remoteRef.getCssLink().trim();
                             //TODO is this correct?
                             String moduleType = null;
-                            cssBean = refContext.locateComponentName(cssLink, moduleURI, moduleType, NameFactory.CORBA_CSS, earContext.getJ2eeContext(), earContext, "css gbean");
+                            cssBean = refContext.locateComponentName(cssLink, moduleURI, moduleType, NameFactory.CORBA_CSS, earContext.getModuleName(), earContext, "css gbean");
                         } else {
                             GerCssType css = remoteRef.getCss();
                             cssBean = NameFactory.getComponentName(getStringValue(css.getDomain()),
@@ -423,7 +423,7 @@
                                     getStringValue(css.getModule()),
                                     getStringValue(css.getName()),
                                     getStringValue(NameFactory.CORBA_CSS),
-                                    earContext.getJ2eeContext());
+                                    earContext.getModuleName());
                         }
                         ejbReference = refContext.getCORBARemoteRef(new URI(getStringValue(remoteRef.getNsCorbaloc())),
                                 getStringValue(remoteRef.getName()),
@@ -472,7 +472,7 @@
     }
 
     static void addEJBLocalRefs(NamingContext ejbContext, RefContext refContext, URI moduleURI, EjbLocalRefType[] ejbLocalRefs, Map ejbLocalRefMap, ClassLoader cl, ComponentContextBuilder builder) throws DeploymentException {
-        J2eeContext j2eeContext = ejbContext.getJ2eeContext();
+        J2eeContext j2eeContext = ejbContext.getModuleName();
         for (int i = 0; i < ejbLocalRefs.length; i++) {
             EjbLocalRefType ejbLocalRef = ejbLocalRefs[i];
 

Modified: geronimo/branches/1.1/modules/naming-builder/src/test/org/apache/geronimo/naming/deployment/MessageDestinationTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/naming-builder/src/test/org/apache/geronimo/naming/deployment/MessageDestinationTest.java?rev=384667&r1=384666&r2=384667&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/naming-builder/src/test/org/apache/geronimo/naming/deployment/MessageDestinationTest.java (original)
+++ geronimo/branches/1.1/modules/naming-builder/src/test/org/apache/geronimo/naming/deployment/MessageDestinationTest.java Thu Mar  9 17:25:07 2006
@@ -35,6 +35,7 @@
 import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContextImpl;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.gbean.GBeanData;
+import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.DeploymentContext;
 import org.apache.geronimo.deployment.GBeanDataRegistry;
@@ -187,7 +188,7 @@
             this.j2eeContext = j2eeContext;
         }
 
-        public J2eeContext getJ2eeContext() {
+        public AbstractName getModuleName() {
             return j2eeContext;
         }
 

Modified: geronimo/branches/1.1/modules/security-builder/maven.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/security-builder/maven.xml?rev=384667&r1=384666&r2=384667&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/security-builder/maven.xml (original)
+++ geronimo/branches/1.1/modules/security-builder/maven.xml Thu Mar  9 17:25:07 2006
@@ -31,7 +31,7 @@
 
     <preGoal name="java:compile">
         <xmlbeans:schema2java
-            maven.xmlbeans2.sourceschema="schema/geronimo-security-1.1.xsd,schema/geronimo-login-config-1.0.xsd"/>
+            maven.xmlbeans2.sourceschema="schema/geronimo-security-1.1.xsd,schema/geronimo-login-config-1.1.xsd"/>
         <mkdir dir="${basedir}/target/xmlbeans-classes"/>
         <mkdir dir="${basedir}/target/xmlbeans-classes/schemaorg_apache_xmlbeans"/>
         <copy todir="${basedir}/target/xmlbeans-classes/schemaorg_apache_xmlbeans">

Modified: geronimo/branches/1.1/modules/security-builder/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/security-builder/project.xml?rev=384667&r1=384666&r2=384667&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/security-builder/project.xml (original)
+++ geronimo/branches/1.1/modules/security-builder/project.xml Thu Mar  9 17:25:07 2006
@@ -62,44 +62,56 @@
         </dependency>
 
         <dependency>
-             <groupId>geronimo</groupId>
-             <artifactId>geronimo-security</artifactId>
-             <version>${pom.currentVersion}</version>
-       </dependency>
-
-        <dependency>
-             <groupId>geronimo</groupId>
-             <artifactId>geronimo-deployment</artifactId>
-             <version>${pom.currentVersion}</version>
-       </dependency>
-
-        <dependency>
-             <groupId>geronimo</groupId>
-             <artifactId>geronimo-deploy-config</artifactId>
-             <version>${pom.currentVersion}</version>
-       </dependency>
-
-         <dependency>
-             <groupId>geronimo</groupId>
-             <artifactId>geronimo-service-builder</artifactId>
-             <version>${pom.currentVersion}</version>
-       </dependency>
-
-       <!--needed only because security schema references j2ee 1.4 schema for description element -->
-       <dependency>
-             <groupId>geronimo</groupId>
-             <artifactId>geronimo-j2ee-schema</artifactId>
-             <version>${pom.currentVersion}</version>
-             <properties>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-security</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-deployment</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-deploy-config</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-service-builder</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+
+        <!--needed only because security schema references j2ee 1.4 schema for description element -->
+<!--
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-j2ee-schema</artifactId>
+            <version>${pom.currentVersion}</version>
+            <properties>
+                <xmlbeans>true</xmlbeans>
+            </properties>
+        </dependency>
+-->
+
+        <!--pattern element in login config ref -->
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-service-builder</artifactId>
+            <version>${pom.currentVersion}</version>
+            <properties>
                 <xmlbeans>true</xmlbeans>
-             </properties>
-       </dependency>
+            </properties>
+        </dependency>
 
         <dependency>
-             <groupId>geronimo</groupId>
-             <artifactId>geronimo-common</artifactId>
-             <version>${pom.currentVersion}</version>
-         </dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-common</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
 
         <dependency>
             <groupId>geronimo</groupId>

Modified: geronimo/branches/1.1/modules/security-builder/src/java/org/apache/geronimo/security/deployment/LoginConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/security-builder/src/java/org/apache/geronimo/security/deployment/LoginConfigBuilder.java?rev=384667&r1=384666&r2=384667&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/security-builder/src/java/org/apache/geronimo/security/deployment/LoginConfigBuilder.java (original)
+++ geronimo/branches/1.1/modules/security-builder/src/java/org/apache/geronimo/security/deployment/LoginConfigBuilder.java Thu Mar  9 17:25:07 2006
@@ -16,23 +16,18 @@
  */
 package org.apache.geronimo.security.deployment;
 
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Properties;
-import java.util.Set;
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.DeploymentContext;
+import org.apache.geronimo.deployment.service.GBeanBuilder;
 import org.apache.geronimo.deployment.service.XmlReferenceBuilder;
+import org.apache.geronimo.deployment.xbeans.PatternType;
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
-import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContext;
+import org.apache.geronimo.gbean.GReferenceInfo;
+import org.apache.geronimo.gbean.ReferencePatterns;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.security.jaas.JaasLoginModuleUse;
 import org.apache.geronimo.security.jaas.LoginModuleGBean;
@@ -45,6 +40,15 @@
 import org.apache.xmlbeans.XmlObject;
 import org.apache.xmlbeans.XmlOptions;
 
+import javax.management.MalformedObjectNameException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+
 
 /**
  * @version $Rev$ $Date$
@@ -58,7 +62,7 @@
         return LOGIN_CONFIG_NAMESPACE;
     }
 
-    public Set getReferences(XmlObject xmlObject, DeploymentContext context, J2eeContext j2eeContext, ClassLoader classLoader) throws DeploymentException
+    public ReferencePatterns getReferences(XmlObject xmlObject, DeploymentContext context, AbstractName parentName, ClassLoader classLoader) throws DeploymentException
     {
         GerLoginConfigType loginConfig = (GerLoginConfigType) xmlObject.copy().changeType(GerLoginConfigType.type);
         XmlOptions xmlOptions = new XmlOptions();
@@ -82,51 +86,40 @@
                 GerAbstractLoginModuleType abstractLoginModule = (GerAbstractLoginModuleType) child;
                 String controlFlag = abstractLoginModule.getControlFlag().toString();
                 boolean wrapPrincipals = (abstractLoginModule.isSetWrapPrincipals() && abstractLoginModule.getWrapPrincipals());
-                ObjectName loginModuleName;
+                ReferencePatterns loginModuleReferencePatterns;
                 String name;
                 if (abstractLoginModule instanceof GerLoginModuleRefType)
                 {
                     GerLoginModuleRefType loginModuleRef = (GerLoginModuleRefType) abstractLoginModule;
-                    String domain = trim(loginModuleRef.getDomain());
-                    String server = trim(loginModuleRef.getServer());
-                    String application = trim(loginModuleRef.getApplication());
-                    String module = trim(loginModuleRef.getModule());
-                    String type = trim(loginModuleRef.getType());
-                    if (type == null)
-                    {
-                        type = NameFactory.LOGIN_MODULE;
-                    }
-                    name = trim(loginModuleRef.getName());
-                    try
-                    {
-                        loginModuleName = NameFactory.getComponentName(domain, server, application, module, name, type, j2eeContext);
-                    }
-                    catch (MalformedObjectNameException e)
-                    {
-                        throw new DeploymentException("cannot construct login module name from parts,", e);
-                    }
-                    try
-                    {
-                        String loginDomain = (String) context.getAttribute(loginModuleName, "loginDomainName");
-                        if (!loginModuleNames.add(loginDomain))
-                        {
-                            throw new DeploymentException("Security realm contains two login domains called '" + loginDomain + "'");
-                        }
-                    }
-                    catch (DeploymentException e)
-                    {
-                        throw e;
-                    }
-                    catch (Exception e)
-                    {
-                        throw new DeploymentException("Unable to create reference to login module " + name, e);
-                    }
+                    PatternType patternType = loginModuleRef.getPattern();
+                    AbstractNameQuery loginModuleNameQuery = GBeanBuilder.buildAbstractNameQuery(patternType, USE_REFERENCE_INFO);
+                    loginModuleReferencePatterns = new ReferencePatterns(loginModuleNameQuery);
+                    name = (String) loginModuleNameQuery.getName().get("name");
+                    if (name == null) {
+                        throw new DeploymentException("You must specify the name of the login module in the login module ref " + patternType);
+                    }
+//TODO configid reinstate this check for duplicate domain names
+//                    try
+//                    {
+//                        String loginDomain = (String) context.getAttribute(loginModuleName, "loginDomainName");
+//                        if (!loginModuleNames.add(loginDomain))
+//                        {
+//                            throw new DeploymentException("Security realm contains two login domains called '" + loginDomain + "'");
+//                        }
+//                    }
+//                    catch (DeploymentException e)
+//                    {
+//                        throw e;
+//                    }
+//                    catch (Exception e)
+//                    {
+//                        throw new DeploymentException("Unable to create reference to login module " + name, e);
+//                    }
                 }
                 else if (abstractLoginModule instanceof GerLoginModuleType)
                 {
                     //create the LoginModuleGBean also
-                    name = null;
-                    loginModuleName = null;
+                    AbstractName loginModuleName;
 
                     GerLoginModuleType loginModule = (GerLoginModuleType) abstractLoginModule;
                     name = trim(loginModule.getLoginDomainName());
@@ -147,7 +140,8 @@
                     }
                     try
                     {
-                        loginModuleName = NameFactory.getComponentName(null, null, null, null, name, NameFactory.LOGIN_MODULE, j2eeContext);
+                        loginModuleName = NameFactory.getChildName(parentName, NameFactory.LOGIN_MODULE, name, LoginModuleGBean.GBEAN_INFO.getInterfaces());
+                        loginModuleReferencePatterns = new ReferencePatterns(loginModuleName);
                     }
                     catch (MalformedObjectNameException e)
                     {
@@ -166,10 +160,10 @@
                 {
                     throw new DeploymentException("Unknown abstract login module type: " + abstractLoginModule.getClass());
                 }
-                ObjectName thisName;
+                AbstractName thisName;
                 try
                 {
-                    thisName = NameFactory.getComponentName(null, null, null, null, name, "LoginModuleUse", j2eeContext);
+                    thisName = NameFactory.getChildName(parentName, "LoginModuleUse", name, JaasLoginModuleUse.GBEAN_INFO.getInterfaces());
                 }
                 catch (MalformedObjectNameException e)
                 {
@@ -177,7 +171,7 @@
                 }
                 GBeanData loginModuleUseGBeanData = new GBeanData(thisName, JaasLoginModuleUse.GBEAN_INFO);
                 loginModuleUseGBeanData.setAttribute("controlFlag", controlFlag);
-                loginModuleUseGBeanData.setReferencePattern("LoginModule", loginModuleName);
+                loginModuleUseGBeanData.setReferencePatterns("LoginModule", loginModuleReferencePatterns);
                 uses.add(loginModuleUseGBeanData);
             }
             for (int i = uses.size() - 1; i >= 0; i--)
@@ -185,7 +179,7 @@
                 GBeanData data = (GBeanData) uses.get(i);
                 if (i > 0)
                 {
-                    ((GBeanData) uses.get(i - 1)).setReferencePattern("Next", data.getName());
+                    ((GBeanData) uses.get(i - 1)).setReferencePattern("Next", data.getAbstractName());
                 }
                 context.addGBean(data);
             }
@@ -194,7 +188,7 @@
         {
             xmlCursor.dispose();
         }
-        return uses.size() == 0 ? Collections.EMPTY_SET : Collections.singleton(((GBeanData) uses.get(0)).getName());
+        return uses.size() == 0 ? null : new ReferencePatterns(((GBeanData) uses.get(0)).getAbstractName());
     }
 
     private String trim(String string)
@@ -204,11 +198,29 @@
 
     public static final GBeanInfo GBEAN_INFO;
 
+    private static final GReferenceInfo USE_REFERENCE_INFO;
+
     static
     {
         GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(LoginConfigBuilder.class, "XmlReferenceBuilder");
         infoBuilder.addInterface(XmlReferenceBuilder.class);
         GBEAN_INFO = infoBuilder.getBeanInfo();
+
+        Set referenceInfos = JaasLoginModuleUse.GBEAN_INFO.getReferences();
+        GReferenceInfo found = null;
+        for (Iterator iterator = referenceInfos.iterator(); iterator.hasNext();) {
+            GReferenceInfo testReferenceInfo = (GReferenceInfo) iterator.next();
+            String testRefName = testReferenceInfo.getName();
+            if (testRefName.equals("LoginModule")) {
+                found = testReferenceInfo;
+                break;
+            }
+        }
+        if (found == null) {
+            throw new RuntimeException("Someone changed the gbeaninfo on JaasLoginModuleUse");
+        }
+        USE_REFERENCE_INFO = found;
+
     }
 
     public static GBeanInfo getGBeanInfo()

Modified: geronimo/branches/1.1/modules/security-builder/src/java/org/apache/geronimo/security/deployment/SecurityBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/security-builder/src/java/org/apache/geronimo/security/deployment/SecurityBuilder.java?rev=384667&r1=384666&r2=384667&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/security-builder/src/java/org/apache/geronimo/security/deployment/SecurityBuilder.java (original)
+++ geronimo/branches/1.1/modules/security-builder/src/java/org/apache/geronimo/security/deployment/SecurityBuilder.java Thu Mar  9 17:25:07 2006
@@ -21,11 +21,12 @@
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
-import javax.management.ObjectName;
 import javax.security.auth.Subject;
 import javax.security.auth.x500.X500Principal;
+import javax.management.MalformedObjectNameException;
 
 import org.apache.geronimo.gbean.GBeanData;
+import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.security.deploy.DefaultPrincipal;
 import org.apache.geronimo.security.deploy.DistinguishedName;
 import org.apache.geronimo.security.deploy.LoginDomainPrincipalInfo;
@@ -45,6 +46,7 @@
 import org.apache.geronimo.xbeans.geronimo.security.GerRoleMappingsType;
 import org.apache.geronimo.xbeans.geronimo.security.GerRoleType;
 import org.apache.geronimo.xbeans.geronimo.security.GerSecurityType;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 
 
 /**
@@ -145,7 +147,7 @@
     }
 
     private static Security buildSecurityConfig(GerSecurityType securityType) {
-        Security security = null;
+        Security security;
 
         if (securityType == null) {
             return null;
@@ -225,8 +227,9 @@
         return new PrincipalInfo(principalType.getClass1(), principalType.getName(), principalType.isSetDesignatedRunAs());
     }
 
-    public static GBeanData configureApplicationPolicyManager(ObjectName name, Map contextIDToPermissionsMap, SecurityConfiguration securityConfiguration) {
-        GBeanData jaccBeanData = new GBeanData(name, ApplicationPolicyConfigurationManager.GBEAN_INFO);
+    public static GBeanData configureApplicationPolicyManager(AbstractName moduleName, Map contextIDToPermissionsMap, SecurityConfiguration securityConfiguration) throws MalformedObjectNameException {
+        AbstractName jaccBeanName = NameFactory.getChildName(moduleName, NameFactory.JACC_MANAGER, NameFactory.JACC_MANAGER, ApplicationPolicyConfigurationManager.GBEAN_INFO.getInterfaces());
+        GBeanData jaccBeanData = new GBeanData(jaccBeanName, ApplicationPolicyConfigurationManager.GBEAN_INFO);
         jaccBeanData.setAttribute("contextIdToPermissionsMap", contextIDToPermissionsMap);
         jaccBeanData.setAttribute("principalRoleMap", securityConfiguration.getPrincipalRoleMap());
         jaccBeanData.setAttribute("roleDesignates", securityConfiguration.getRoleDesignates());

Added: geronimo/branches/1.1/modules/security-builder/src/schema/geronimo-login-config-1.1.xsd
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/security-builder/src/schema/geronimo-login-config-1.1.xsd?rev=384667&view=auto
==============================================================================
--- geronimo/branches/1.1/modules/security-builder/src/schema/geronimo-login-config-1.1.xsd (added)
+++ geronimo/branches/1.1/modules/security-builder/src/schema/geronimo-login-config-1.1.xsd Thu Mar  9 17:25:07 2006
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Copyright 2005 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.
+-->
+
+<!-- $Rev: 356129 $ $Date: 2005-12-11 19:25:16 -0800 (Sun, 11 Dec 2005) $ -->
+
+<xsd:schema
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
+    xmlns:geronimo="http://geronimo.apache.org/xml/ns/loginconfig-1.1"
+    targetNamespace="http://geronimo.apache.org/xml/ns/loginconfig-1.1"
+    xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.1"
+    elementFormDefault="qualified"
+    attributeFormDefault="unqualified"
+    version="1.0">
+
+    <xsd:import namespace="http://geronimo.apache.org/xml/ns/deployment-1.1" schemaLocation="geronimo-config-1.1.xsd"/>
+
+    <xsd:element name="login-config" type="geronimo:login-configType"/>
+
+    <xsd:complexType name="login-configType">
+        <xsd:annotation>
+            <xsd:documentation>
+                Defines the list of login modules for a login configuration represented by a GenericSecurityRealm
+            </xsd:documentation>
+        </xsd:annotation>
+        <xsd:sequence>
+            <xsd:choice minOccurs="0" maxOccurs="unbounded">
+                <xsd:element name="login-module-ref" type="geronimo:login-module-refType" minOccurs="0" maxOccurs="unbounded"/>
+                <xsd:element name="login-module" type="geronimo:login-moduleType" minOccurs="0" maxOccurs="unbounded"/>
+            </xsd:choice>
+        </xsd:sequence>
+    </xsd:complexType>
+
+    <xsd:complexType name="abstract-login-moduleType" abstract="true">
+        <xsd:attribute name="control-flag" type="geronimo:control-flagType" use="required"/>
+        <xsd:attribute name="wrap-principals" type="xsd:boolean"/>
+    </xsd:complexType>
+
+    <xsd:complexType name="login-module-refType">
+        <xsd:complexContent>
+            <xsd:extension base="geronimo:abstract-login-moduleType">
+                <xsd:sequence>
+                    <xsd:element name="pattern" type="sys:patternType"/>
+                </xsd:sequence>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:simpleType name="control-flagType">
+        <xsd:restriction base="xsd:string">
+            <xsd:enumeration value="REQUIRED"/>
+            <xsd:enumeration value="REQUISITE"/>
+            <xsd:enumeration value="SUFFICIENT"/>
+            <xsd:enumeration value="OPTIONAL"/>
+        </xsd:restriction>
+    </xsd:simpleType>
+
+    <xsd:complexType name="login-moduleType">
+        <xsd:complexContent>
+            <xsd:extension base="geronimo:abstract-login-moduleType">
+                <xsd:sequence>
+                    <xsd:element name="login-domain-name" type="xsd:string"/>
+                    <xsd:element name="login-module-class" type="xsd:string"/>
+                    <xsd:element name="option" type="geronimo:optionType" minOccurs="0" maxOccurs="unbounded"/>
+                </xsd:sequence>
+                <xsd:attribute name="server-side" type="xsd:boolean" use="required"/>
+            </xsd:extension>
+        </xsd:complexContent>
+    </xsd:complexType>
+
+    <xsd:complexType name="optionType">
+        <xsd:simpleContent>
+            <xsd:extension base="xsd:string">
+                <xsd:attribute name="name" type="xsd:string" use="required"/>
+            </xsd:extension>
+        </xsd:simpleContent>
+    </xsd:complexType>
+
+</xsd:schema>

Modified: geronimo/branches/1.1/modules/security-builder/src/schema/xmlconfig.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/security-builder/src/schema/xmlconfig.xml?rev=384667&r1=384666&r2=384667&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/security-builder/src/schema/xmlconfig.xml (original)
+++ geronimo/branches/1.1/modules/security-builder/src/schema/xmlconfig.xml Thu Mar  9 17:25:07 2006
@@ -5,7 +5,7 @@
         <xb:prefix>Ger</xb:prefix>
     </xb:namespace>
 
-    <xb:namespace uri="http://geronimo.apache.org/xml/ns/loginconfig-1.0">
+    <xb:namespace uri="http://geronimo.apache.org/xml/ns/loginconfig-1.1">
         <xb:package>org.apache.geronimo.xbeans.geronimo.loginconfig</xb:package>
         <xb:prefix>Ger</xb:prefix>
     </xb:namespace>

Modified: geronimo/branches/1.1/modules/service-builder/src/java/org/apache/geronimo/deployment/service/GBeanBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/service-builder/src/java/org/apache/geronimo/deployment/service/GBeanBuilder.java?rev=384667&r1=384666&r2=384667&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/service-builder/src/java/org/apache/geronimo/deployment/service/GBeanBuilder.java (original)
+++ geronimo/branches/1.1/modules/service-builder/src/java/org/apache/geronimo/deployment/service/GBeanBuilder.java Thu Mar  9 17:25:07 2006
@@ -22,23 +22,23 @@
 import org.apache.geronimo.deployment.DeploymentContext;
 import org.apache.geronimo.deployment.xbeans.PatternType;
 import org.apache.geronimo.deployment.xbeans.ReferenceType;
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.gbean.GAttributeInfo;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GReferenceInfo;
-import org.apache.geronimo.gbean.AbstractNameQuery;
-import org.apache.geronimo.gbean.AbstractName;
-import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContext;
+import org.apache.geronimo.gbean.ReferencePatterns;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.xmlbeans.XmlObject;
 
 import java.beans.PropertyEditor;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
-import java.util.Collections;
 
 /**
  * @version $Rev$ $Date$
@@ -47,15 +47,15 @@
     private final GBeanData gbean;
     private final ClassLoader classLoader;
     private final DeploymentContext context;
-    private final J2eeContext j2eeContext;
+    private final AbstractName moduleName;
     private final Map xmlAttributeBuilderMap;
     private final Map xmlReferenceBuilderMap;
 
-    GBeanBuilder(AbstractName abstractName, GBeanInfo gBeanInfo, ClassLoader classLoader, DeploymentContext context, J2eeContext j2eeContext, Map xmlAttributeBuilderMap, Map xmlReferenceBuilderMap) {
+    GBeanBuilder(AbstractName abstractName, GBeanInfo gBeanInfo, ClassLoader classLoader, DeploymentContext context, AbstractName moduleName, Map xmlAttributeBuilderMap, Map xmlReferenceBuilderMap) {
 
         this.classLoader = classLoader;
         this.context = context;
-        this.j2eeContext = j2eeContext;
+        this.moduleName = moduleName;
         this.gbean = new GBeanData(abstractName, gBeanInfo);
         this.xmlAttributeBuilderMap = xmlAttributeBuilderMap;
         this.xmlReferenceBuilderMap = xmlReferenceBuilderMap;
@@ -112,17 +112,17 @@
         if (builder == null) {
             throw new DeploymentException("No reference builder deployed for namespace: " + namespace);
         }
-        Set references = builder.getReferences(xmlObject, context, j2eeContext, classLoader);
-        if (references != null && !references.isEmpty()) {
+        ReferencePatterns references = builder.getReferences(xmlObject, context, moduleName, classLoader);
+        if (references != null) {
             gbean.setReferencePatterns(name, references);
         }
     }
 
-    public void setReference(String name, ReferenceType pattern, J2eeContext j2eeContext) throws DeploymentException {
-        setReference(name, new PatternType[]{pattern}, j2eeContext);
+    public void setReference(String name, ReferenceType pattern, AbstractName parentName) throws DeploymentException {
+        setReference(name, new PatternType[]{pattern}, parentName);
     }
 
-    public void setReference(String name, PatternType[] patterns, J2eeContext j2eeContext) throws DeploymentException {
+    public void setReference(String name, PatternType[] patterns, AbstractName parentName) throws DeploymentException {
         Set patternNames = new HashSet(patterns.length);
         for (int i = 0; i < patterns.length; i++) {
             patternNames.add(buildAbstractNameQuery(name, patterns[i]));
@@ -130,7 +130,7 @@
         gbean.setReferencePatterns(name, patternNames);
     }
 
-    public void addDependency(PatternType patternType, J2eeContext j2eeContext) throws DeploymentException {
+    public void addDependency(PatternType patternType) throws DeploymentException {
         AbstractNameQuery refInfo = buildAbstractNameQuery(null, patternType);
         gbean.addDependency(refInfo);
     }
@@ -153,6 +153,10 @@
             throw new DeploymentException("No reference named " + refName + " in gbean " + gbean.getName());
         }
 
+        return buildAbstractNameQuery(pattern, referenceInfo);
+    }
+
+    public static AbstractNameQuery buildAbstractNameQuery(PatternType pattern, GReferenceInfo referenceInfo) {
         String groupId = pattern.isSetGroupId() ? pattern.getGroupId().trim() : null;
         String artifactid = pattern.isSetArtifactId() ? pattern.getArtifactId().trim() : null;
         String version = pattern.isSetVersion() ? pattern.getVersion().trim() : null;

Modified: geronimo/branches/1.1/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java?rev=384667&r1=384666&r2=384667&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java (original)
+++ geronimo/branches/1.1/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java Thu Mar  9 17:25:07 2006
@@ -35,7 +35,6 @@
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.ReferenceMap;
 import org.apache.geronimo.gbean.AbstractName;
-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.config.ConfigurationData;
@@ -50,7 +49,6 @@
 import org.apache.xmlbeans.XmlObject;
 
 import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
 import javax.xml.namespace.QName;
 import java.io.File;
 import java.io.IOException;
@@ -169,49 +167,48 @@
         ClassLoader cl = context.getClassLoader(repository);
 
 
-        J2eeContext j2eeContext;
+        AbstractName moduleName;
         try {
-            j2eeContext = NameFactory.buildJ2eeContext(environment.getProperties(), NameFactory.NULL, NameFactory.J2EE_MODULE, environment.getConfigId().toString(), null, null);
+            moduleName = NameFactory.buildModuleName(environment.getProperties(), configId, NameFactory.J2EE_MODULE, null);
         } catch (MalformedObjectNameException e) {
             throw new DeploymentException(e);
         }
         GbeanType[] gbeans = configurationType.getGbeanArray();
-        addGBeans(gbeans, cl, j2eeContext, context);
+        addGBeans(gbeans, cl, moduleName, context);
         context.close();
         return context.getConfigurationData();
     }
 
-    public static void addGBeans(GbeanType[] gbeans, ClassLoader cl, J2eeContext j2eeContext, DeploymentContext context) throws DeploymentException {
+    public static void addGBeans(GbeanType[] gbeans, ClassLoader cl, AbstractName moduleName, DeploymentContext context) throws DeploymentException {
         for (int i = 0; i < gbeans.length; i++) {
-            addGBeanData(gbeans[i], j2eeContext, cl, context);
+            addGBeanData(gbeans[i], moduleName, cl, context);
         }
     }
 
-    public static ObjectName addGBeanData(GbeanType gbean, J2eeContext j2eeContext, ClassLoader cl, DeploymentContext context) throws DeploymentException {
+    public static AbstractName addGBeanData(GbeanType gbean, AbstractName moduleName, ClassLoader cl, DeploymentContext context) throws DeploymentException {
         GBeanInfo gBeanInfo = GBeanInfo.getGBeanInfo(gbean.getClass1(), cl);
-        ObjectName objectName;
-        Map nameMap = new HashMap();
-        if (gbean.isSetGbeanName()) {
-            try {
-                objectName = ObjectName.getInstance(gbean.getGbeanName());
-                nameMap.putAll(objectName.getKeyPropertyList());
-            } catch (MalformedObjectNameException e) {
-                throw new DeploymentException("Invalid ObjectName: " + gbean.getName(), e);
-            }
-        } else {
+        AbstractName abstractName;
+//        if (gbean.isSetGbeanName()) {
+//            try {
+//                abstractName = ObjectName.getInstance(gbean.getGbeanName());
+//                nameMap.putAll(abstractName.getKeyPropertyList());
+//            } catch (MalformedObjectNameException e) {
+//                throw new DeploymentException("Invalid ObjectName: " + gbean.getName(), e);
+//            }
+//        } else {
             String namePart = gbean.getName();
             try {
                 String j2eeType = gBeanInfo.getJ2eeType();
                 //todo investigate using the module type from the j2eecontext.
-                objectName = NameFactory.getComponentName(null, null, null, null, namePart, j2eeType, j2eeContext);
-                nameMap.put("name", namePart);
-                nameMap.put("type", j2eeType);
+                abstractName = NameFactory.getChildName(moduleName, j2eeType, namePart, gBeanInfo.getInterfaces());
+//                nameMap.put("name", namePart);
+//                nameMap.put("type", j2eeType);
             } catch (MalformedObjectNameException e) {
                 throw new DeploymentException("Invalid ObjectName: " + namePart, e);
             }
-        }
-        AbstractName abstractName = new AbstractName(context.getConfigID(), nameMap, gBeanInfo.getInterfaces(), objectName);
-        GBeanBuilder builder = new GBeanBuilder(abstractName, gBeanInfo, cl, context, j2eeContext, xmlAttributeBuilderMap, xmlReferenceBuilderMap);
+//        }
+//        AbstractName abstractName = new AbstractName(context.getConfigID(), nameMap, gBeanInfo.getInterfaces(), abstractName);
+        GBeanBuilder builder = new GBeanBuilder(abstractName, gBeanInfo, cl, context, moduleName, xmlAttributeBuilderMap, xmlReferenceBuilderMap);
 
         // set up attributes
         AttributeType[] attributeArray = gbean.getAttributeArray();
@@ -238,7 +235,7 @@
         ReferenceType[] referenceArray = gbean.getReferenceArray();
         if (referenceArray != null) {
             for (int j = 0; j < referenceArray.length; j++) {
-                builder.setReference(referenceArray[j].getName2(), referenceArray[j], j2eeContext);
+                builder.setReference(referenceArray[j].getName2(), referenceArray[j], moduleName);
             }
         }
 
@@ -246,7 +243,7 @@
         ReferencesType[] referencesArray = gbean.getReferencesArray();
         if (referencesArray != null) {
             for (int j = 0; j < referencesArray.length; j++) {
-                builder.setReference(referencesArray[j].getName(), referencesArray[j].getPatternArray(), j2eeContext);
+                builder.setReference(referencesArray[j].getName(), referencesArray[j].getPatternArray(), moduleName);
             }
         }
 
@@ -267,13 +264,13 @@
         if (dependencyArray != null) {
             for (int i = 0; i < dependencyArray.length; i++) {
                 PatternType patternType = dependencyArray[i];
-                builder.addDependency(patternType, j2eeContext);
+                builder.addDependency(patternType);
             }
         }
 
         GBeanData gBeanData = builder.getGBeanData();
         context.addGBean(gBeanData);
-        return objectName;
+        return abstractName;
     }
 
     public static final GBeanInfo GBEAN_INFO;

Modified: geronimo/branches/1.1/modules/service-builder/src/java/org/apache/geronimo/deployment/service/XmlReferenceBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/service-builder/src/java/org/apache/geronimo/deployment/service/XmlReferenceBuilder.java?rev=384667&r1=384666&r2=384667&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/service-builder/src/java/org/apache/geronimo/deployment/service/XmlReferenceBuilder.java (original)
+++ geronimo/branches/1.1/modules/service-builder/src/java/org/apache/geronimo/deployment/service/XmlReferenceBuilder.java Thu Mar  9 17:25:07 2006
@@ -16,11 +16,10 @@
  */
 package org.apache.geronimo.deployment.service;
 
-import java.util.Set;
-
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.DeploymentContext;
-import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContext;
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.gbean.ReferencePatterns;
 import org.apache.xmlbeans.XmlObject;
 
 /**
@@ -30,6 +29,6 @@
 
     String getNamespace();
 
-    Set getReferences(XmlObject xmlObject, DeploymentContext context, J2eeContext j2EEContext, ClassLoader classLoader) throws DeploymentException;
+    ReferencePatterns getReferences(XmlObject xmlObject, DeploymentContext context, AbstractName moduleAbstractName, ClassLoader classLoader) throws DeploymentException;
 
 }



Mime
View raw message