Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 63145 invoked from network); 29 Oct 2006 02:05:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 29 Oct 2006 02:05:17 -0000 Received: (qmail 99231 invoked by uid 500); 29 Oct 2006 02:05:28 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 99088 invoked by uid 500); 29 Oct 2006 02:05:28 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 99076 invoked by uid 99); 29 Oct 2006 02:05:28 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 28 Oct 2006 19:05:28 -0700 X-ASF-Spam-Status: No, hits=0.6 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 28 Oct 2006 19:05:15 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 9C4391A9846; Sat, 28 Oct 2006 19:04:53 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r468818 - in /geronimo/gbuild/trunk: ./ gbuild-agent-assembly/ gbuild-agent-assembly/src/main/config/manager/ gbuild-agent-assembly/src/main/config/slave/ gbuild-agent/ gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/logging/ gb... Date: Sun, 29 Oct 2006 02:04:53 -0000 To: scm@geronimo.apache.org From: jdillon@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061029020453.9C4391A9846@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jdillon Date: Sat Oct 28 19:04:52 2006 New Revision: 468818 URL: http://svn.apache.org/viewvc?view=rev&rev=468818 Log: Using ${version} instead of ${pom.version} Adding custom plexus log4j log manager impls, looks like the version that is deployed has some problems with latest log4j jars Drop the distributed build config Added: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/logging/ geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/logging/Log4jLogger.java (with props) geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/logging/Log4jLoggerManager.java (with props) Modified: geronimo/gbuild/trunk/gbuild-agent-assembly/pom.xml geronimo/gbuild/trunk/gbuild-agent-assembly/src/main/config/manager/application.xml geronimo/gbuild/trunk/gbuild-agent-assembly/src/main/config/slave/application.xml geronimo/gbuild/trunk/gbuild-agent/pom.xml geronimo/gbuild/trunk/gbuild-agent/src/main/resources/META-INF/plexus/components.xml geronimo/gbuild/trunk/gbuild-extensions/gbuild-requeue-extensions/pom.xml geronimo/gbuild/trunk/gbuild-extensions/gbuild-standard-extensions/pom.xml geronimo/gbuild/trunk/gbuild-extensions/pom.xml geronimo/gbuild/trunk/pom.xml Modified: geronimo/gbuild/trunk/gbuild-agent-assembly/pom.xml URL: http://svn.apache.org/viewvc/geronimo/gbuild/trunk/gbuild-agent-assembly/pom.xml?view=diff&rev=468818&r1=468817&r2=468818 ============================================================================== --- geronimo/gbuild/trunk/gbuild-agent-assembly/pom.xml (original) +++ geronimo/gbuild/trunk/gbuild-agent-assembly/pom.xml Sat Oct 28 19:04:52 2006 @@ -39,31 +39,31 @@ org.apache.geronimo.gbuild gbuild-agent - ${pom.version} + ${version} org.apache.geronimo.gbuild.extension gbuild-standard-extensions - ${pom.version} + ${version} org.apache.geronimo.gbuild.extension gbuild-activity-extensions - ${pom.version} + ${version} org.apache.geronimo.gbuild.extension gbuild-requeue-extensions - ${pom.version} + ${version} org.apache.geronimo.gbuild gbuild-commands - ${pom.version} + ${version} @@ -96,15 +96,6 @@ log4j log4j - - - - - org.codehaus.plexus - plexus-log4j-logging - 1.1-alpha-2 - - Modified: geronimo/gbuild/trunk/gbuild-agent-assembly/src/main/config/manager/application.xml URL: http://svn.apache.org/viewvc/geronimo/gbuild/trunk/gbuild-agent-assembly/src/main/config/manager/application.xml?view=diff&rev=468818&r1=468817&r2=468818 ============================================================================== --- geronimo/gbuild/trunk/gbuild-agent-assembly/src/main/config/manager/application.xml (original) +++ geronimo/gbuild/trunk/gbuild-agent-assembly/src/main/config/manager/application.xml Sat Oct 28 19:04:52 2006 @@ -57,7 +57,7 @@ org.codehaus.plexus.logging.LoggerManager - org.codehaus.plexus.logging.log4j.ExternalLog4JLoggerManager + org.apache.geronimo.gbuild.agent.logging.Log4jLoggerManager Modified: geronimo/gbuild/trunk/gbuild-agent-assembly/src/main/config/slave/application.xml URL: http://svn.apache.org/viewvc/geronimo/gbuild/trunk/gbuild-agent-assembly/src/main/config/slave/application.xml?view=diff&rev=468818&r1=468817&r2=468818 ============================================================================== --- geronimo/gbuild/trunk/gbuild-agent-assembly/src/main/config/slave/application.xml (original) +++ geronimo/gbuild/trunk/gbuild-agent-assembly/src/main/config/slave/application.xml Sat Oct 28 19:04:52 2006 @@ -37,7 +37,7 @@ org.codehaus.plexus.logging.LoggerManager - org.codehaus.plexus.logging.log4j.ExternalLog4JLoggerManager + org.apache.geronimo.gbuild.agent.logging.Log4jLoggerManager Modified: geronimo/gbuild/trunk/gbuild-agent/pom.xml URL: http://svn.apache.org/viewvc/geronimo/gbuild/trunk/gbuild-agent/pom.xml?view=diff&rev=468818&r1=468817&r2=468818 ============================================================================== --- geronimo/gbuild/trunk/gbuild-agent/pom.xml (original) +++ geronimo/gbuild/trunk/gbuild-agent/pom.xml Sat Oct 28 19:04:52 2006 @@ -71,6 +71,11 @@ org.codehaus.swizzle swizzle-stream + + + log4j + log4j + Added: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/logging/Log4jLogger.java URL: http://svn.apache.org/viewvc/geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/logging/Log4jLogger.java?view=auto&rev=468818 ============================================================================== --- geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/logging/Log4jLogger.java (added) +++ geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/logging/Log4jLogger.java Sat Oct 28 19:04:52 2006 @@ -0,0 +1,106 @@ +/* + * 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.gbuild.agent.logging; + +import org.codehaus.plexus.logging.AbstractLogger; + +import org.apache.log4j.Logger; + +// +// NOTE: Duplicated from plexus-logging/plexus-log4j-logging to avoid certain MNFE errors +// due to the plexus version be compiled against an incompatible Log4j. +// + +/** + * Logger which delgates to logger from Log4j framwork. + * + * @version $Rev$ $Date$ + */ +public class Log4jLogger + extends AbstractLogger +{ + private Logger logger; + + public Log4jLogger(int threshold, Logger logger) { + super(threshold, getLoggerName(logger)); + + if (null == logger) { + throw new IllegalArgumentException("Logger cannot be null"); + } + + this.logger = logger; + } + + public void debug(String message) { + logger.debug(message); + } + + public void debug(String message, Throwable throwable) { + logger.debug(message, throwable); + } + + public void info(String message) { + logger.info(message); + } + + public void info(String message, Throwable throwable) { + logger.info(message, throwable); + } + + public void warn(String message) { + logger.warn(message); + } + + public void warn(String message, Throwable throwable) { + logger.warn(message, throwable); + } + + public void error(String message) { + logger.error(message); + } + + public void error(String message, Throwable throwable) { + logger.error(message, throwable); + } + + public void fatalError(String message) { + logger.fatal(message); + } + + public void fatalError(String message, Throwable throwable) { + logger.fatal(message, throwable); + } + + public String getName() { + return logger.getName(); + } + + public org.codehaus.plexus.logging.Logger getChildLogger(String name) { + return new Log4jLogger(getThreshold(), Logger.getLogger(logger.getName() + "." + name)); + } + + private static String getLoggerName(Logger logger) { + if (logger == null) { + return ""; + } + + return logger.getName(); + } +} \ No newline at end of file Propchange: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/logging/Log4jLogger.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/logging/Log4jLogger.java ------------------------------------------------------------------------------ svn:keywords = Date Author Id Revision HeadURL Propchange: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/logging/Log4jLogger.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/logging/Log4jLoggerManager.java URL: http://svn.apache.org/viewvc/geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/logging/Log4jLoggerManager.java?view=auto&rev=468818 ============================================================================== --- geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/logging/Log4jLoggerManager.java (added) +++ geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/logging/Log4jLoggerManager.java Sat Oct 28 19:04:52 2006 @@ -0,0 +1,178 @@ +/* + * 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.gbuild.agent.logging; + +import java.util.HashMap; +import java.util.Map; + +import org.codehaus.plexus.logging.AbstractLogger; +import org.codehaus.plexus.logging.AbstractLoggerManager; +import org.codehaus.plexus.logging.Logger; +import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable; + +// +// NOTE: Duplicated from plexus-logging/plexus-log4j-logging to avoid certain MNFE errors +// due to the plexus version be compiled against an incompatible Log4j. +// + +/** + * Base class for all LoggerManagers which use cache of Loggers. + * + * @version $Rev$ $Date$ + */ +public class Log4jLoggerManager + extends AbstractLoggerManager + implements Initializable +{ + private Map loggerCache = new HashMap(); + + private String threshold = "info"; + + private int currentThreshold; + + public void initialize() { + currentThreshold = parseThreshold(threshold); + + if (currentThreshold == -1) { + currentThreshold = Logger.LEVEL_DEBUG; + } + } + + protected int parseThreshold(String text) { + text = text.trim().toLowerCase(); + + if (text.equals("debug")) { + return Logger.LEVEL_DEBUG; + } + else if (text.equals("info")) { + return Logger.LEVEL_INFO; + } + else if (text.equals("warn")) { + return Logger.LEVEL_WARN; + } + else if (text.equals("error")) { + return Logger.LEVEL_ERROR; + } + else if (text.equals("fatal")) { + return Logger.LEVEL_FATAL; + } + + return -1; + } + + /** + * Sets the threshold for all new loggers. It will NOT affect the existing loggers. + *

+ * This is usually only set once while the logger manager is configured. + * + * @param currentThreshold The new threshold. + */ + public void setThreshold(int currentThreshold) { + this.currentThreshold = currentThreshold; + } + + /** + * Returns the current threshold for all new loggers. + * + * @return Returns the current threshold for all new loggers. + */ + public int getThreshold() { + return currentThreshold; + } + + public void setThreshold(String role, String roleHint, int threshold) { + AbstractLogger logger; + + String key = toMapKey(role, roleHint); + + logger = (AbstractLogger) loggerCache.get(key); + + if (logger == null) { + return; // nothing to do + } + + logger.setThreshold(threshold); + } + + public int getThreshold(String role, String roleHint) { + AbstractLogger logger; + + String key = toMapKey(role, roleHint); + + logger = (AbstractLogger) loggerCache.get(key); + + if (logger == null) { + return Logger.LEVEL_DEBUG; // does not return null because that could create a NPE + } + + return logger.getThreshold(); + } + + public Logger getLoggerForComponent(String role, String roleHint) { + Logger logger; + + String key = toMapKey(role, roleHint); + + logger = (Logger) loggerCache.get(key); + + if (logger != null) { + return logger; + } + + logger = createLogger(key); + + loggerCache.put(key, logger); + + return logger; + } + + public void returnComponentLogger(String role, String roleHint) { + Object obj; + + String key = toMapKey(role, roleHint); + + obj = loggerCache.remove(key); + + if (obj == null) { + // TODO: use a logger! + System.err.println("There was no such logger '" + key + "' " + hashCode() + "."); + } + } + + public int getActiveLoggerCount() { + return loggerCache.size(); + } + + public Logger createLogger(String key) { + Logger logger = new Log4jLogger(getThreshold(), org.apache.log4j.Logger.getLogger(key)); + + return logger; + } + + public String getThresholdAsString() { + String retValue = threshold; + + if (retValue != null) { + retValue = retValue.toUpperCase(); + } + + return retValue; + } +} \ No newline at end of file Propchange: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/logging/Log4jLoggerManager.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/logging/Log4jLoggerManager.java ------------------------------------------------------------------------------ svn:keywords = Date Author Id Revision HeadURL Propchange: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/logging/Log4jLoggerManager.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: geronimo/gbuild/trunk/gbuild-agent/src/main/resources/META-INF/plexus/components.xml URL: http://svn.apache.org/viewvc/geronimo/gbuild/trunk/gbuild-agent/src/main/resources/META-INF/plexus/components.xml?view=diff&rev=468818&r1=468817&r2=468818 ============================================================================== --- geronimo/gbuild/trunk/gbuild-agent/src/main/resources/META-INF/plexus/components.xml (original) +++ geronimo/gbuild/trunk/gbuild-agent/src/main/resources/META-INF/plexus/components.xml Sat Oct 28 19:04:52 2006 @@ -61,27 +61,7 @@ agent/output - - - org.codehaus.plexus.action.Action - execute-builder - org.apache.geronimo.gbuild.agent.continuum.ExecuteDistributedBuilderContinuumAction - - - org.apache.maven.continuum.configuration.ConfigurationService - - - org.apache.maven.continuum.execution.manager.BuildExecutorManager - - - org.apache.maven.continuum.notification.ContinuumNotificationDispatcher - - - org.apache.maven.continuum.store.ContinuumStore - - - - + org.codehaus.plexus.component.factory.ComponentFactory org.apache.geronimo.gbuild.agent.continuum.ThreadContextContinuumStoreFactory Modified: geronimo/gbuild/trunk/gbuild-extensions/gbuild-requeue-extensions/pom.xml URL: http://svn.apache.org/viewvc/geronimo/gbuild/trunk/gbuild-extensions/gbuild-requeue-extensions/pom.xml?view=diff&rev=468818&r1=468817&r2=468818 ============================================================================== --- geronimo/gbuild/trunk/gbuild-extensions/gbuild-requeue-extensions/pom.xml (original) +++ geronimo/gbuild/trunk/gbuild-extensions/gbuild-requeue-extensions/pom.xml Sat Oct 28 19:04:52 2006 @@ -35,7 +35,7 @@ org.apache.geronimo.gbuild.extension gbuild-activity-extensions - ${pom.version} + ${version} Modified: geronimo/gbuild/trunk/gbuild-extensions/gbuild-standard-extensions/pom.xml URL: http://svn.apache.org/viewvc/geronimo/gbuild/trunk/gbuild-extensions/gbuild-standard-extensions/pom.xml?view=diff&rev=468818&r1=468817&r2=468818 ============================================================================== --- geronimo/gbuild/trunk/gbuild-extensions/gbuild-standard-extensions/pom.xml (original) +++ geronimo/gbuild/trunk/gbuild-extensions/gbuild-standard-extensions/pom.xml Sat Oct 28 19:04:52 2006 @@ -40,7 +40,7 @@ org.apache.geronimo.gbuild.extension gbuild-activity-extensions - ${pom.version} + ${version} Modified: geronimo/gbuild/trunk/gbuild-extensions/pom.xml URL: http://svn.apache.org/viewvc/geronimo/gbuild/trunk/gbuild-extensions/pom.xml?view=diff&rev=468818&r1=468817&r2=468818 ============================================================================== --- geronimo/gbuild/trunk/gbuild-extensions/pom.xml (original) +++ geronimo/gbuild/trunk/gbuild-extensions/pom.xml Sat Oct 28 19:04:52 2006 @@ -40,7 +40,7 @@ org.apache.geronimo.gbuild gbuild-agent - ${pom.version} + ${version} Modified: geronimo/gbuild/trunk/pom.xml URL: http://svn.apache.org/viewvc/geronimo/gbuild/trunk/pom.xml?view=diff&rev=468818&r1=468817&r2=468818 ============================================================================== --- geronimo/gbuild/trunk/pom.xml (original) +++ geronimo/gbuild/trunk/pom.xml Sat Oct 28 19:04:52 2006 @@ -53,7 +53,19 @@ 2005 - + + + + 1.0-SNAPSHOT + + dblevins