logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1405282 - in /logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core: Appender.java appender/AbstractAppender.java
Date Sat, 03 Nov 2012 05:54:44 GMT
Author: ggregory
Date: Sat Nov  3 05:54:43 2012
New Revision: 1405282

URL: http://svn.apache.org/viewvc?rev=1405282&view=rev
Log:
Use generics and fix compile warnings.

Modified:
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/Appender.java
    logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/AbstractAppender.java

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/Appender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/Appender.java?rev=1405282&r1=1405281&r2=1405282&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/Appender.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/Appender.java
Sat Nov  3 05:54:43 2012
@@ -16,10 +16,12 @@
  */
 package org.apache.logging.log4j.core;
 
+import java.io.Serializable;
+
 /**
  * @issue LOG4J2-36: Appender interface should be refactored
  */
-public interface Appender extends LifeCycle {
+public interface Appender<T extends Serializable> extends LifeCycle {
 
     /**
      * Log in <code>Appender</code> specific way. When appropriate,
@@ -44,7 +46,7 @@ public interface Appender extends LifeCy
      * @return the Layout for the Appender or null if none is configured.
      * @issue LOG4J2-36 Refactor into Channel
      */
-    Layout<?> getLayout();
+    Layout<T> getLayout();
 
     /**
      * If set to true any exceptions thrown by the Appender will be logged but not thrown.

Modified: logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/AbstractAppender.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/AbstractAppender.java?rev=1405282&r1=1405281&r2=1405282&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/AbstractAppender.java
(original)
+++ logging/log4j/log4j2/trunk/core/src/main/java/org/apache/logging/log4j/core/appender/AbstractAppender.java
Sat Nov  3 05:54:43 2012
@@ -16,6 +16,8 @@
  */
 package org.apache.logging.log4j.core.appender;
 
+import java.io.Serializable;
+
 import org.apache.logging.log4j.core.Appender;
 import org.apache.logging.log4j.core.ErrorHandler;
 import org.apache.logging.log4j.core.Filter;
@@ -30,7 +32,7 @@ import org.apache.logging.log4j.Logger;
  * Abstract base class for Appenders. Although Appenders do not have to extend this class,
doing so
  * will simplify their implementation.
  */
-public abstract class AbstractAppender extends Filterable implements Appender, LifeCycle
{
+public abstract class AbstractAppender<T extends Serializable> extends Filterable implements
Appender<T>, LifeCycle {
     /**
      * Allow subclasses access to the status logger without creating another instance.
      */
@@ -41,7 +43,7 @@ public abstract class AbstractAppender e
      */
     private boolean started = false;
 
-    private final Layout<?> layout;
+    private final Layout<T> layout;
 
     private final String name;
 
@@ -55,7 +57,7 @@ public abstract class AbstractAppender e
      * @param filter The Filter to associate with the Appender.
      * @param layout The layout to use to format the event.
      */
-    protected AbstractAppender(String name, Filter filter, Layout<?> layout) {
+    protected AbstractAppender(String name, Filter filter, Layout<T> layout) {
         this(name, filter, layout, true);
     }
 
@@ -67,7 +69,7 @@ public abstract class AbstractAppender e
      * @param handleException If true, exceptions will be logged and suppressed. If false
errors will be
      * logged and then passed to the application.
      */
-    protected AbstractAppender(String name, Filter filter, Layout<?> layout, boolean
handleException) {
+    protected AbstractAppender(String name, Filter filter, Layout<T> layout, boolean
handleException) {
         super(filter);
         this.name = name;
         this.layout = layout;
@@ -116,7 +118,7 @@ public abstract class AbstractAppender e
      * Returns the Layout for the appender.
      * @return The Layout used to format the event.
      */
-    public Layout<?> getLayout() {
+    public Layout<T> getLayout() {
         return layout;
     }
 



Mime
View raw message