[jboss-svn-commits] JBoss Common SVN: r3549 - in jboss-logmanager/trunk/src/main/java/org/jboss/logmanager: handlers and 1 other directory.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Tue Sep 29 12:20:17 EDT 2009


Author: david.lloyd at jboss.com
Date: 2009-09-29 12:20:17 -0400 (Tue, 29 Sep 2009)
New Revision: 3549

Added:
   jboss-logmanager/trunk/src/main/java/org/jboss/logmanager/handlers/FlushableCloseable.java
Modified:
   jboss-logmanager/trunk/src/main/java/org/jboss/logmanager/ExtHandler.java
   jboss-logmanager/trunk/src/main/java/org/jboss/logmanager/handlers/Handlers.java
Log:
Fix dead code bug

Modified: jboss-logmanager/trunk/src/main/java/org/jboss/logmanager/ExtHandler.java
===================================================================
--- jboss-logmanager/trunk/src/main/java/org/jboss/logmanager/ExtHandler.java	2009-09-29 16:13:22 UTC (rev 3548)
+++ jboss-logmanager/trunk/src/main/java/org/jboss/logmanager/ExtHandler.java	2009-09-29 16:20:17 UTC (rev 3549)
@@ -26,15 +26,15 @@
 import java.util.logging.LogRecord;
 import java.util.logging.LoggingPermission;
 
-import java.io.Flushable;
 import java.security.Permission;
 import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
+import org.jboss.logmanager.handlers.FlushableCloseable;
 
 /**
  * An extended logger handler.  Use this class as a base class for log handlers which require {@code ExtLogRecord}
  * instances.
  */
-public abstract class ExtHandler extends Handler implements Flushable {
+public abstract class ExtHandler extends Handler implements FlushableCloseable {
 
     private static final String LOGGER_CLASS_NAME = org.jboss.logmanager.Logger.class.getName();
     private static final Permission CONTROL_PERMISSION = new LoggingPermission("control", null);

Added: jboss-logmanager/trunk/src/main/java/org/jboss/logmanager/handlers/FlushableCloseable.java
===================================================================
--- jboss-logmanager/trunk/src/main/java/org/jboss/logmanager/handlers/FlushableCloseable.java	                        (rev 0)
+++ jboss-logmanager/trunk/src/main/java/org/jboss/logmanager/handlers/FlushableCloseable.java	2009-09-29 16:20:17 UTC (rev 3549)
@@ -0,0 +1,31 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.logmanager.handlers;
+
+import java.io.Flushable;
+import java.io.Closeable;
+
+/**
+ * A resource which is flushable and closeable.
+ */
+public interface FlushableCloseable extends Flushable, Closeable {}

Modified: jboss-logmanager/trunk/src/main/java/org/jboss/logmanager/handlers/Handlers.java
===================================================================
--- jboss-logmanager/trunk/src/main/java/org/jboss/logmanager/handlers/Handlers.java	2009-09-29 16:13:22 UTC (rev 3548)
+++ jboss-logmanager/trunk/src/main/java/org/jboss/logmanager/handlers/Handlers.java	2009-09-29 16:20:17 UTC (rev 3549)
@@ -22,8 +22,6 @@
 
 package org.jboss.logmanager.handlers;
 
-import java.io.Flushable;
-
 import java.util.logging.Handler;
 
 /**
@@ -40,8 +38,8 @@
      * @param handler the logging handler
      * @return the wrapper
      */
-    public static Flushable wrap(final Handler handler) {
-        return handler instanceof Flushable ? (Flushable) handler : new Flushable() {
+    public static FlushableCloseable wrap(final Handler handler) {
+        return handler instanceof FlushableCloseable ? (FlushableCloseable) handler : new FlushableCloseable() {
             public void close() {
                 handler.close();
             }



More information about the jboss-svn-commits mailing list