geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r389907 [3/3] - in /geronimo/branches/1.1: applications/console-core/src/java/org/apache/geronimo/console/util/ applications/console-standard/src/java/org/apache/geronimo/console/configmanager/ applications/console-standard/src/java/org/apa...
Date Wed, 29 Mar 2006 22:17:01 GMT
Modified: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java?rev=389907&r1=389906&r2=389907&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java
(original)
+++ geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java
Wed Mar 29 14:16:54 2006
@@ -38,8 +38,6 @@
 import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
 
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.ParserConfigurationException;
 import java.beans.PropertyEditor;
@@ -60,7 +58,7 @@
 /**
  * Stores managed attributes in an XML file on the local filesystem.
  *
- * @version $Rev$ $Date$
+ * @version $Rev: 386505 $ $Date$
  */
 public class LocalAttributeManager implements ManageableAttributeStore, PersistentConfigurationList,
GBeanLifecycle {
     private final static Log log = LogFactory.getLog(LocalAttributeManager.class);
@@ -119,13 +117,13 @@
             Object name = entry.getKey();
             GBeanOverride gbean = (GBeanOverride) entry.getValue();
             if (!datasByName.containsKey(name) && gbean.getGBeanInfo() != null &&
gbean.isLoad()) {
-                if (!(name instanceof ObjectName)) {
+                if (!(name instanceof AbstractName)) {
                     throw new InvalidConfigException("New GBeans must be specified with a
full abstractName:" +
                             " configuration=" + configName +
                             " gbeanName=" + name);
                 }
                 GBeanInfo gbeanInfo = GBeanInfo.getGBeanInfo(gbean.getGBeanInfo(), classLoader);
-                AbstractName abstractName = new AbstractName(configurationName, ((ObjectName)name).getKeyPropertyList(),
(ObjectName)name);
+                AbstractName abstractName = (AbstractName)name;
                 GBeanData gBeanData = new GBeanData(abstractName, gbeanInfo);
                 gbeanDatas.add(gBeanData);
             }
@@ -177,7 +175,7 @@
             String attributeName = (String) entry.getKey();
             GAttributeInfo attributeInfo = gbeanInfo.getAttribute(attributeName);
             if (attributeInfo == null) {
-                throw new InvalidConfigException("No attribute: " + attributeName + " for
gbean: " + data.getName());
+                throw new InvalidConfigException("No attribute: " + attributeName + " for
gbean: " + data.getAbstractName());
             }
             String valueString = (String) entry.getValue();
             Object value = getValue(attributeInfo, valueString, configName, gbeanName, classLoader);
@@ -191,7 +189,7 @@
             String referenceName = (String) entry.getKey();
             GReferenceInfo referenceInfo = gbeanInfo.getReference(referenceName);
             if (referenceInfo == null) {
-                throw new InvalidConfigException("No reference: " + referenceName + " for
gbean: " + data.getName());
+                throw new InvalidConfigException("No reference: " + referenceName + " for
gbean: " + data.getAbstractName());
             }
 
             ReferencePatterns referencePatterns = (ReferencePatterns) entry.getValue();
@@ -317,8 +315,6 @@
         } catch (SAXException e) {
             log.error("Unable to read saved manageable attributes", e);
         } catch (ParserConfigurationException e) {
-            log.error("Unable to read saved manageable attributes", e);
-        } catch (MalformedObjectNameException e) {
             log.error("Unable to read saved manageable attributes", e);
         } catch (InvalidGBeanException e) {
             log.error("Unable to read saved manageable attributes", e);

Modified: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java?rev=389907&r1=389906&r2=389907&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java
(original)
+++ geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java
Wed Mar 29 14:16:54 2006
@@ -35,6 +35,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.kernel.Kernel;
 import org.apache.geronimo.kernel.jmx.JMXUtil;
 import org.apache.geronimo.kernel.config.Configuration;
@@ -227,7 +228,7 @@
                 Artifact configId = (Artifact) i.next();
                 if (configId.getType().equals("car")) {
                     try {
-                        ObjectName configName = Configuration.getConfigurationObjectName(configId);
+                        AbstractName configName = Configuration.getConfigurationAbstractName(configId);
                         State state;
                         if (kernel.isLoaded(configName)) {
                             try {

Modified: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ServerOverride.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ServerOverride.java?rev=389907&r1=389906&r2=389907&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ServerOverride.java
(original)
+++ geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ServerOverride.java
Wed Mar 29 14:16:54 2006
@@ -16,18 +16,17 @@
  */
 package org.apache.geronimo.system.configuration;
 
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-import org.apache.geronimo.kernel.InvalidGBeanException;
-
-import javax.management.MalformedObjectNameException;
 import java.io.PrintWriter;
 import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.Map;
 
+import org.apache.geronimo.kernel.InvalidGBeanException;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
 /**
- * @version $Rev$ $Date$
+ * @version $Rev: 384351 $ $Date$
  */
 class ServerOverride {
     private final Map configurations = new LinkedHashMap();
@@ -35,7 +34,7 @@
     public ServerOverride() {
     }
 
-    public ServerOverride(Element element) throws MalformedObjectNameException, InvalidGBeanException
{
+    public ServerOverride(Element element) throws InvalidGBeanException {
         NodeList configs = element.getElementsByTagName("configuration");
         for (int i = 0; i < configs.getLength(); i++) {
             Element configurationElement = (Element) configs.item(i);

Modified: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/main/Daemon.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/main/Daemon.java?rev=389907&r1=389906&r2=389907&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/main/Daemon.java
(original)
+++ geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/main/Daemon.java
Wed Mar 29 14:16:54 2006
@@ -20,7 +20,6 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.common.GeronimoEnvironment;
-import org.apache.geronimo.gbean.GBeanQuery;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.kernel.Kernel;

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=389907&r1=389906&r2=389907&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
Wed Mar 29 14:16:54 2006
@@ -17,11 +17,9 @@
 package org.apache.geronimo.system.main;
 
 import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.gbean.GBeanQuery;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.AbstractNameQuery;
 
-import javax.management.ObjectName;
 import java.util.Map;
 import java.util.HashMap;
 import java.util.Set;

Modified: geronimo/branches/1.1/modules/system/src/test/org/apache/geronimo/system/configuration/LocalAttributeManagerTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/test/org/apache/geronimo/system/configuration/LocalAttributeManagerTest.java?rev=389907&r1=389906&r2=389907&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/system/src/test/org/apache/geronimo/system/configuration/LocalAttributeManagerTest.java
(original)
+++ geronimo/branches/1.1/modules/system/src/test/org/apache/geronimo/system/configuration/LocalAttributeManagerTest.java
Wed Mar 29 14:16:54 2006
@@ -40,7 +40,7 @@
 import java.util.Set;
 
 /**
- * @version $Rev$ $Date$
+ * @version $Rev: 386907 $ $Date$
  */
 public class LocalAttributeManagerTest extends TestCase {
     private static final String basedir = System.getProperties().getProperty("basedir", ".");
@@ -172,7 +172,7 @@
 
         assertNotSame(gbeanData, newGBeanData);
         assertSame(gbeanData.getGBeanInfo(), newGBeanData.getGBeanInfo());
-        assertSame(gbeanData.getName(), newGBeanData.getName());
+        assertSame(gbeanData.getAbstractName(), newGBeanData.getAbstractName());
         assertEquals(Collections.singleton(referencePattern), newGBeanData.getReferencePatterns(referenceInfo.getName()).getPatterns());
         assertEquals(attributeValue, newGBeanData.getAttribute(attributeInfo.getName()));
     }

Modified: geronimo/branches/1.1/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java?rev=389907&r1=389906&r2=389907&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
(original)
+++ geronimo/branches/1.1/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
Wed Mar 29 14:16:54 2006
@@ -95,10 +95,6 @@
  * @version $Rev:385232 $ $Date$
  */
 public class TomcatModuleBuilderTest extends TestCase {
-    private String DOMAIN_NAME = "geronimo.test";
-    private String SERVER_NAME = "geronimo";
-    private String BASE_NAME = DOMAIN_NAME + ":J2EEServer=" + SERVER_NAME;
-
     private Naming naming = new Jsr77Naming();
     private Artifact baseId = new Artifact("test", "base", "1", "car");
     private final AbstractName serverName = naming.createRootName(baseId, "Server", "J2EEServer");
@@ -271,7 +267,7 @@
     }
 
     protected void setUp() throws Exception {
-        defaultEnvironment.getProperties().put(NameFactory.JSR77_BASE_NAME_PROPERTY, BASE_NAME);
+        super.setUp();
         cl = this.getClass().getClassLoader();
         kernel = KernelFactory.newInstance().createKernel("test");
         kernel.boot();
@@ -306,9 +302,9 @@
         Map initParams = new HashMap();
 
         initParams.put("userClassNames",
-                        "org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal");
+                "org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal");
         initParams.put("roleClassNames",
-                        "org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal");
+                "org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal");
         GBeanData realm = bootstrap.addGBean("tomcatRealm", RealmGBean.GBEAN_INFO);
         realm.setAttribute("className",
                 "org.apache.geronimo.tomcat.realm.TomcatJAASRealm");
@@ -367,6 +363,7 @@
 
     protected void tearDown() throws Exception {
         kernel.shutdown();
+        super.tearDown();
     }
 
     public static class MockConfigStore implements ConfigurationStore {
@@ -406,7 +403,6 @@
             } else {
                 Environment environment = new Environment();
                 environment.setConfigId(configId);
-                environment.getProperties().put(NameFactory.JSR77_BASE_NAME_PROPERTY, "geronimo.test:J2EEServer=geronimo");
                 configData.setAttribute("environment", environment);
                 configData.setAttribute("moduleType", ConfigurationModuleType.WAR);
                 configData.setAttribute("gBeanState", NO_OBJECTS_OS);

Modified: geronimo/branches/1.1/plugins/geronimo-deployment-plugin/src/java/org/apache/geronimo/deployment/mavenplugin/WaitForStarted.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/plugins/geronimo-deployment-plugin/src/java/org/apache/geronimo/deployment/mavenplugin/WaitForStarted.java?rev=389907&r1=389906&r2=389907&view=diff
==============================================================================
--- geronimo/branches/1.1/plugins/geronimo-deployment-plugin/src/java/org/apache/geronimo/deployment/mavenplugin/WaitForStarted.java
(original)
+++ geronimo/branches/1.1/plugins/geronimo-deployment-plugin/src/java/org/apache/geronimo/deployment/mavenplugin/WaitForStarted.java
Wed Mar 29 14:16:54 2006
@@ -16,29 +16,25 @@
  */
 package org.apache.geronimo.deployment.mavenplugin;
 
-import org.apache.geronimo.kernel.GBeanNotFoundException;
-import org.apache.geronimo.kernel.InternalKernelException;
-import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.kernel.config.Configuration;
-import org.apache.geronimo.kernel.jmx.KernelDelegate;
-import org.apache.geronimo.kernel.management.State;
-
+import java.util.HashMap;
+import java.util.Map;
 import javax.management.MBeanServerConnection;
-import javax.management.ObjectName;
 import javax.management.remote.JMXConnector;
 import javax.management.remote.JMXConnectorFactory;
 import javax.management.remote.JMXServiceURL;
-import java.net.URI;
-import java.util.HashMap;
-import java.util.Map;
+
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.kernel.InternalKernelException;
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.config.Configuration;
+import org.apache.geronimo.kernel.jmx.KernelDelegate;
+import org.apache.geronimo.kernel.repository.Artifact;
 
 public class WaitForStarted extends AbstractModuleCommand {
 
     private int maxTries = 40;
     private int retryIntervalMilliseconds = 1000;
 
-    private MBeanServerConnection mbServerConnection;
-    private Kernel kernel;
     private String id;
 
     public String getId() {
@@ -69,12 +65,14 @@
 
         JMXServiceURL address = new JMXServiceURL("service:" + uri);
         ClassLoader oldcl = Thread.currentThread().getContextClassLoader();
+
+        Kernel kernel;
         try {
             Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
             for (int tries = maxTries; true; tries--) {
                 try {
                     JMXConnector jmxConnector = JMXConnectorFactory.connect(address, environment);
-                    mbServerConnection = jmxConnector.getMBeanServerConnection();
+                    MBeanServerConnection mbServerConnection = jmxConnector.getMBeanServerConnection();
                     kernel = new KernelDelegate(mbServerConnection);
                     break;
                 } catch (Exception e) {
@@ -87,16 +85,13 @@
         } finally {
             Thread.currentThread().setContextClassLoader(oldcl);
         }
-        ObjectName configName = Configuration.getConfigurationObjectName(new URI(getId()));
+        AbstractName configName = Configuration.getConfigurationAbstractName(Artifact.create(getId()));
         for (int tries = maxTries; tries > 0; tries--) {
             try {
-                int state = kernel.getGBeanState(configName);
-                if (state == State.RUNNING_INDEX) {
+                if (kernel.isRunning(configName)) {
                     return;
                 }
             } catch (InternalKernelException e) {
-                //hasn't been loaded yet, keep trying
-            } catch (GBeanNotFoundException e) {
                 //hasn't been loaded yet, keep trying
             }
             Thread.sleep(retryIntervalMilliseconds);

Modified: geronimo/branches/1.1/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PlanProcessor.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PlanProcessor.java?rev=389907&r1=389906&r2=389907&view=diff
==============================================================================
--- geronimo/branches/1.1/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PlanProcessor.java
(original)
+++ geronimo/branches/1.1/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PlanProcessor.java
Wed Mar 29 14:16:54 2006
@@ -42,7 +42,7 @@
 import java.util.List;
 
 /**
- * @version $Rev$ $Date$
+ * @version $Rev: 384686 $ $Date$
  */
 public class PlanProcessor {
     private static Log log = LogFactory.getLog(PlanProcessor.class);
@@ -164,7 +164,7 @@
                 xmlCursor.toFirstChild();
                 QName childName = xmlCursor.getName();
                 Environment oldEnvironment = null;
-                if (childName.equals(ENVIRONMENT_QNAME)) {
+                if (childName != null && childName.equals(ENVIRONMENT_QNAME)) {
                     XmlObject xmlObject = xmlCursor.getObject();
                     EnvironmentType environmentType = (EnvironmentType) xmlObject.copy().changeType(EnvironmentType.type);
                     oldEnvironment = EnvironmentBuilder.buildEnvironment(environmentType);



Mime
View raw message