geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ammul...@apache.org
Subject svn commit: r391211 - in /geronimo/branches/1.1/modules: jetty/src/java/org/apache/geronimo/jetty/JettyManagerImpl.java kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java system/src/java/org/apache/geronimo/system/main/WebAppUtil.java
Date Tue, 04 Apr 2006 02:00:04 GMT
Author: ammulder
Date: Mon Apr  3 19:00:01 2006
New Revision: 391211

URL: http://svn.apache.org/viewcvs?rev=391211&view=rev
Log:
Fix the display of web app URLs during startup

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/gbean/runtime/GBeanInstance.java
    geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/main/WebAppUtil.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=391211&r1=391210&r2=391211&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 Apr  3 19:00:01 2006
@@ -217,7 +217,6 @@
                 AbstractName name = (AbstractName) it.next(); // a single Jetty connector
                 GBeanData data = kernel.getGBeanData(name);
                 ReferencePatterns refs = data.getReferencePatterns(JettyConnector.CONNECTOR_CONTAINER_REFERENCE);
-                //TODO configid need to verify that the refpattern is resolved
                 if(containerName.equals(refs.getAbstractName())) {
                     try {
                         String testProtocol = (String) kernel.getAttribute(name, "protocol");
@@ -245,7 +244,6 @@
                 AbstractName name = (AbstractName) it.next(); // a single Jetty connector
                 GBeanData data = kernel.getGBeanData(name);
                 ReferencePatterns refs = data.getReferencePatterns(JettyConnector.CONNECTOR_CONTAINER_REFERENCE);
-                //TODO configid need to verify that the refpattern is resolved
                 if (containerName.equals(refs.getAbstractName())) {
                     results.add(name);
                 }

Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java?rev=391211&r1=391210&r2=391211&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java
(original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java
Mon Apr  3 19:00:01 2006
@@ -17,45 +17,21 @@
 
 package org.apache.geronimo.gbean.runtime;
 
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.LinkedHashSet;
-import java.io.StringWriter;
-import java.io.PrintWriter;
-
-import javax.management.ObjectName;
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-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.GBeanLifecycle;
-import org.apache.geronimo.gbean.GConstructorInfo;
-import org.apache.geronimo.gbean.GOperationInfo;
-import org.apache.geronimo.gbean.GOperationSignature;
-import org.apache.geronimo.gbean.GReferenceInfo;
-import org.apache.geronimo.gbean.InvalidConfigurationException;
-import org.apache.geronimo.gbean.ReferencePatterns;
-import org.apache.geronimo.kernel.DependencyManager;
-import org.apache.geronimo.kernel.GBeanNotFoundException;
-import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.kernel.NoSuchAttributeException;
-import org.apache.geronimo.kernel.NoSuchOperationException;
+import org.apache.geronimo.gbean.*;
+import org.apache.geronimo.kernel.*;
 import org.apache.geronimo.kernel.config.ManageableAttributeStore;
 import org.apache.geronimo.kernel.management.State;
 import org.apache.geronimo.kernel.management.StateManageable;
 
+import javax.management.ObjectName;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.util.*;
+
 /**
  * A GBeanInstance is a J2EE Management Managed Object, and is standard base for Geronimo
services.
  *
@@ -600,13 +576,23 @@
         }
 
         // add the references
-        //TODO is it possible to extract the references?
-//        for (int i = 0; i < references.length; i++) {
-//            GBeanReference reference = references[i];
-//            String name = reference.getName();
-//            Set patterns = reference.getPatterns();
-//            gbeanData.setReferencePatterns(name, patterns);
-//        }
+        for (int i = 0; i < references.length; i++) {
+            GBeanReference reference = references[i];
+            String name = reference.getName();
+            if(reference instanceof GBeanSingleReference) {
+                AbstractName abstractName = ((GBeanSingleReference) reference).getTargetName();
+                if(abstractName != null) {
+                    gbeanData.setReferencePattern(name, abstractName);
+                }
+            } else if(reference instanceof GBeanCollectionReference) {
+                Set patterns = ((GBeanCollectionReference) reference).getPatterns();
+                if(patterns != null) {
+                    gbeanData.setReferencePatterns(name, patterns);
+                }
+            } else {
+                throw new IllegalStateException("Unrecognized GBeanReference '"+reference.getClass().getName()+"'");
+            }
+        }
         //TODO copy the dependencies??
         return gbeanData;
     }

Modified: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/main/WebAppUtil.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/main/WebAppUtil.java?rev=391211&r1=391210&r2=391211&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/main/WebAppUtil.java
(original)
+++ geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/main/WebAppUtil.java
Mon Apr  3 19:00:01 2006
@@ -63,7 +63,7 @@
                         urlPrefix = (String) map.get("AJP");
                     }
                 }
-                containers.put(cntName, urlPrefix);
+                containers.put(cntName.getObjectName().getCanonicalName(), urlPrefix);
             }
         }
         return containers;



Mime
View raw message