1 17 package org.apache.geronimo.system.main; 18 19 import org.apache.geronimo.kernel.Kernel; 20 import org.apache.geronimo.gbean.AbstractName; 21 import org.apache.geronimo.gbean.AbstractNameQuery; 22 23 import java.util.Map ; 24 import java.util.HashMap ; 25 import java.util.Set ; 26 import java.util.Iterator ; 27 28 33 public class WebAppUtil { 34 44 public static Map mapContainersToURLs(Kernel kernel) throws Exception { 45 Map containers = new HashMap (); 46 Set set = kernel.listGBeans(new AbstractNameQuery("org.apache.geronimo.management.geronimo.WebManager")); 47 for (Iterator it = set.iterator(); it.hasNext();) { 48 AbstractName manager = (AbstractName) it.next(); 49 Map results = (Map )kernel.invoke(manager, "mapContainersToURLs"); 50 containers.putAll(results); 51 } 52 return containers; 53 } 54 } 55 | Popular Tags |