geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r526373 - in /geronimo/server/trunk/modules: geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ geronimo-system/src/main/java/org/apache/geronimo/system/main/
Date Sat, 07 Apr 2007 06:29:53 GMT
Author: djencks
Date: Fri Apr  6 23:29:52 2007
New Revision: 526373

URL: http://svn.apache.org/viewvc?view=rev&rev=526373
Log:
GERONIMO-3071 log the configurations the app client starts using the monitor designed for
the purpose

Added:
    geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/DebugLoggingLifecycleMonitor.java
  (with props)
Modified:
    geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java
    geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/CommandLine.java

Modified: geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java?view=diff&rev=526373&r1=526372&r2=526373
==============================================================================
--- geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java
(original)
+++ geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java
Fri Apr  6 23:29:52 2007
@@ -345,6 +345,7 @@
     }
 
     static void preprocessGBeanData(AbstractName configurationName, Configuration configuration,
GBeanData gbeanData) throws InvalidConfigException {
+        log.info("resolving dependencies for " + gbeanData.getAbstractName());
         for (Iterator references = gbeanData.getReferencesNames().iterator(); references.hasNext();)
{
             String referenceName = (String) references.next();
             GReferenceInfo referenceInfo = gbeanData.getGBeanInfo().getReference(referenceName);
@@ -357,6 +358,7 @@
                 AbstractName abstractName;
                 try {
                     abstractName = configuration.findGBean(referencePatterns);
+                    log.info("referencePatterns: " + referencePatterns + " resolved to "
+ abstractName);
                 } catch (GBeanNotFoundException e) {
                     throw new InvalidConfigException("Unable to resolve reference \"" + referenceName
+ "\" in gbean " + gbeanData.getAbstractName() + " to a gbean matching the pattern " + referencePatterns,
e);
                 }
@@ -370,6 +372,7 @@
             AbstractName abstractName;
             try {
                 abstractName = configuration.findGBean(referencePatterns);
+                log.info("referencePatterns: " + referencePatterns + " resolved to " + abstractName);
             } catch (GBeanNotFoundException e) {
                 throw new InvalidConfigException("Unable to resolve dependency in gbean "
+ gbeanData.getAbstractName(), e);
             }

Added: geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/DebugLoggingLifecycleMonitor.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/DebugLoggingLifecycleMonitor.java?view=auto&rev=526373
==============================================================================
--- geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/DebugLoggingLifecycleMonitor.java
(added)
+++ geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/DebugLoggingLifecycleMonitor.java
Fri Apr  6 23:29:52 2007
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+package org.apache.geronimo.kernel.config;
+
+import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.commons.logging.Log;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class DebugLoggingLifecycleMonitor implements LifecycleMonitor {
+    private final Log log;
+
+
+    public DebugLoggingLifecycleMonitor(Log log) {
+        this.log = log;
+    }
+
+    public void addConfiguration(Artifact configurationId) {
+        log.debug("added module: " + configurationId);
+    }
+
+    public void reading(Artifact configurationId) {
+        log.debug("reading module: " + configurationId);
+    }
+
+    public void loading(Artifact configurationId) {
+        log.debug("loading module: " + configurationId);
+    }
+
+    public void starting(Artifact configurationId) {
+        log.debug("starting module: " + configurationId);
+    }
+
+    public void stopping(Artifact configurationId) {
+        log.debug("stopping module: " + configurationId);
+    }
+
+    public void unloading(Artifact configurationId) {
+        log.debug("unloading module: " + configurationId);
+    }
+
+    public void succeeded(Artifact configurationId) {
+        log.debug("succeeded module: " + configurationId);
+    }
+
+    public void failed(Artifact configurationId, Throwable cause) {
+        log.debug("failed module: " + configurationId);
+    }
+
+    public void finished() {
+        log.debug("Lifecycle finished");
+    }
+}

Propchange: geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/DebugLoggingLifecycleMonitor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/DebugLoggingLifecycleMonitor.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/DebugLoggingLifecycleMonitor.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/CommandLine.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/CommandLine.java?view=diff&rev=526373&r1=526372&r2=526373
==============================================================================
--- geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/CommandLine.java
(original)
+++ geronimo/server/trunk/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/CommandLine.java
Fri Apr  6 23:29:52 2007
@@ -40,6 +40,8 @@
 import org.apache.geronimo.kernel.config.ConfigurationUtil;
 import org.apache.geronimo.kernel.config.LifecycleException;
 import org.apache.geronimo.kernel.config.NoSuchConfigException;
+import org.apache.geronimo.kernel.config.LifecycleMonitor;
+import org.apache.geronimo.kernel.config.DebugLoggingLifecycleMonitor;
 import org.apache.geronimo.kernel.log.GeronimoLogging;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.repository.MissingDependencyException;
@@ -178,12 +180,12 @@
     protected void loadConfigurations(List configurations) throws NoSuchConfigException,
LifecycleException, MissingDependencyException {
         // load and start the configurations
         ConfigurationManager configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
-        Collection resolvedConfigurations = configurationManager.getArtifactResolver().resolveInClassLoader(configurations);
+        Collection<Artifact> resolvedModules = configurationManager.getArtifactResolver().resolveInClassLoader(configurations);
+        LifecycleMonitor lifecycleMonitor = new DebugLoggingLifecycleMonitor(log);
         try {
-            for (Iterator i = resolvedConfigurations.iterator(); i.hasNext();) {
-                Artifact configID = (Artifact) i.next();
-                configurationManager.loadConfiguration(configID);
-                configurationManager.startConfiguration(configID);
+            for (Artifact moduleId : resolvedModules) {
+                configurationManager.loadConfiguration(moduleId, lifecycleMonitor);
+                configurationManager.startConfiguration(moduleId, lifecycleMonitor);
             }
         } finally {
             ConfigurationUtil.releaseConfigurationManager(kernel, configurationManager);



Mime
View raw message