geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r349918 - in /geronimo/trunk: ./ applications/console-standard/src/java/org/apache/geronimo/console/certmanager/ applications/console-standard/src/java/org/apache/geronimo/console/configmanager/ applications/console-standard/src/java/org/ap...
Date Wed, 30 Nov 2005 10:18:23 GMT
Author: djencks
Date: Wed Nov 30 02:18:13 2005
New Revision: 349918

URL: http://svn.apache.org/viewcvs?rev=349918&view=rev
Log:
GERONIMO-1249 and some related cleanup

Modified:
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/certmanager/CertManagerPortlet.java
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/configmanager/DeploymentPortlet.java
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/derbylogmanager/DerbyLogHelper.java
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/activemqCF/ActiveMQConnectorHelper.java
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/handlers/RemoveDestinationHandler.java
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/logmanager/WebAccessLogHelper.java
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/util/ObjectNameConstants.java
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/util/SERealmGroupHelper.java
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/util/SERealmUserHelper.java
    geronimo/trunk/applications/jmxdebug/src/webapp/WEB-INF/geronimo-web.xml
    geronimo/trunk/configs/console-jetty/src/plan/plan.xml
    geronimo/trunk/configs/console-tomcat/src/plan/plan.xml
    geronimo/trunk/maven.xml
    geronimo/trunk/modules/assembly/src/plan/webconsole-jetty-plan.xml
    geronimo/trunk/modules/assembly/src/plan/webconsole-tomcat-plan.xml

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/certmanager/CertManagerPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/certmanager/CertManagerPortlet.java?rev=349918&r1=349917&r2=349918&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/certmanager/CertManagerPortlet.java
(original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/certmanager/CertManagerPortlet.java
Wed Nov 30 02:18:13 2005
@@ -19,7 +19,6 @@
 
 import java.io.IOException;
 import java.util.Enumeration;
-
 import javax.management.ObjectName;
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
@@ -45,8 +44,6 @@
 
     private PortletContext ctx;
 
-    private ObjectName ksobjname;
-
     public CertManagerPortlet() {
         this.ctx = null;
     }
@@ -56,19 +53,11 @@
 
         // iniitialize portlet environment
         this.ctx = portletConfig.getPortletContext();
-
-        try {
-            this.ksobjname = new ObjectName(
-                    ObjectNameConstants.KEYSTORE_OBJ_NAME);
-        } catch (Exception e) {
-            throw new PortletException(e);
-        }
-
         this.ctx.log("Certificate manager portlet initialized");
     }
 
     public ObjectName getKeyStoreObjectName() {
-        return ksobjname;
+        return ObjectNameConstants.KEYSTORE_OBJ_NAME;
     }
 
     public void processAction(ActionRequest request, ActionResponse response)
@@ -105,8 +94,6 @@
 
     public void doView(RenderRequest request, RenderResponse response)
             throws PortletException, IOException {
-
-        PortletRequestDispatcher prd = null;
 
         String action = request.getParameter("action");
         ctx.log("do-view: action = " + action);

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java?rev=349918&r1=349917&r2=349918&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java
(original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/configmanager/ConfigManagerPortlet.java
Wed Nov 30 02:18:13 2005
@@ -69,9 +69,6 @@
 
     private static final String CONFIG_INIT_PARAM = "config-type";
 
-    private static final ObjectName deployer = JMXUtil
-            .getObjectName(ObjectNameConstants.DEPLOYER_OBJECT_NAME);
-
     private String messageInstalled = "";
 
     private String messageStatus = "";
@@ -158,11 +155,7 @@
             if (result.booleanValue() == true) {
                 // stop config if running
                 if (configManager.isLoaded(configURI)) {
-                    //int state = kernel.getConfigurationState(configID);
-                    int state = kernel
-                            .getGBeanState(JMXUtil
-                            .getObjectName(ObjectNameConstants.CONFIG_GBEAN_PREFIX
-                            + "\"" + configID + "\""));
+                    int state = kernel.getGBeanState(Configuration.getConfigurationObjectName(configURI));
                     if (state == State.RUNNING.toInt()) {
 
                         configManager.stop(configURI);

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/configmanager/DeploymentPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/configmanager/DeploymentPortlet.java?rev=349918&r1=349917&r2=349918&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/configmanager/DeploymentPortlet.java
(original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/configmanager/DeploymentPortlet.java
Wed Nov 30 02:18:13 2005
@@ -22,8 +22,6 @@
 import java.net.URI;
 import java.util.Iterator;
 import java.util.List;
-
-import javax.management.ObjectName;
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
 import javax.portlet.PortletConfig;
@@ -43,8 +41,6 @@
 import org.apache.geronimo.kernel.KernelRegistry;
 import org.apache.geronimo.kernel.config.ConfigurationManager;
 import org.apache.geronimo.kernel.config.ConfigurationUtil;
-import org.apache.geronimo.kernel.config.Configuration;
-import org.apache.geronimo.kernel.jmx.JMXUtil;
 
 public class DeploymentPortlet extends BasePortlet {
     private final String LINE_SEP = System.getProperty("line.separator");
@@ -58,9 +54,6 @@
     private static final String[] ARGS = {File.class.getName(),
                                           File.class.getName()};
 
-    private static final ObjectName deployer = JMXUtil
-            .getObjectName(ObjectNameConstants.DEPLOYER_OBJECT_NAME);
-
     private boolean messageNotRendered = true;
 
     public void processAction(ActionRequest actionRequest,
@@ -116,7 +109,7 @@
             throw new PortletException(e);
         }
         try {
-            List list = (List) kernel.invoke(deployer, "deploy", new Object[]{
+            List list = (List) kernel.invoke(ObjectNameConstants.DEPLOYER_OBJECT_NAME, "deploy",
new Object[]{
                 moduleFile, planFile}, ARGS);
             actionResponse.setRenderParameter("outcome",
                     "The application was successfully deployed.<br/>");

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/derbylogmanager/DerbyLogHelper.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/derbylogmanager/DerbyLogHelper.java?rev=349918&r1=349917&r2=349918&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/derbylogmanager/DerbyLogHelper.java
(original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/derbylogmanager/DerbyLogHelper.java
Wed Nov 30 02:18:13 2005
@@ -26,27 +26,17 @@
 import java.util.Collection;
 import java.util.Stack;
 
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-
 import org.apache.geronimo.console.util.KernelHelper;
-import org.apache.geronimo.console.util.ObjectNameConstants;
 
 public class DerbyLogHelper extends KernelHelper {
-    private static ObjectName objName;
-
     private static ArrayList logs = new ArrayList();
 
     private static boolean cached = false;
 
     private static int lineCount = 0;
 
-    private static final String DATE_PATTERN_REGEX = "2004";
-
     private static final String DERBY_SYSTEM_HOME = "derby.system.home";
 
-    private static final String DERBY_SYS_HOME_PROP = "derbySystemHome";
-
     private static final String LOG_FILENAME = "derby.log";
 
     public static Collection getLogs() throws IOException {
@@ -83,12 +73,5 @@
         return System.getProperty(DERBY_SYSTEM_HOME);
     }
 
-    static {
-        try {
-            objName = new ObjectName(ObjectNameConstants.DERBY_OBJECT_NAME);
-        } catch (MalformedObjectNameException e) {
-
-        }
-    }
 
 }

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/activemqCF/ActiveMQConnectorHelper.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/activemqCF/ActiveMQConnectorHelper.java?rev=349918&r1=349917&r2=349918&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/activemqCF/ActiveMQConnectorHelper.java
(original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/activemqCF/ActiveMQConnectorHelper.java
Wed Nov 30 02:18:13 2005
@@ -32,16 +32,12 @@
 import java.util.Iterator;
 import java.util.List;
 
-import javax.management.ObjectName;
-
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.console.util.ObjectNameConstants;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.KernelRegistry;
 import org.apache.geronimo.kernel.config.ConfigurationManager;
 import org.apache.geronimo.kernel.config.ConfigurationUtil;
-import org.apache.geronimo.kernel.config.Configuration;
-import org.apache.geronimo.kernel.jmx.JMXUtil;
 
 public class ActiveMQConnectorHelper {
 
@@ -51,7 +47,7 @@
 
     private final static String MODULE_FILE;
 
-    private final static String ACTIVEMQ_RA = "/activemq/rars/activemq-ra-3.2.rar";
+    private final static String ACTIVEMQ_RA = "/activemq/activemq-ra/3.2/rar";
 
     private final static String PLAN_XML = "/activemq/rars/amqconnectorPlan.xml";
 
@@ -59,19 +55,11 @@
 
     private static final String PLAN_TEMPLATE = getPlanTemplate();
 
-    // Deployer
-    private static final ObjectName DEPLOYER_NAME = JMXUtil
-            .getObjectName(ObjectNameConstants.DEPLOYER_OBJECT_NAME);
-
     private static final String[] DEPLOYER_ARGS = { File.class.getName(),
             File.class.getName() };
 
     private static final String DEPLOY_METHOD = "deploy";
 
-    // Repository
-    private static final ObjectName REPO_NAME = JMXUtil
-            .getObjectName(ObjectNameConstants.REPO_OBJECT_NAME);
-
     private static final String[] REPO_ARGS = { URI.class.getName() };
 
     private static final String GETURL_METHOD = "getURL";
@@ -89,7 +77,7 @@
         try {
             Kernel kernel = KernelRegistry.getSingleKernel();
             URI uri = new URI(".");
-            URL rootURL = (URL) kernel.invoke(REPO_NAME, GETURL_METHOD,
+            URL rootURL = (URL) kernel.invoke(ObjectNameConstants.REPO_OBJECT_NAME, GETURL_METHOD,
                     new Object[] {uri}, REPO_ARGS);
             uri = new URI(rootURL.toString());
             repoFile = new File(uri);
@@ -183,7 +171,7 @@
     public void deployPlan(File moduleFile, File planFile) {
         try {
             Kernel kernel = KernelRegistry.getSingleKernel();
-            List list = (List) kernel.invoke(DEPLOYER_NAME, DEPLOY_METHOD,
+            List list = (List) kernel.invoke(ObjectNameConstants.DEPLOYER_OBJECT_NAME, DEPLOY_METHOD,
                     new Object[] {moduleFile, planFile}, DEPLOYER_ARGS);
             ConfigurationManager configurationManager = ConfigurationUtil
                     .getConfigurationManager(kernel);

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/handlers/RemoveDestinationHandler.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/handlers/RemoveDestinationHandler.java?rev=349918&r1=349917&r2=349918&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/handlers/RemoveDestinationHandler.java
(original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/handlers/RemoveDestinationHandler.java
Wed Nov 30 02:18:13 2005
@@ -35,6 +35,7 @@
 import org.apache.geronimo.kernel.DependencyManager;
 import org.apache.geronimo.kernel.config.ConfigurationManager;
 import org.apache.geronimo.kernel.config.ConfigurationUtil;
+import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.jmx.JMXUtil;
 
 public class RemoveDestinationHandler extends AbstractJMSManager implements
@@ -51,6 +52,7 @@
             ConfigurationManager configurationManager = ConfigurationUtil
                     .getConfigurationManager(kernel);
             URI destinationConfigURI = new URI(destinationConfigURIName);
+            ObjectName configurationObjectName = Configuration.getConfigurationObjectName(destinationConfigURI);
 
             List stores = configurationManager.listStores();
             assert stores.size() == 1 :"Piling one hack on another, this code only works
with exactly one store";
@@ -61,9 +63,7 @@
             //GBeanData topicBrowser = (GBeanData) kernel.invoke(storeName,
             // "getConfiguration", new Object[]{destinationConfigURI}, new
             // String[]{URI.class.getName()});
-            GBeanData topicBrowser = kernel.getGBeanData(JMXUtil
-                    .getObjectName(ObjectNameConstants.CONFIG_GBEAN_PREFIX
-                            + "\"" + destinationConfigURI + "\""));
+            GBeanData topicBrowser = kernel.getGBeanData(configurationObjectName);
             java.util.Set children = dm.getChildren(topicBrowser.getName());
             for (Iterator i = children.iterator(); i.hasNext();) {
                 ObjectName o = (ObjectName) i.next();
@@ -75,9 +75,7 @@
 
             // Uninstall configuration
             //kernel.stopConfiguration(destinationConfigURI);
-            kernel.stopGBean(JMXUtil
-                    .getObjectName(ObjectNameConstants.CONFIG_GBEAN_PREFIX
-                            + "\"" + destinationConfigURIName + "\""));
+            kernel.stopGBean(configurationObjectName);
             kernel.invoke(storeName, "uninstall",
                     new Object[] {destinationConfigURI},
                     new String[] {URI.class.getName()});

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/logmanager/WebAccessLogHelper.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/logmanager/WebAccessLogHelper.java?rev=349918&r1=349917&r2=349918&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/logmanager/WebAccessLogHelper.java
(original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/logmanager/WebAccessLogHelper.java
Wed Nov 30 02:18:13 2005
@@ -32,16 +32,11 @@
 import java.util.TreeMap;
 import java.util.regex.Pattern;
 
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-
 import org.apache.geronimo.console.util.KernelHelper;
 import org.apache.geronimo.console.util.ObjectNameConstants;
 
 public class WebAccessLogHelper extends KernelHelper {
 
-    private static ObjectName objName, serverInfoObjName;
-
     private static final String LOG_FILE_ATTR = "filename";
 
     private static Map logs = new TreeMap();
@@ -142,7 +137,7 @@
     }
 
     public static File[] getFiles() {
-        String fileNamePattern = get(objName, LOG_FILE_ATTR).toString();
+        String fileNamePattern = get(ObjectNameConstants.REQUEST_LOGGER_OBJECT_NAME, LOG_FILE_ATTR).toString();
         if (fileNamePattern.indexOf("/") > -1) {
             fileNamePattern = fileNamePattern.substring(fileNamePattern
                     .lastIndexOf("/") + 1);
@@ -151,10 +146,10 @@
                     .lastIndexOf("\\") + 1);
         }
 
-        Object[] arg = { get(objName, LOG_FILE_ATTR).toString() };
+        Object[] arg = { get(ObjectNameConstants.REQUEST_LOGGER_OBJECT_NAME, LOG_FILE_ATTR).toString()
};
         String[] parms = { String.class.getName() };
         try {
-            String logFile = (String) invoke(serverInfoObjName, "resolvePath",
+            String logFile = (String) invoke(ObjectNameConstants.SERVER_INFO_OBJECT_NAME,
"resolvePath",
                     arg, parms);
             File f = new File(logFile).getParentFile();
             return (f != null ? f.listFiles(new PatternFilenameFilter(
@@ -225,16 +220,6 @@
                 && (date.equals(endDate) || date.before(endDate));
     }
 
-    static {
-        try {
-            objName = new ObjectName(
-                    ObjectNameConstants.REQUEST_LOGGER_OBJECT_NAME);
-            serverInfoObjName = new ObjectName(
-                    ObjectNameConstants.SERVER_INFO_OBJECT_NAME);
-        } catch (MalformedObjectNameException e) {
-
-        }
-    }
 
     /*
      * Static inner class implementation of java.io.Filename. This will help us

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/util/ObjectNameConstants.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/util/ObjectNameConstants.java?rev=349918&r1=349917&r2=349918&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/util/ObjectNameConstants.java
(original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/util/ObjectNameConstants.java
Wed Nov 30 02:18:13 2005
@@ -17,33 +17,59 @@
 
 package org.apache.geronimo.console.util;
 
-public interface ObjectNameConstants {
+import java.util.Set;
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
 
-    // Security object names
-    public static final String SE_REALM_MBEAN_NAME = "geronimo.server:J2EEApplication=org/apache/geronimo/Console,J2EEModule=null,J2EEServer=geronimo,j2eeType=GBean,name=PropertiesLoginManager";
-
-    public static final String SE_REALM_IMMUTABLE_MBEAN_NAME = "geronimo.server:name=PropertiesLoginManager,J2EEServer=geronimo,J2EEApplication=null,j2eeType=GBean,J2EEModule=null";
-
-    public static final String SECURITY_REALM = "geronimo.security:type=SecurityRealm,*";
-
-    public static final String ROOT_LOGGER_OBJECT_NAME = "geronimo.server:name=Logger,J2EEServer=geronimo,J2EEApplication=null,j2eeType=GBean,J2EEModule=org/apache/geronimo/System";
-
-    public static final String REQUEST_LOGGER_OBJECT_NAME = "geronimo.server:J2EEApplication=null,J2EEModule=org/apache/geronimo/Jetty,J2EEServer=geronimo,j2eeType=GBean,name=JettyRequestLog";
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.KernelRegistry;
 
-    public static final String DERBY_OBJECT_NAME = "geronimo.server:name=DerbySystem,J2EEServer=geronimo,J2EEApplication=null,j2eeType=GBean,J2EEModule=null";
+public final class ObjectNameConstants {
 
-    public static final String REPO_OBJECT_NAME = "geronimo.server:name=Repository,J2EEServer=geronimo,J2EEApplication=null,j2eeType=GBean,J2EEModule=org/apache/geronimo/System";
-
-    public static final String SERVER_INFO_OBJECT_NAME = "geronimo.server:name=ServerInfo,J2EEServer=geronimo,J2EEApplication=null,j2eeType=GBean,J2EEModule=org/apache/geronimo/System";
-
-    public static final String JVM_IMPL_NAME = "geronimo.server:j2eeType=JVM,J2EEServer=geronimo,name=JVM";
-
-    public static final String DEPLOYER_OBJECT_NAME = "geronimo.server:J2EEApplication=null,J2EEModule=org/apache/geronimo/RuntimeDeployer,J2EEServer=geronimo,j2eeType=Deployer,name=Deployer";
+    // Security object names
+    public static final ObjectName SE_REALM_MBEAN_NAME;
+    //= "geronimo.server:J2EEApplication=org/apache/geronimo/Console,J2EEModule=null,J2EEServer=geronimo,j2eeType=GBean,name=PropertiesLoginManager";
 
-    public static final String JCA_MANAGED_CF_QUERY = "*:j2eeType=JCAManagedConnectionFactory,*";
+//    public static final ObjectName SE_REALM_IMMUTABLE_MBEAN_NAME;
+    //= "geronimo.server:name=PropertiesLoginManager,J2EEServer=geronimo,J2EEApplication=null,j2eeType=GBean,J2EEModule=null";
 
-    public static final String CONFIG_GBEAN_PREFIX = "geronimo.config:name=";
+    public static final ObjectName REQUEST_LOGGER_OBJECT_NAME;
+    //= "geronimo.server:J2EEApplication=null,J2EEModule=org/apache/geronimo/Jetty,J2EEServer=geronimo,j2eeType=GBean,name=JettyRequestLog";
 
-    public static final String KEYSTORE_OBJ_NAME = "geronimo.security:type=KeyStore";
+    public static final ObjectName REPO_OBJECT_NAME;
+    //= "geronimo.server:name=Repository,J2EEServer=geronimo,J2EEApplication=null,j2eeType=GBean,J2EEModule=org/apache/geronimo/System";
+
+    public static final ObjectName SERVER_INFO_OBJECT_NAME;
+    //= "geronimo.server:name=ServerInfo,J2EEServer=geronimo,J2EEApplication=null,j2eeType=GBean,J2EEModule=org/apache/geronimo/System";
+
+    public static final ObjectName DEPLOYER_OBJECT_NAME;
+    //= "geronimo.server:J2EEApplication=null,J2EEModule=org/apache/geronimo/RuntimeDeployer,J2EEServer=geronimo,j2eeType=Deployer,name=Deployer";
+
+    public static final ObjectName KEYSTORE_OBJ_NAME;
+    //= "geronimo.security:type=KeyStore";
+
+    static {
+        Kernel kernel = KernelRegistry.getSingleKernel();
+        try {
+            SE_REALM_MBEAN_NAME = getUniquename("*:J2EEModule=null,j2eeType=GBean,name=PropertiesLoginManager,*",
kernel);
+//            SE_REALM_IMMUTABLE_MBEAN_NAME = getUniquename("geronimo.server:name=PropertiesLoginManager,J2EEServer=geronimo,J2EEApplication=null,j2eeType=GBean,J2EEModule=null",
kernel);
+            REQUEST_LOGGER_OBJECT_NAME = getUniquename("*:J2EEApplication=null,j2eeType=GBean,name=JettyRequestLog,*",
kernel);
+            REPO_OBJECT_NAME = getUniquename("*:J2EEApplication=null,j2eeType=GBean,name=Repository,*",
kernel);
+            SERVER_INFO_OBJECT_NAME = getUniquename("*:J2EEApplication=null,j2eeType=GBean,name=ServerInfo,*",
kernel);
+            DEPLOYER_OBJECT_NAME = getUniquename("*:J2EEApplication=null,j2eeType=Deployer,name=Deployer,*",
kernel);
+            KEYSTORE_OBJ_NAME = getUniquename("*:J2EEModule=null,j2eeType=GBean,name=KeyStore,*",
kernel);
+        } catch (MalformedObjectNameException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    private static ObjectName getUniquename(String queryPattern, Kernel kernel) throws MalformedObjectNameException
{
+        ObjectName query = ObjectName.getInstance(queryPattern);
+        Set results = kernel.listGBeans(query);
+        if (results.size() != 1) {
+            throw new RuntimeException("Invalid query: " + queryPattern + ", returns: " +
results);
+        }
+        return (ObjectName) results.iterator().next();
+    }
 
 }

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/util/SERealmGroupHelper.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/util/SERealmGroupHelper.java?rev=349918&r1=349917&r2=349918&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/util/SERealmGroupHelper.java
(original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/util/SERealmGroupHelper.java
Wed Nov 30 02:18:13 2005
@@ -21,9 +21,6 @@
 import java.util.Hashtable;
 import java.util.Set;
 
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.KernelRegistry;
 
@@ -41,35 +38,24 @@
 
     private static final String GET_USERS_FUNCTION = "getGroupMembers";
 
-    private static final String REFRESH = "refresh";
-
-    private static final String START = "doStart";
-
-    private static final String STOP = "doStop";
-
-    private static final String[] STRING_STRING = { "java.lang.String",
-            "java.lang.String" };
-
     private static final String[] STRING = { "java.lang.String" };
 
     private static final String[] HASHTABLE = { "java.util.Hashtable" };
 
-    private static ObjectName mBeanName;
-
     private static final Kernel kernel = KernelRegistry.getSingleKernel();
 
     public static String[] getGroups() throws Exception {
-        String[] groups = (String[]) invoke(mBeanName, GET_GROUPS_FUNCTION);
+        String[] groups = (String[]) invoke(ObjectNameConstants.SE_REALM_MBEAN_NAME, GET_GROUPS_FUNCTION);
         return groups;
     }
 
     private static void refresh() {
         try {
 
-            kernel.stopGBean(new ObjectName(
-                    ObjectNameConstants.SE_REALM_IMMUTABLE_MBEAN_NAME));
-            kernel.startGBean(new ObjectName(
-                    ObjectNameConstants.SE_REALM_IMMUTABLE_MBEAN_NAME));
+            kernel.stopGBean(ObjectNameConstants.SE_REALM_MBEAN_NAME);
+            kernel.startGBean(ObjectNameConstants.SE_REALM_MBEAN_NAME);
+//            kernel.stopGBean(ObjectNameConstants.SE_REALM_IMMUTABLE_MBEAN_NAME);
+//            kernel.startGBean(ObjectNameConstants.SE_REALM_IMMUTABLE_MBEAN_NAME);
 
         } catch (Exception e) {
         }
@@ -90,7 +76,7 @@
     public static boolean groupExists(String username) throws Exception {
         Boolean ret;
         String[] arg = {username};
-        ret = (Boolean) invoke(mBeanName, GROUP_EXISTS_FUNCTION, arg, STRING);
+        ret = (Boolean) invoke(ObjectNameConstants.SE_REALM_MBEAN_NAME, GROUP_EXISTS_FUNCTION,
arg, STRING);
         return ret.booleanValue();
     }
 
@@ -101,7 +87,7 @@
         props.put("GroupName", groupName);
         props.put("Members", userList);
         Object[] args = {props};
-        invoke(mBeanName, ADD_GROUP_FUNCTION, args, HASHTABLE);
+        invoke(ObjectNameConstants.SE_REALM_MBEAN_NAME, ADD_GROUP_FUNCTION, args, HASHTABLE);
     }
 
     public static void updateGroup(String groupName, String userList)
@@ -111,19 +97,19 @@
         props.put("Members", userList);
         Object[] args = {props};
 
-        invoke(mBeanName, UPDATE_GROUP_FUNCTION, args, HASHTABLE);
+        invoke(ObjectNameConstants.SE_REALM_MBEAN_NAME, UPDATE_GROUP_FUNCTION, args, HASHTABLE);
     }
 
     public static void deleteGroup(String groupName) throws Exception {
         String[] args = {groupName};
-        invoke(mBeanName, DELETE_GROUP_FUNCTION, args, STRING);
+        invoke(ObjectNameConstants.SE_REALM_MBEAN_NAME, DELETE_GROUP_FUNCTION, args, STRING);
         refresh();
     }
 
     public static Set getUsers(String groupName) throws Exception {
         Set ret = null;
         String[] arg = {groupName};
-        ret = (Set) invoke(mBeanName, GET_USERS_FUNCTION, arg, STRING);
+        ret = (Set) invoke(ObjectNameConstants.SE_REALM_MBEAN_NAME, GET_USERS_FUNCTION, arg,
STRING);
         return ret;
     }
 
@@ -136,13 +122,6 @@
     private static Collection getUsersAsCollection(String groupName)
             throws Exception {
         return getUsers(groupName);
-    }
-
-    static {
-        try {
-            mBeanName = new ObjectName(ObjectNameConstants.SE_REALM_MBEAN_NAME);
-        } catch (MalformedObjectNameException e) {
-        }
     }
 
 }

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/util/SERealmUserHelper.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/util/SERealmUserHelper.java?rev=349918&r1=349917&r2=349918&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/util/SERealmUserHelper.java
(original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/util/SERealmUserHelper.java
Wed Nov 30 02:18:13 2005
@@ -19,9 +19,6 @@
 
 import java.util.Hashtable;
 
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.KernelRegistry;
 
@@ -39,34 +36,23 @@
 
     private static final String GET_PASSWORD_FUNCTION = "getPassword";
 
-    private static final String REFRESH = "refresh";
-
-    private static final String START = "doStart";
-
-    private static final String STOP = "doStop";
-
-    private static final String[] STRING_STRING = { "java.lang.String",
-            "java.lang.String" };
-
     private static final String[] STRING = { "java.lang.String" };
 
     private static final String[] HASHTABLE = { "java.util.Hashtable" };
 
-    private static ObjectName mBeanName;
-
     private static final Kernel kernel = KernelRegistry.getSingleKernel();
 
     public static String[] getUsers() throws Exception {
-        return (String[]) invoke(mBeanName, GET_USERS_FUNCTION);
+        return (String[]) invoke(ObjectNameConstants.SE_REALM_MBEAN_NAME, GET_USERS_FUNCTION);
     }
 
     private static void refresh() {
         try {
 
-            kernel.stopGBean(new ObjectName(
-                    ObjectNameConstants.SE_REALM_IMMUTABLE_MBEAN_NAME));
-            kernel.startGBean(new ObjectName(
-                    ObjectNameConstants.SE_REALM_IMMUTABLE_MBEAN_NAME));
+            kernel.stopGBean(ObjectNameConstants.SE_REALM_MBEAN_NAME);
+            kernel.startGBean(ObjectNameConstants.SE_REALM_MBEAN_NAME);
+//            kernel.stopGBean(ObjectNameConstants.SE_REALM_IMMUTABLE_MBEAN_NAME);
+//            kernel.startGBean(ObjectNameConstants.SE_REALM_IMMUTABLE_MBEAN_NAME);
 
         } catch (Exception e) {
         }
@@ -75,14 +61,14 @@
     public static String getPassword(String username) throws Exception {
         Object ret;
         String[] arg = {username};
-        ret = invoke(mBeanName, GET_PASSWORD_FUNCTION, arg, STRING);
+        ret = invoke(ObjectNameConstants.SE_REALM_MBEAN_NAME, GET_PASSWORD_FUNCTION, arg,
STRING);
         return (ret != null) ? ret.toString() : "";
     }
 
     public static boolean userExists(String username) throws Exception {
         Boolean ret;
         String[] arg = {username};
-        ret = (Boolean) invoke(mBeanName, USER_EXISTS_FUNCTION, arg, STRING);
+        ret = (Boolean) invoke(ObjectNameConstants.SE_REALM_MBEAN_NAME, USER_EXISTS_FUNCTION,
arg, STRING);
         return ret.booleanValue();
     }
 
@@ -92,7 +78,7 @@
         props.put("UserName", username);
         props.put("Password", password);
         Object[] args = {props};
-        invoke(mBeanName, ADD_USER_FUNCTION, args, HASHTABLE);
+        invoke(ObjectNameConstants.SE_REALM_MBEAN_NAME, ADD_USER_FUNCTION, args, HASHTABLE);
         refresh();
     }
 
@@ -102,23 +88,15 @@
         props.put("UserName", username);
         props.put("Password", password);
         Object[] args = {props};
-        invoke(mBeanName, UPDATE_USER_FUNCTION, args, HASHTABLE);
+        invoke(ObjectNameConstants.SE_REALM_MBEAN_NAME, UPDATE_USER_FUNCTION, args, HASHTABLE);
         refresh();
     }
 
     public static void deleteUser(String username) throws Exception {
         String[] args = {username};
-        invoke(mBeanName, DELETE_USER_FUNCTION, args, STRING);
+        invoke(ObjectNameConstants.SE_REALM_MBEAN_NAME, DELETE_USER_FUNCTION, args, STRING);
         refresh();
     }
 
-    static {
-        try {
-            mBeanName = new ObjectName(ObjectNameConstants.SE_REALM_MBEAN_NAME);
-
-        } catch (MalformedObjectNameException e) {
-
-        }
-    }
 
 }

Modified: geronimo/trunk/applications/jmxdebug/src/webapp/WEB-INF/geronimo-web.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/jmxdebug/src/webapp/WEB-INF/geronimo-web.xml?rev=349918&r1=349917&r2=349918&view=diff
==============================================================================
--- geronimo/trunk/applications/jmxdebug/src/webapp/WEB-INF/geronimo-web.xml (original)
+++ geronimo/trunk/applications/jmxdebug/src/webapp/WEB-INF/geronimo-web.xml Wed Nov 30 02:18:13
2005
@@ -2,7 +2,7 @@
 <web-app
     xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.0"
     configId="geronimo/debug-console/1.0-SNAPSHOT/car"
-    parentId="geronimo/server/1.0-SNAPSHOT/car"
+    parentId="geronimo/j2ee-server/1.0-SNAPSHOT/car"
     >
 <!--
     configId="geronimo/debug-console/${pom.currentVersion}/car"

Modified: geronimo/trunk/configs/console-jetty/src/plan/plan.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/configs/console-jetty/src/plan/plan.xml?rev=349918&r1=349917&r2=349918&view=diff
==============================================================================
--- geronimo/trunk/configs/console-jetty/src/plan/plan.xml (original)
+++ geronimo/trunk/configs/console-jetty/src/plan/plan.xml Wed Nov 30 02:18:13 2005
@@ -69,7 +69,7 @@
     </gbean>
 
     <!-- Keystore configuration -->
-    <gbean gbeanName="geronimo.security:type=KeyStore" class="org.apache.geronimo.console.core.keystore.KeyStoreGBean">
+    <gbean name="KeyStore" class="org.apache.geronimo.console.core.keystore.KeyStoreGBean">
         <attribute name="keyStoreLocation">var/security/ssl-keystore-1</attribute>
         <attribute name="keyStoreType">jks</attribute>
         <attribute name="keyStoreProvider">SUN</attribute>

Modified: geronimo/trunk/configs/console-tomcat/src/plan/plan.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/configs/console-tomcat/src/plan/plan.xml?rev=349918&r1=349917&r2=349918&view=diff
==============================================================================
--- geronimo/trunk/configs/console-tomcat/src/plan/plan.xml (original)
+++ geronimo/trunk/configs/console-tomcat/src/plan/plan.xml Wed Nov 30 02:18:13 2005
@@ -71,7 +71,7 @@
     </gbean>
 
     <!-- Keystore configuration -->
-    <gbean gbeanName="geronimo.security:type=KeyStore" class="org.apache.geronimo.console.core.keystore.KeyStoreGBean">
+    <gbean name="KeyStore" class="org.apache.geronimo.console.core.keystore.KeyStoreGBean">
         <attribute name="keyStoreLocation">var/security/ssl-keystore-1</attribute>
         <attribute name="keyStoreType">jks</attribute>
         <attribute name="keyStoreProvider">SUN</attribute>

Modified: geronimo/trunk/maven.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/maven.xml?rev=349918&r1=349917&r2=349918&view=diff
==============================================================================
--- geronimo/trunk/maven.xml (original)
+++ geronimo/trunk/maven.xml Wed Nov 30 02:18:13 2005
@@ -53,12 +53,18 @@
     </goal>
 
     <goal name="new3">
-        <j:set var="maven.multiproject.includes" value="configs/*/project.xml"/>
+        <j:set var="maven.multiproject.includes" value="applications/*/project.xml"/>
         <j:set var="maven.multiproject.excludes" value=""/>
         <attainGoal name="multiproject:install"/>
     </goal>
 
     <goal name="new4">
+        <j:set var="maven.multiproject.includes" value="configs/*/project.xml"/>
+        <j:set var="maven.multiproject.excludes" value=""/>
+        <attainGoal name="multiproject:install"/>
+    </goal>
+
+    <goal name="new5">
         <j:set var="maven.multiproject.includes" value="assemblies/*/project.xml"/>
         <j:set var="maven.multiproject.excludes" value=""/>
         <attainGoal name="multiproject:install"/>

Modified: geronimo/trunk/modules/assembly/src/plan/webconsole-jetty-plan.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/assembly/src/plan/webconsole-jetty-plan.xml?rev=349918&r1=349917&r2=349918&view=diff
==============================================================================
--- geronimo/trunk/modules/assembly/src/plan/webconsole-jetty-plan.xml (original)
+++ geronimo/trunk/modules/assembly/src/plan/webconsole-jetty-plan.xml Wed Nov 30 02:18:13
2005
@@ -126,7 +126,7 @@
     </gbean>
 
     <!-- Keystore configuration -->
-    <gbean gbeanName="geronimo.security:type=KeyStore" class="org.apache.geronimo.console.core.keystore.KeyStoreGBean">
+    <gbean name="KeyStore" class="org.apache.geronimo.console.core.keystore.KeyStoreGBean">
         <attribute name="keyStoreLocation">var/security/ssl-keystore-1</attribute>
         <attribute name="keyStoreType">jks</attribute>
         <attribute name="keyStoreProvider">SUN</attribute>

Modified: geronimo/trunk/modules/assembly/src/plan/webconsole-tomcat-plan.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/assembly/src/plan/webconsole-tomcat-plan.xml?rev=349918&r1=349917&r2=349918&view=diff
==============================================================================
--- geronimo/trunk/modules/assembly/src/plan/webconsole-tomcat-plan.xml (original)
+++ geronimo/trunk/modules/assembly/src/plan/webconsole-tomcat-plan.xml Wed Nov 30 02:18:13
2005
@@ -128,7 +128,7 @@
     </gbean>
 
     <!-- Keystore configuration -->
-    <gbean gbeanName="geronimo.security:type=KeyStore" class="org.apache.geronimo.console.core.keystore.KeyStoreGBean">
+    <gbean name="KeyStore" class="org.apache.geronimo.console.core.keystore.KeyStoreGBean">
         <attribute name="keyStoreLocation">var/security/ssl-keystore-1</attribute>
         <attribute name="keyStoreType">jks</attribute>
         <attribute name="keyStoreProvider">SUN</attribute>



Mime
View raw message