geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r406807 - in /geronimo/branches/1.1/modules: jetty/src/java/org/apache/geronimo/jetty/ kernel/src/java/org/apache/geronimo/kernel/ tomcat/src/java/org/apache/geronimo/tomcat/
Date Tue, 16 May 2006 02:50:46 GMT
Author: djencks
Date: Mon May 15 19:50:45 2006
New Revision: 406807

URL: http://svn.apache.org/viewcvs?rev=406807&view=rev
Log:
GERONIMO-1981 Create sibling gbean rather than child 

Modified:
    geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyManagerImpl.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/Jsr77Naming.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/Naming.java
    geronimo/branches/1.1/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatManagerImpl.java

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=406807&r1=406806&r2=406807&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 May 15 19:50:45 2006
@@ -73,7 +73,7 @@
      */
     public WebConnector addConnector(WebContainer container, String uniqueName, String protocol,
String host, int port) {
         AbstractName containerName = kernel.getAbstractNameFor(container);
-        AbstractName name = kernel.getNaming().createChildName(containerName, uniqueName,
NameFactory.GERONIMO_SERVICE);
+        AbstractName name = kernel.getNaming().createSiblingName(containerName, uniqueName,
NameFactory.GERONIMO_SERVICE);
         GBeanData connector;
         if (protocol.equals(PROTOCOL_HTTP)) {
             connector = new GBeanData(name, HTTPConnector.GBEAN_INFO);

Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/Jsr77Naming.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/Jsr77Naming.java?rev=406807&r1=406806&r2=406807&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/Jsr77Naming.java
(original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/Jsr77Naming.java
Mon May 15 19:50:45 2006
@@ -36,6 +36,7 @@
     private static final String DEFAULT_SERVER_NAME = "geronimo";
     private static final String J2EE_TYPE = "j2eeType";
     private static final String J2EE_NAME = "name";
+    private static final String INVALID_GENERIC_PARENT_TYPE = "GBean";
 
     public Jsr77Naming() {
     }
@@ -54,11 +55,25 @@
         return createChildName(parentAbstractName, parentAbstractName.getArtifact(), name,
type);
     }
 
+    public AbstractName createSiblingName(AbstractName parentAbstractName, String name, String
type) {
+        Map nameMap = new HashMap(parentAbstractName.getName());
+
+        nameMap.put(J2EE_TYPE, type);
+        nameMap.put(J2EE_NAME, name);
+
+        return new AbstractName(parentAbstractName.getArtifact(),
+                nameMap,
+                createObjectName(nameMap));
+    }
+
     public AbstractName createChildName(AbstractName parentAbstractName, Artifact artifact,
String name, String type) {
         Map nameMap = new HashMap(parentAbstractName.getName());
 
         String parentType = (String) nameMap.remove(J2EE_TYPE);
         String parentName = (String) nameMap.remove(J2EE_NAME);
+        if (INVALID_GENERIC_PARENT_TYPE.equals(parentType)) {
+            throw new IllegalArgumentException("You can't create a child of a generic typed
gbean");
+        }
         nameMap.put(parentType, parentName);
         nameMap.put(J2EE_TYPE, type);
         nameMap.put(J2EE_NAME, name);

Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/Naming.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/Naming.java?rev=406807&r1=406806&r2=406807&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/Naming.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/Naming.java Mon
May 15 19:50:45 2006
@@ -27,5 +27,7 @@
 
     public abstract AbstractName createChildName(AbstractName parentAbstractName, String
name, String type);
 
+    public abstract AbstractName createSiblingName(AbstractName parentAbstractName, String
name, String type);
+
     public abstract AbstractName createChildName(AbstractName parentAbstractName, Artifact
artifact, String name, String type);
 }

Modified: geronimo/branches/1.1/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatManagerImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatManagerImpl.java?rev=406807&r1=406806&r2=406807&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatManagerImpl.java
(original)
+++ geronimo/branches/1.1/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatManagerImpl.java
Mon May 15 19:50:45 2006
@@ -74,7 +74,7 @@
      */
     public WebConnector addConnector(WebContainer container, String uniqueName, String protocol,
String host, int port) {
         AbstractName containerName = kernel.getAbstractNameFor(container);
-        AbstractName name = kernel.getNaming().createChildName(containerName, uniqueName,
NameFactory.GERONIMO_SERVICE);
+        AbstractName name = kernel.getNaming().createSiblingName(containerName, uniqueName,
NameFactory.GERONIMO_SERVICE);
         GBeanData connector;
         if(protocol.equals(PROTOCOL_HTTP)) {
             connector = new GBeanData(name, ConnectorGBean.GBEAN_INFO);



Mime
View raw message