ceki 01/03/21 14:03:39
Modified: src/java/org/apache/log4j AppenderSkeleton.java
FileAppender.java WriterAppender.java
src/java/org/apache/log4j/net SMTPAppender.java
Log:
Restoring full backward compatibility.
Revision Changes Path
1.11 +63 -47 jakarta-log4j/src/java/org/apache/log4j/AppenderSkeleton.java
Index: AppenderSkeleton.java
===================================================================
RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/AppenderSkeleton.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- AppenderSkeleton.java 2001/03/21 21:33:51 1.10
+++ AppenderSkeleton.java 2001/03/21 22:03:36 1.11
@@ -26,6 +26,20 @@
@author Ceki Gülcü */
public abstract class AppenderSkeleton implements Appender, OptionHandler {
+ /**
+ A string constant used in naming the option for setting the
+ threshold for the appender. See also {@link #setThreshold
+ setThreshold} method. Current value of this string constant is
+ <b>Threshold</b>.
+
+ @deprecated Options are now handled using the JavaBeans paradigm.
+ This constant is not longer needed and will be removed in the
+ <em>near</em> term.
+
+ */
+ public static final String THRESHOLD_OPTION = "Threshold";
+
+
/** The layout variable does not need to be set if the appender
implementation has its own layout. */
protected Layout layout;
@@ -53,17 +67,7 @@
*/
protected boolean closed = false;
- /**
- A string constant used in naming the option for setting the
- threshold for the appender. See also {@link #setThreshold
- setThreshold} method. Current value of this string constant is
- <b>Threshold</b>.
- <p>Note that all option keys are case sensitive.
-
- */
- public static final String THRESHOLD_OPTION = "Threshold";
-
/**
Derived appenders should override this method if option structure
requires it. */
@@ -88,17 +92,6 @@
}
/**
- Returns the head Filter.
-
- @since 1.1
- */
- public
- Filter getFilter() {
- return headFilter;
- }
-
-
- /**
Subclasses of <code>AppenderSkeleton</code> should imlement this
method to perform actual logging. See also {@link #doAppend
AppenderSkeleton.doAppend} method.
@@ -148,6 +141,16 @@
}
+ /**
+ Returns the head Filter.
+
+ @since 1.1
+ */
+ public
+ Filter getFilter() {
+ return headFilter;
+ }
+
/**
Return the first filter in the filter chain for this
Appender. The return value may be <code>null</code> if no is
@@ -161,6 +164,15 @@
}
/**
+ Returns the layout of this appender. The value may be null.
+ */
+ public
+ Layout getLayout() {
+ return layout;
+ }
+
+
+ /**
Returns the name of this FileAppender.
*/
public
@@ -170,6 +182,32 @@
}
/**
+ Returns the string array {{@link #THRESHOLD_OPTION}}.
+
+ <p>Configurable appenders must override this method to return the
+ additional options they accept.
+
+ @deprecated We now use JavaBeans introspection to configure
+ components. Options strings are no longer needed. */
+ public
+ String[] getOptionStrings() {
+ return new String[] {THRESHOLD_OPTION};
+ }
+
+
+
+ /**
+ Returns this appenders threshold priority. See the {@link
+ #setThreshold} method for the meaning of this option.
+
+ @since 1.1 */
+ public
+ Priority getThreshold() {
+ return threshold;
+ }
+
+
+ /**
Check whether the message priority is below the appender's
threshold. Ig there is no threshold set, then the return value is
always <code>true</code>.
@@ -239,13 +277,6 @@
this.layout = layout;
}
- /**
- Returns the layout of this appender. The value may be null.
- */
- public
- Layout getLayout() {
- return layout;
- }
/**
Set the name of this Appender.
@@ -257,14 +288,9 @@
/**
- All classes derived from {@link AppenderSkeleton} admit the
- <b>Threshold</b> option. The value of this option is a priority
- string, such as "DEBUG", "INFO" and so on. All log events with
- lower priority than the threshold priority are ignored by the
- appender.
-
- <p>Configurable Appenders should override this method if they
- admit additional options. */
+ @deprecated Use the setter method for the option directly instead
+ of the generic <code>setOption</code> method.
+ */
public
void setOption(String key, String value) {
if(key.equalsIgnoreCase(THRESHOLD_OPTION)) {
@@ -284,15 +310,5 @@
public
void setThreshold(Priority threshold) {
this.threshold = threshold;
- }
-
- /**
- Returns this appenders threshold priority.
-
- @since 1.1
- */
- public
- Priority getThreshold() {
- return threshold;
- }
+ }
}
1.18 +3 -3 jakarta-log4j/src/java/org/apache/log4j/FileAppender.java
Index: FileAppender.java
===================================================================
RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/FileAppender.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- FileAppender.java 2001/03/19 12:38:18 1.17
+++ FileAppender.java 2001/03/21 22:03:36 1.18
@@ -69,9 +69,9 @@
new {@link OutputStreamWriter} initialized with <code>os</code>
as its {@link OutputStream}.
- @deprecated <b>The functionality of constructor form has been
- replaced by the {@link WriterAppender}. This constructor will be
- removed in the <em>near</em> term.</b>
+ @deprecated <b>The functionality of this constructor form has
+ been replaced by the {@link WriterAppender}. This constructor
+ will be removed in the <em>near</em> term.</b>
*/
public
1.9 +14 -0 jakarta-log4j/src/java/org/apache/log4j/WriterAppender.java
Index: WriterAppender.java
===================================================================
RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/WriterAppender.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- WriterAppender.java 2001/03/19 12:38:18 1.8
+++ WriterAppender.java 2001/03/21 22:03:36 1.9
@@ -30,6 +30,20 @@
@author Ceki Gülcü
@since 1.1 */
public class WriterAppender extends AppenderSkeleton {
+
+ /**
+ A string constant used in naming the option for immediate
+ flushing of the output stream at the end of each append
+ operation. Current value of this string constant is
+ <b>ImmediateFlush</b>.
+
+ <p>Note that all option keys are case sensitive.
+
+ @deprecated We now use JavaBeans introspection to configure
+ components. Options strings are no longer needed.
+ */
+ public static final String IMMEDIATE_FLUSH_OPTION = "ImmediateFlush";
+
/**
Immediate flush means that the undelying writer or output stream
will be flushed at the end of each append operation. Immediate
1.19 +18 -43 jakarta-log4j/src/java/org/apache/log4j/net/SMTPAppender.java
Index: SMTPAppender.java
===================================================================
RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/net/SMTPAppender.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- SMTPAppender.java 2001/03/21 21:34:06 1.18
+++ SMTPAppender.java 2001/03/21 22:03:38 1.19
@@ -65,6 +65,8 @@
<p>Note that all option keys are case sensitive.
+ @deprecated Options are now handled using the JavaBeans paradigm.
+ This constant will be removed in the <em>near</em> term.
*/
public static final String TO_OPTION = "To";
@@ -74,7 +76,9 @@
constant is <b>From</b>.
<p>Note that all option keys are case sensitive.
-
+
+ @deprecated Options are now handled using the JavaBeans paradigm.
+ This constant will be removed in the <em>near</em> term.
*/
public static final String FROM_OPTION = "From";
@@ -85,6 +89,8 @@
<p>Note that all option keys are case sensitive.
+ @deprecated Options are now handled using the JavaBeans paradigm.
+ This constant will be removed in the <em>near</em> term.
*/
public static final String SUBJECT_OPTION = "Subject";
@@ -96,6 +102,8 @@
<p>Note that all option keys are case sensitive.
+ @deprecated Options are now handled using the JavaBeans paradigm.
+ This constant will be removed in the <em>near</em> term.
*/
public static final String SMTP_HOST_OPTION = "SMTPHost";
@@ -105,6 +113,8 @@
<p>Note that all option keys are case sensitive.
+ @deprecated Options are now handled using the JavaBeans paradigm.
+ This constant will be removed in the <em>near</em> term.
*/
public static final String BUFFER_SIZE_OPTION = "BufferSize";
@@ -116,6 +126,8 @@
<p>Note that all option keys are case sensitive.
+ @deprecated Options are now handled using the JavaBeans paradigm.
+ This constant will be removed in the <em>near</em> term.
*/
public static final String EVALUATOR_CLASS_OPTION = "EvaluatorClass";
@@ -126,6 +138,9 @@
constant is <b>LocationInfo</b>.
<p>Note that all option keys are case sensitive.
+
+ @deprecated Options are now handled using the JavaBeans paradigm.
+ This constant will be removed in the <em>near</em> term.
*/
public static final String LOCATION_INFO_OPTION = "LocationInfo";
@@ -333,48 +348,8 @@
/**
- Set SMTPAppender specific options.
-
- <p>On top of the options of the super class {@link
- AppenderSkeleton}, the recognized options are <b>To</b>,
- <b>From</b>, <b>Subject</b>, <b>SMTPHost</b>,
- <b>BufferSize</b>, <b>EvaluatorClass</b> and <b>LocationInfo</b>.
-
- <p>The <b>To</b> option takes a string value which should be a
- comma separated list of e-mail address of the recipients.
-
- <p>The <b>From</b> option takes a string value which should be a
- e-mail address of the sender.
-
- <p>The <b>Subject</b> option takes a string value which should be a
- the subject of the e-mail message.
-
- <p>The <b>SMTPHost</b> option takes a string value which should be a
- the host name of the SMTP server that will send the e-mail message.
-
- <p>The <b>BufferSize</b>option takes a positive integer
- representing the maximum number of logging events to collect in a
- cyclic buffer. When the <code>BufferSize</code> is reached,
- oldest events are deleted as new events are added to the
- buffer. By default the size of the cyclic buffer is 512 events.
-
- <p>The <b>EvaluatorClass</b> option takes a string value
- repsenting the name of the class implementing the {@link
- TriggeringEventEvaluator} interface. A corresponding object will
- be instantiated and assigned as the triggering event evaluator
- for the SMTPAppender.
-
- <p>The <b>LocationInfo</b> option takes a boolean value. By
- default, it is set to false which means there will be no effort
- to extract the location information related to the event. As a
- result, the layout that formats the events as they are sent out
- in an e-mail is likely to place the wrong location information
- (if present in the format).
-
- <p>Location information extraction is comparatively very slow and
- should be avoided unless performance is not a concern.
-
- */
+ @deprecated Use the setter method for the option directly, instead
+ of the generic <code>setOption</code> method. */
public
void setOption(String option, String value) {
if(value == null) return;
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]