[jboss-svn-commits] JBoss Common SVN: r3201 - in jboss-logmanager/trunk/src/main/java/org: jboss/logmanager and 2 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed May 27 13:49:53 EDT 2009


Author: david.lloyd at jboss.com
Date: 2009-05-27 13:49:53 -0400 (Wed, 27 May 2009)
New Revision: 3201

Added:
   jboss-logmanager/trunk/src/main/java/org/jboss/logmanager/SerializedLogger.java
   jboss-logmanager/trunk/src/main/java/org/slf4j/
   jboss-logmanager/trunk/src/main/java/org/slf4j/impl/
   jboss-logmanager/trunk/src/main/java/org/slf4j/impl/Slf4jLoggerFactory.java
   jboss-logmanager/trunk/src/main/java/org/slf4j/impl/Slf4jMDCAdapter.java
   jboss-logmanager/trunk/src/main/java/org/slf4j/impl/StaticLoggerBinder.java
   jboss-logmanager/trunk/src/main/java/org/slf4j/impl/StaticMDCBinder.java
   jboss-logmanager/trunk/src/main/java/org/slf4j/impl/StaticMarkerBinder.java
Removed:
   jboss-logmanager/trunk/src/main/java/org/jboss/logmanager/LoggerMarker.java
   jboss-logmanager/trunk/src/main/java/org/jboss/logmanager/Slf4jLoggerFactory.java
   jboss-logmanager/trunk/src/main/java/org/jboss/logmanager/Slf4jMDCAdapter.java
Modified:
   jboss-logmanager/trunk/src/main/java/org/jboss/logmanager/Logger.java
   jboss-logmanager/trunk/src/main/java/org/jboss/logmanager/MDCProviderImpl.java
   jboss-logmanager/trunk/src/main/java/org/jboss/logmanager/NDCProviderImpl.java
Log:
Merge slf4j impl, since there is no reason to keep it separate; reorganize accordingly

Modified: jboss-logmanager/trunk/src/main/java/org/jboss/logmanager/Logger.java
===================================================================
--- jboss-logmanager/trunk/src/main/java/org/jboss/logmanager/Logger.java	2009-05-26 08:37:02 UTC (rev 3200)
+++ jboss-logmanager/trunk/src/main/java/org/jboss/logmanager/Logger.java	2009-05-27 17:49:53 UTC (rev 3201)
@@ -100,7 +100,7 @@
     // Serialization
 
     private Object writeReplace() throws ObjectStreamException {
-        return new LoggerMarker(getName());
+        return new SerializedLogger(getName());
     }
 
     // Filter mgmt

Deleted: jboss-logmanager/trunk/src/main/java/org/jboss/logmanager/LoggerMarker.java
===================================================================
--- jboss-logmanager/trunk/src/main/java/org/jboss/logmanager/LoggerMarker.java	2009-05-26 08:37:02 UTC (rev 3200)
+++ jboss-logmanager/trunk/src/main/java/org/jboss/logmanager/LoggerMarker.java	2009-05-27 17:49:53 UTC (rev 3201)
@@ -1,56 +0,0 @@
-/*
- * 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;
-
-import java.io.Serializable;
-import java.io.ObjectStreamException;
-
-/**
- * A marker class for loggers.  After read, the {@link #readResolve()} method will return a logger with the given name.
- */
-public final class LoggerMarker implements Serializable {
-
-    private static final long serialVersionUID = 8266206989821750874L;
-
-    private final String name;
-
-    /**
-     * Construct an instance.
-     *
-     * @param name the logger name
-     */
-    public LoggerMarker(final String name) {
-        this.name = name;
-    }
-
-    /**
-     * Get the actual logger for this marker.
-     *
-     * @return the logger
-     * @throws ObjectStreamException (never)
-     * @see <a href="http://java.sun.com/javase/6/docs/platform/serialization/spec/input.html#5903">Serialization spec, 3.7</a>
-     */
-    public Object readResolve() throws ObjectStreamException {
-        return Logger.getLogger(name);
-    }
-}

Modified: jboss-logmanager/trunk/src/main/java/org/jboss/logmanager/MDCProviderImpl.java
===================================================================
--- jboss-logmanager/trunk/src/main/java/org/jboss/logmanager/MDCProviderImpl.java	2009-05-26 08:37:02 UTC (rev 3200)
+++ jboss-logmanager/trunk/src/main/java/org/jboss/logmanager/MDCProviderImpl.java	2009-05-27 17:49:53 UTC (rev 3201)
@@ -25,7 +25,7 @@
 import java.util.Map;
 import org.jboss.logging.MDCProvider;
 
-public final class MDCProviderImpl implements MDCProvider {
+final class MDCProviderImpl implements MDCProvider {
 
     public void put(final String key, final Object value) {
         MDC.put(key, String.valueOf(value));

Modified: jboss-logmanager/trunk/src/main/java/org/jboss/logmanager/NDCProviderImpl.java
===================================================================
--- jboss-logmanager/trunk/src/main/java/org/jboss/logmanager/NDCProviderImpl.java	2009-05-26 08:37:02 UTC (rev 3200)
+++ jboss-logmanager/trunk/src/main/java/org/jboss/logmanager/NDCProviderImpl.java	2009-05-27 17:49:53 UTC (rev 3201)
@@ -24,7 +24,7 @@
 
 import org.jboss.logging.NDCProvider;
 
-public final class NDCProviderImpl implements NDCProvider {
+final class NDCProviderImpl implements NDCProvider {
 
     public void clear() {
         NDC.clear();

Copied: jboss-logmanager/trunk/src/main/java/org/jboss/logmanager/SerializedLogger.java (from rev 3187, jboss-logmanager/trunk/src/main/java/org/jboss/logmanager/LoggerMarker.java)
===================================================================
--- jboss-logmanager/trunk/src/main/java/org/jboss/logmanager/SerializedLogger.java	                        (rev 0)
+++ jboss-logmanager/trunk/src/main/java/org/jboss/logmanager/SerializedLogger.java	2009-05-27 17:49:53 UTC (rev 3201)
@@ -0,0 +1,56 @@
+/*
+ * 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;
+
+import java.io.Serializable;
+import java.io.ObjectStreamException;
+
+/**
+ * A marker class for loggers.  After read, the {@link #readResolve()} method will return a logger with the given name.
+ */
+public final class SerializedLogger implements Serializable {
+
+    private static final long serialVersionUID = 8266206989821750874L;
+
+    private final String name;
+
+    /**
+     * Construct an instance.
+     *
+     * @param name the logger name
+     */
+    public SerializedLogger(final String name) {
+        this.name = name;
+    }
+
+    /**
+     * Get the actual logger for this marker.
+     *
+     * @return the logger
+     * @throws ObjectStreamException (never)
+     * @see <a href="http://java.sun.com/javase/6/docs/platform/serialization/spec/input.html#5903">Serialization spec, 3.7</a>
+     */
+    public Object readResolve() throws ObjectStreamException {
+        return Logger.getLogger(name);
+    }
+}

Deleted: jboss-logmanager/trunk/src/main/java/org/jboss/logmanager/Slf4jLoggerFactory.java
===================================================================
--- jboss-logmanager/trunk/src/main/java/org/jboss/logmanager/Slf4jLoggerFactory.java	2009-05-26 08:37:02 UTC (rev 3200)
+++ jboss-logmanager/trunk/src/main/java/org/jboss/logmanager/Slf4jLoggerFactory.java	2009-05-27 17:49:53 UTC (rev 3201)
@@ -1,33 +0,0 @@
-/*
- * 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;
-
-import org.slf4j.ILoggerFactory;
-import org.slf4j.Logger;
-
-public final class Slf4jLoggerFactory implements ILoggerFactory {
-
-    public Logger getLogger(final String name) {
-        return LogContext.getLogContext().getLogger(name);
-    }
-}

Deleted: jboss-logmanager/trunk/src/main/java/org/jboss/logmanager/Slf4jMDCAdapter.java
===================================================================
--- jboss-logmanager/trunk/src/main/java/org/jboss/logmanager/Slf4jMDCAdapter.java	2009-05-26 08:37:02 UTC (rev 3200)
+++ jboss-logmanager/trunk/src/main/java/org/jboss/logmanager/Slf4jMDCAdapter.java	2009-05-27 17:49:53 UTC (rev 3201)
@@ -1,60 +0,0 @@
-/*
- * 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;
-
-import java.util.Map;
-import org.slf4j.spi.MDCAdapter;
-
-public final class Slf4jMDCAdapter implements MDCAdapter {
-
-    public void put(final String key, final String val) {
-        MDC.put(key, val);
-    }
-
-    public String get(final String key) {
-        return MDC.get(key);
-    }
-
-    public void remove(final String key) {
-        MDC.remove(key);
-    }
-
-    public void clear() {
-        MDC.clear();
-    }
-
-    public Map getCopyOfContextMap() {
-        return MDC.copy();
-    }
-
-    public void setContextMap(final Map contextMap) {
-        MDC.clear();
-        for (Map.Entry<?, ?> entry : ((Map<?, ?>) contextMap).entrySet()) {
-            final Object key = entry.getKey();
-            final Object value = entry.getValue();
-            if (key != null && value != null) {
-                MDC.put(key.toString(), value.toString());
-            }
-        }
-    }
-}

Copied: jboss-logmanager/trunk/src/main/java/org/slf4j/impl/Slf4jLoggerFactory.java (from rev 3187, jboss-logmanager/trunk/src/main/java/org/jboss/logmanager/Slf4jLoggerFactory.java)
===================================================================
--- jboss-logmanager/trunk/src/main/java/org/slf4j/impl/Slf4jLoggerFactory.java	                        (rev 0)
+++ jboss-logmanager/trunk/src/main/java/org/slf4j/impl/Slf4jLoggerFactory.java	2009-05-27 17:49:53 UTC (rev 3201)
@@ -0,0 +1,34 @@
+/*
+ * 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.slf4j.impl;
+
+import org.slf4j.ILoggerFactory;
+import org.slf4j.Logger;
+import org.jboss.logmanager.LogContext;
+
+public final class Slf4jLoggerFactory implements ILoggerFactory {
+
+    public Logger getLogger(final String name) {
+        return LogContext.getLogContext().getLogger(name);
+    }
+}

Copied: jboss-logmanager/trunk/src/main/java/org/slf4j/impl/Slf4jMDCAdapter.java (from rev 3187, jboss-logmanager/trunk/src/main/java/org/jboss/logmanager/Slf4jMDCAdapter.java)
===================================================================
--- jboss-logmanager/trunk/src/main/java/org/slf4j/impl/Slf4jMDCAdapter.java	                        (rev 0)
+++ jboss-logmanager/trunk/src/main/java/org/slf4j/impl/Slf4jMDCAdapter.java	2009-05-27 17:49:53 UTC (rev 3201)
@@ -0,0 +1,61 @@
+/*
+ * 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.slf4j.impl;
+
+import java.util.Map;
+import org.slf4j.spi.MDCAdapter;
+import org.jboss.logmanager.MDC;
+
+public final class Slf4jMDCAdapter implements MDCAdapter {
+
+    public void put(final String key, final String val) {
+        MDC.put(key, val);
+    }
+
+    public String get(final String key) {
+        return MDC.get(key);
+    }
+
+    public void remove(final String key) {
+        MDC.remove(key);
+    }
+
+    public void clear() {
+        MDC.clear();
+    }
+
+    public Map getCopyOfContextMap() {
+        return MDC.copy();
+    }
+
+    public void setContextMap(final Map contextMap) {
+        MDC.clear();
+        for (Map.Entry<?, ?> entry : ((Map<?, ?>) contextMap).entrySet()) {
+            final Object key = entry.getKey();
+            final Object value = entry.getValue();
+            if (key != null && value != null) {
+                MDC.put(key.toString(), value.toString());
+            }
+        }
+    }
+}

Added: jboss-logmanager/trunk/src/main/java/org/slf4j/impl/StaticLoggerBinder.java
===================================================================
--- jboss-logmanager/trunk/src/main/java/org/slf4j/impl/StaticLoggerBinder.java	                        (rev 0)
+++ jboss-logmanager/trunk/src/main/java/org/slf4j/impl/StaticLoggerBinder.java	2009-05-27 17:49:53 UTC (rev 3201)
@@ -0,0 +1,38 @@
+/*
+ * 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.slf4j.impl;
+
+import org.slf4j.spi.LoggerFactoryBinder;
+import org.slf4j.ILoggerFactory;
+import org.slf4j.impl.Slf4jLoggerFactory;
+
+public final class StaticLoggerBinder implements LoggerFactoryBinder {
+
+    public ILoggerFactory getLoggerFactory() {
+        return new Slf4jLoggerFactory();
+    }
+
+    public String getLoggerFactoryClassStr() {
+        return Slf4jLoggerFactory.class.getName();
+    }
+}

Added: jboss-logmanager/trunk/src/main/java/org/slf4j/impl/StaticMDCBinder.java
===================================================================
--- jboss-logmanager/trunk/src/main/java/org/slf4j/impl/StaticMDCBinder.java	                        (rev 0)
+++ jboss-logmanager/trunk/src/main/java/org/slf4j/impl/StaticMDCBinder.java	2009-05-27 17:49:53 UTC (rev 3201)
@@ -0,0 +1,42 @@
+/*
+ * 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.slf4j.impl;
+
+import org.slf4j.spi.MDCAdapter;
+import org.slf4j.impl.Slf4jMDCAdapter;
+
+public final class StaticMDCBinder {
+
+    public static final StaticMDCBinder SINGLETON = new StaticMDCBinder();
+
+    private StaticMDCBinder() {
+    }
+
+    public MDCAdapter getMDCA() {
+        return new Slf4jMDCAdapter();
+    }
+
+    public String getMDCAdapterClassStr() {
+        return Slf4jMDCAdapter.class.getName();
+    }
+}

Added: jboss-logmanager/trunk/src/main/java/org/slf4j/impl/StaticMarkerBinder.java
===================================================================
--- jboss-logmanager/trunk/src/main/java/org/slf4j/impl/StaticMarkerBinder.java	                        (rev 0)
+++ jboss-logmanager/trunk/src/main/java/org/slf4j/impl/StaticMarkerBinder.java	2009-05-27 17:49:53 UTC (rev 3201)
@@ -0,0 +1,45 @@
+/*
+ * 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.slf4j.impl;
+
+import org.slf4j.spi.MarkerFactoryBinder;
+import org.slf4j.IMarkerFactory;
+import org.slf4j.helpers.BasicMarkerFactory;
+
+public final class StaticMarkerBinder implements MarkerFactoryBinder {
+
+    public static final StaticMarkerBinder SINGLETON = new StaticMarkerBinder();
+
+    private final IMarkerFactory markerFactory = new BasicMarkerFactory();
+
+    private StaticMarkerBinder() {
+    }
+
+    public IMarkerFactory getMarkerFactory() {
+        return markerFactory;
+    }
+
+    public String getMarkerFactoryClassStr() {
+        return BasicMarkerFactory.class.getName();
+    }
+}




More information about the jboss-svn-commits mailing list