Author: sgoeschl Date: Sat Dec 10 06:13:56 2005 New Revision: 355747 URL: http://svn.apache.org/viewcvs?rev=355747&view=rev Log: Using Avalon framework 4.3 to directly create a Avalon logger based on commons-logging
Modified: jakarta/turbine/core/trunk/project.xml jakarta/turbine/core/trunk/src/java/org/apache/turbine/services/avaloncomponent/TurbineYaafiComponentService.java jakarta/turbine/core/trunk/src/test/org/apache/turbine/services/avaloncomponent/TurbineAvalonComponentServiceTest.java jakarta/turbine/core/trunk/xdocs/changes.xml Modified: jakarta/turbine/core/trunk/project.xml URL: http://svn.apache.org/viewcvs/jakarta/turbine/core/trunk/project.xml?rev=355747&r1=355746&r2=355747&view=diff ============================================================================== --- jakarta/turbine/core/trunk/project.xml (original) +++ jakarta/turbine/core/trunk/project.xml Sat Dec 10 06:13:56 2005 @@ -1,14 +1,14 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- +<!-- /* * Copyright 2001-2004 The Apache Software Foundation. - * + * * Licensed 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. @@ -216,7 +216,7 @@ <contributor> <name>Brad Folkens</name> <email>[EMAIL PROTECTED]</email> - </contributor> + </contributor> <contributor> <name>Jian He</name> <email>[EMAIL PROTECTED]</email> @@ -304,7 +304,7 @@ <contributor> <name>Sam Solon</name> <email>[EMAIL PROTECTED]</email> - </contributor> + </contributor> <contributor> <name>Costas Stergiou</name> <email>[EMAIL PROTECTED]</email> @@ -340,13 +340,13 @@ </contributors> <dependencies> - + <!-- Start of ECM dependencies --> <dependency> <id>logkit</id> <version>1.2</version> <url>http://jakarta.apache.org/avalon/logkit/</url> - </dependency> + </dependency> <dependency> <id>excalibur-component</id> <version>1.1</version> @@ -366,9 +366,9 @@ <id>excalibur-pool</id> <version>1.2</version> <url>http://jakarta.apache.org/avalon/</url> - </dependency> + </dependency> <!-- End of ECM dependencies --> - + <!-- Start of YAAFI dependencies --> <dependency> <groupId>fulcrum</groupId> @@ -378,19 +378,19 @@ <properties> <war.bundle.jar>true</war.bundle.jar> </properties> - </dependency> + </dependency> <!-- End of YAAFI dependencies --> - + <dependency> <groupId>activation</groupId> <artifactId>activation</artifactId> <version>1.0.2</version> <url>http://java.sun.com/products/javabeans/glasgow/jaf.html</url> - </dependency> + </dependency> <dependency> <groupId>avalon-framework</groupId> <artifactId>avalon-framework-api</artifactId> - <version>4.2.0</version> + <version>4.3</version> <url>http://avalon.apache.org/framework/</url> <properties> <war.bundle>true</war.bundle> @@ -399,12 +399,12 @@ <dependency> <groupId>avalon-framework</groupId> <artifactId>avalon-framework-impl</artifactId> - <version>4.2.0</version> + <version>4.3</version> <url>http://avalon.apache.org/framework/</url> <properties> <war.bundle>true</war.bundle> </properties> - </dependency> + </dependency> <dependency> <id>commons-beanutils</id> <version>1.6.1</version> @@ -438,7 +438,7 @@ <id>commons-fileupload</id> <version>1.0</version> <url>http://jakarta.apache.org/commons/fileupload/</url> - </dependency> + </dependency> <dependency> <id>commons-lang</id> <version>2.0</version> @@ -477,7 +477,7 @@ <properties> <war.bundle.jar>true</war.bundle.jar> </properties> - </dependency> + </dependency> <dependency> <groupId>fulcrum</groupId> <artifactId>fulcrum-crypto</artifactId> @@ -495,7 +495,7 @@ <properties> <war.bundle.jar>true</war.bundle.jar> </properties> - </dependency> + </dependency> <dependency> <groupId>fulcrum</groupId> <artifactId>fulcrum-intake</artifactId> @@ -504,7 +504,7 @@ <properties> <war.bundle.jar>true</war.bundle.jar> </properties> - </dependency> + </dependency> <dependency> <groupId>fulcrum</groupId> <artifactId>fulcrum-factory</artifactId> @@ -513,7 +513,7 @@ <properties> <war.bundle.jar>true</war.bundle.jar> </properties> - </dependency> + </dependency> <dependency> <groupId>fulcrum</groupId> <artifactId>fulcrum-pool</artifactId> @@ -522,7 +522,7 @@ <properties> <war.bundle.jar>true</war.bundle.jar> </properties> - </dependency> + </dependency> <dependency> <groupId>fulcrum</groupId> <artifactId>fulcrum-mimetype</artifactId> @@ -531,7 +531,7 @@ <properties> <war.bundle.jar>true</war.bundle.jar> </properties> - </dependency> + </dependency> <dependency> <groupId>fulcrum</groupId> <artifactId>fulcrum-parser</artifactId> @@ -540,7 +540,7 @@ <properties> <war.bundle.jar>true</war.bundle.jar> </properties> - </dependency> + </dependency> <dependency> <groupId>fulcrum</groupId> <artifactId>fulcrum-upload</artifactId> @@ -549,8 +549,8 @@ <properties> <war.bundle.jar>true</war.bundle.jar> </properties> - </dependency> - + </dependency> + <dependency> <id>javamail</id> <version>1.3.1</version> @@ -641,18 +641,18 @@ <artifactId>xstream</artifactId> <version>1.0.2</version> <url>http://xstream.codehaus.org/</url> - </dependency> - + </dependency> + <dependency> <groupId>mockobjects</groupId> <artifactId>mockobjects-jdk1.4-j2ee1.3</artifactId> <version>0.09</version> - </dependency> + </dependency> <dependency> <groupId>mockobjects</groupId> <artifactId>mockobjects-core</artifactId> <version>0.09</version> - </dependency> + </dependency> </dependencies> <build> @@ -667,8 +667,8 @@ </unitTest> </build> - <reports> - <report>maven-jdepend-plugin</report> + <reports> + <report>maven-jdepend-plugin</report> <report>maven-checkstyle-plugin</report> <report>maven-changes-plugin</report> <report>maven-changelog-plugin</report> @@ -685,7 +685,7 @@ <report>maven-linkcheck-plugin</report> --> <report>maven-tasklist-plugin</report> - + </reports> Modified: jakarta/turbine/core/trunk/src/java/org/apache/turbine/services/avaloncomponent/TurbineYaafiComponentService.java URL: http://svn.apache.org/viewcvs/jakarta/turbine/core/trunk/src/java/org/apache/turbine/services/avaloncomponent/TurbineYaafiComponentService.java?rev=355747&r1=355746&r2=355747&view=diff ============================================================================== --- jakarta/turbine/core/trunk/src/java/org/apache/turbine/services/avaloncomponent/TurbineYaafiComponentService.java (original) +++ jakarta/turbine/core/trunk/src/java/org/apache/turbine/services/avaloncomponent/TurbineYaafiComponentService.java Sat Dec 10 06:13:56 2005 @@ -21,11 +21,8 @@ import org.apache.avalon.framework.activity.Disposable; import org.apache.avalon.framework.activity.Initializable; -import org.apache.avalon.framework.logger.ConsoleLogger; -import org.apache.avalon.framework.logger.Jdk14Logger; -import org.apache.avalon.framework.logger.Log4JLogger; +import org.apache.avalon.framework.logger.CommonsLogger; import org.apache.avalon.framework.logger.Logger; -import org.apache.avalon.framework.logger.NullLogger; import org.apache.avalon.framework.service.ServiceException; import org.apache.commons.configuration.Configuration; import org.apache.commons.logging.Log; @@ -265,33 +262,7 @@ */ protected Logger createAvalonLogger() { - Logger result = null; - - if( log instanceof org.apache.commons.logging.impl.Log4JLogger ) - { - log.debug("Using an Avalon Log4JLogger"); - result = new Log4JLogger( - ((org.apache.commons.logging.impl.Log4JLogger) log).getLogger() - ); - } - else if( log instanceof org.apache.commons.logging.impl.Jdk14Logger ) - { - log.debug("Using an Avalon Jdk14Logger"); - result = new Jdk14Logger( - ((org.apache.commons.logging.impl.Jdk14Logger) log).getLogger() - ); - } - else if( log instanceof org.apache.commons.logging.impl.NoOpLog ) - { - log.debug("Using an Avalon NullLogger"); - result = new NullLogger(); - } - else - { - log.debug("Using an Avalon ConsoleLogger"); - result = new ConsoleLogger(); - } - + Logger result = new CommonsLogger(log, AVALON_LOG_CATEGORY); return result; } Modified: jakarta/turbine/core/trunk/src/test/org/apache/turbine/services/avaloncomponent/TurbineAvalonComponentServiceTest.java URL: http://svn.apache.org/viewcvs/jakarta/turbine/core/trunk/src/test/org/apache/turbine/services/avaloncomponent/TurbineAvalonComponentServiceTest.java?rev=355747&r1=355746&r2=355747&view=diff ============================================================================== --- jakarta/turbine/core/trunk/src/test/org/apache/turbine/services/avaloncomponent/TurbineAvalonComponentServiceTest.java (original) +++ jakarta/turbine/core/trunk/src/test/org/apache/turbine/services/avaloncomponent/TurbineAvalonComponentServiceTest.java Sat Dec 10 06:13:56 2005 @@ -54,9 +54,11 @@ serviceManager.setApplicationRoot("."); Configuration cfg = new BaseConfiguration(); - cfg.setProperty(PREFIX + "classname", - TurbineAvalonComponentService.class.getName()); - + + // decide here wether to start ECM or YAAFI + // cfg.setProperty(PREFIX + "classname", TurbineAvalonComponentService.class.getName()); + cfg.setProperty(PREFIX + "classname", TurbineYaafiComponentService.class.getName()); + // we want to configure the service to load test TEST configuration files cfg.setProperty(PREFIX + "componentConfiguration", "src/test/componentConfiguration.xml"); Modified: jakarta/turbine/core/trunk/xdocs/changes.xml URL: http://svn.apache.org/viewcvs/jakarta/turbine/core/trunk/xdocs/changes.xml?rev=355747&r1=355746&r2=355747&view=diff ============================================================================== --- jakarta/turbine/core/trunk/xdocs/changes.xml (original) +++ jakarta/turbine/core/trunk/xdocs/changes.xml Sat Dec 10 06:13:56 2005 @@ -1,14 +1,14 @@ <?xml version="1.0"?> -<!-- +<!-- /* * Copyright 2001-2004 The Apache Software Foundation. - * + * * Licensed 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. @@ -24,6 +24,9 @@ <body> <release version="2.4-M2" date="in cvs"> + <action dev="sgoeschl" type="update"> + The avalon-framework-4.3 allows to create an Avalon logger based on a commons logger. + </action> <action dev="seade" type="fix"> BrowserDetector was throwing a NPE for recent versions of Opera - this has been fixed. @@ -63,7 +66,7 @@ </action> <action dev="epugh" type="update"> Use RELEASED versions of Fulcrum components! - </action> + </action> <action dev="epugh" type="remove"> Remove old security services based on couple Torque. </action> @@ -87,16 +90,16 @@ of RunData from the process. </action> <action dev="" type="update">Removed dependency on deprecated Log4jFactory in favor of Log4jLogger.</action> -<action dev="" type="add">Replaced existing Maven plugin with Hennings' META: Maven Environment for +<action dev="" type="add">Replaced existing Maven plugin with Hennings' META: Maven Environment for Turbine Applications plugin.</action> -<action dev="epugh" type="update">Updated to use Stratum b5 which properly supports the upcoming 1.0 release of - Commons Configuration. Also removed uses of getVector which has been removed +<action dev="epugh" type="update">Updated to use Stratum b5 which properly supports the upcoming 1.0 release of + Commons Configuration. Also removed uses of getVector which has been removed from the Configuration API.</action> <action dev="epugh" type="add"> Backported the Pipeline from Turbine 3 to Turbine 2.4. The pipeline allows you to define via an XML file all the stages for processing a request. This makes it simple to add your own custom steps to be applied to each HTTP - request coming into Turbine. You will need to add the pipeline.xml file. - Added methods to many classes to allow the use of PipelineData as an + request coming into Turbine. You will need to add the pipeline.xml file. + Added methods to many classes to allow the use of PipelineData as an alternative to RunData. Added new PipelineDataApplicationTool interface for tools which use PipelineData instead of RunData.</action> <action dev="epugh" type="update">Maven Plugin for Turbine moved to /extensions directory. The torque @@ -122,7 +125,7 @@ <action dev="epugh" type="update">The localization service within Turbine has been deprecated in favor of the Fulcrum Localization service. The localization pull tool has been updated to reflect this.</action> -<action dev="" type="fix">Fixed problem in Intake with the "remove" method in IntakeTool that is +<action dev="" type="fix">Fixed problem in Intake with the "remove" method in IntakeTool that is triggered by a "removeAll".</action> <action dev="" type="fix">When there is more than one instance of a group and a "removeAll" is done the "remove" method is called for each of the instances of the @@ -131,48 +134,48 @@ returns null, which is not being handled in the code.</action> <action dev="" type="fix"> Intake now handles multiValued="true" on type="int" fields correctly. The get/set methods of the underlying object need to deal with an array - of ints. The intake processing for other primitive types has also been + of ints. The intake processing for other primitive types has also been updated, though not tested to the same extent as int.</action> <action dev="" type="fix">HttpUtils.httpDateFormat had the year set as 'yyyyy', should be 'yyyy' therefore setting expiry dates failed.</action> <action dev="epugh" type="fix"> doXXX events would eat exceptions while doPerform would bubble them up. Added property action.event.bubbleexception which is true by default that applies to both types and either bubbles them up, or logs and sinks them.</action> -<action dev="" type="fix">The intake validators were fixed so that fields with required=false +<action dev="" type="fix">The intake validators were fixed so that fields with required=false rules no longer attempt to execute the remaining rules when no input is provided. A minLength > 0 rule is no longer synonymous with required=true.</action> -<action dev="" type="fix">Actions triggered from html input elements with type="button" are +<action dev="" type="fix">Actions triggered from html input elements with type="button" are now processed correctly (the trailing ".x" and ".y" are removed from the event names).</action> -<action dev="" type="fix"> Intake was fixed so that fields with required elements with value=false - can later be enabled with field.setRequired(true) (i.e. you should +<action dev="" type="fix"> Intake was fixed so that fields with required elements with value=false + can later be enabled with field.setRequired(true) (i.e. you should do this rather than using the deprecated required-message element).</action> -<action dev="" type="fix">Intake was fixed so that DateString will use the "formatn" (where n - >= 1) rules to parse the input and then the "format" rule to format +<action dev="" type="fix">Intake was fixed so that DateString will use the "formatn" (where n + >= 1) rules to parse the input and then the "format" rule to format it (the "format" rule is also used to parse the date if there are no - "formatn" rules or they are not able to parse it). In order to + "formatn" rules or they are not able to parse it). In order to retrieve the correctly formatted DateString value you need to use - <em>$group.foo.StringValue</em> rather than <em>$group.foo.Value</em> + <em>$group.foo.StringValue</em> rather than <em>$group.foo.Value</em> (you can do this for all values, not just DateString).</action> -<action dev="" type="fix">Intake now makes use of the the emptyValue attribute from the field - elements when mapping from the group to the object when no value has +<action dev="" type="fix">Intake now makes use of the the emptyValue attribute from the field + elements when mapping from the group to the object when no value has been set. This makes it possible to clear values in an existing object - that is being overwritten with Intake data using + that is being overwritten with Intake data using <em>group.setProperties(obj)</em> (or you can provide non-null values - in your intake.xml file). Make sure you do not inadvertently include - the primary key for the object in the intake group without actually - setting it to the appropriate value (it shouldn't be in the group + in your intake.xml file). Make sure you do not inadvertently include + the primary key for the object in the intake group without actually + setting it to the appropriate value (it shouldn't be in the group anyway).</action> <action dev="" type="fix">Fixed the intake DateString flexible rule so that it applies to the - format rules and not just to the default locale format.</action> + format rules and not just to the default locale format.</action> <action dev="" type="fix"> DateFormatter now allows for a differnet date format to be provided - via <em>tool.dateTool.format</em> in TurbineResources.properties.</action> -<action dev="" type="fix">DirectResponseLayout is provided to allow direct writing to + via <em>tool.dateTool.format</em> in TurbineResources.properties.</action> +<action dev="" type="fix">DirectResponseLayout is provided to allow direct writing to ServletOutputStream when VelocityOnlyLayout is the default. To use it - you need to add <em>data.declareDirectResponse();</em> and then + you need to add <em>data.declareDirectResponse();</em> and then <em>data.setLayout("DirectResponseLayout");</em> to your action class. - Thanks to Peter Courcoux for the code.</action> + Thanks to Peter Courcoux for the code.</action> </release> <release version="PRE 2.4" description="Older Changes Logs"> <action>Please see <a href="changes-pre24.html">Pre 2.4 Changelog</a></action> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]