You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@excalibur.apache.org by le...@apache.org on 2004/07/30 09:55:04 UTC

svn commit: rev 30971 - in excalibur/trunk/containerkit/logger: . src/java/org/apache/avalon/excalibur/logger/factory

Author: leif
Date: Fri Jul 30 00:55:04 2004
New Revision: 30971

Modified:
   excalibur/trunk/containerkit/logger/project.xml
   excalibur/trunk/containerkit/logger/src/java/org/apache/avalon/excalibur/logger/factory/SMTPTargetFactory.java
Log:
Make it possible to specify a maximum period of time that log events can be held before they are sent.

Modified: excalibur/trunk/containerkit/logger/project.xml
==============================================================================
--- excalibur/trunk/containerkit/logger/project.xml	(original)
+++ excalibur/trunk/containerkit/logger/project.xml	Fri Jul 30 00:55:04 2004
@@ -40,7 +40,7 @@
         <dependency>
             <groupId>avalon-logkit</groupId>
             <artifactId>avalon-logkit</artifactId>
-            <version>2.0</version>
+            <version>2.0.1</version>
         </dependency>
 
         <dependency>

Modified: excalibur/trunk/containerkit/logger/src/java/org/apache/avalon/excalibur/logger/factory/SMTPTargetFactory.java
==============================================================================
--- excalibur/trunk/containerkit/logger/src/java/org/apache/avalon/excalibur/logger/factory/SMTPTargetFactory.java	(original)
+++ excalibur/trunk/containerkit/logger/src/java/org/apache/avalon/excalibur/logger/factory/SMTPTargetFactory.java	Fri Jul 30 00:55:04 2004
@@ -47,6 +47,7 @@
  *   &lt;from&gt;address@host&lt;/from&gt;
  *   &lt;subject&gt;subject line&lt;/subject&gt;
  *   &lt;maximum-size&gt;number&lt;/maximum-size&gt;
+ *   &lt;maximum-delay-time&gt;seconds&lt;/maximum-delay-time&gt;
  * &lt;/smtp&gt;
  * </pre>
  *
@@ -103,6 +104,7 @@
                 getFromAddress( config ),
                 getSubject( config ),
                 getMaxSize( config ),
+                getMaxDelayTime( config ),
                 getFormatter( config )
             );
         }
@@ -201,7 +203,20 @@
     private int getMaxSize( Configuration config )
         throws ConfigurationException
     {
-        return config.getChild( "maximum-size" ).getValueAsInteger();
+        return config.getChild( "maximum-size" ).getValueAsInteger( 1 );
+    }
+
+    /**
+     * Helper method to obtain the maximum delay time any particular SMTP
+     * message can be queued from a given configuration object.
+     *
+     * @param config a <code>Configuration</code> instance
+     * @return maximum SMTP mail delay time
+     */
+    private int getMaxDelayTime( Configuration config )
+        throws ConfigurationException
+    {
+        return config.getChild( "maximum-delay-time" ).getValueAsInteger( 0 );
     }
 
     /**

---------------------------------------------------------------------
To unsubscribe, e-mail: scm-unsubscribe@excalibur.apache.org
For additional commands, e-mail: scm-help@excalibur.apache.org