Renamed Logger and LoggerFactory to InternalLogger and InternalLoggerFactory to state that these classes for internal use only explicitly
This commit is contained in:
parent
2740da7c70
commit
d5d92ae04d
@ -38,7 +38,7 @@ import org.jboss.netty.channel.ChannelHandler;
|
||||
import org.jboss.netty.channel.ChannelPipeline;
|
||||
import org.jboss.netty.channel.ChannelPipelineFactory;
|
||||
import org.jboss.netty.channel.SimpleChannelHandler;
|
||||
import org.jboss.netty.logging.Logger;
|
||||
import org.jboss.netty.logging.InternalLogger;
|
||||
|
||||
/**
|
||||
* @author The Netty Project (netty-dev@lists.jboss.org)
|
||||
@ -50,7 +50,7 @@ import org.jboss.netty.logging.Logger;
|
||||
*/
|
||||
public class Bootstrap {
|
||||
|
||||
private static Logger logger = Logger.getLogger(Bootstrap.class);
|
||||
private static InternalLogger logger = InternalLogger.getLogger(Bootstrap.class);
|
||||
|
||||
private volatile ChannelFactory factory;
|
||||
private volatile ChannelPipeline pipeline = pipeline();
|
||||
|
@ -24,12 +24,12 @@ package org.jboss.netty.channel;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.jboss.netty.logging.Logger;
|
||||
import org.jboss.netty.logging.InternalLogger;
|
||||
|
||||
public abstract class CompleteChannelFuture implements ChannelFuture {
|
||||
|
||||
private static final Logger logger =
|
||||
Logger.getLogger(CompleteChannelFuture.class);
|
||||
private static final InternalLogger logger =
|
||||
InternalLogger.getLogger(CompleteChannelFuture.class);
|
||||
|
||||
private final Channel channel;
|
||||
|
||||
|
@ -26,13 +26,13 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.jboss.netty.logging.Logger;
|
||||
import org.jboss.netty.logging.InternalLogger;
|
||||
|
||||
|
||||
public class DefaultChannelFuture implements ChannelFuture {
|
||||
|
||||
private static final Logger logger =
|
||||
Logger.getLogger(DefaultChannelFuture.class);
|
||||
private static final InternalLogger logger =
|
||||
InternalLogger.getLogger(DefaultChannelFuture.class);
|
||||
private static final int DEAD_LOCK_CHECK_INTERVAL = 5000;
|
||||
private static final Throwable CANCELLED = new Throwable();
|
||||
|
||||
|
@ -30,12 +30,12 @@ import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
import org.jboss.netty.logging.Logger;
|
||||
import org.jboss.netty.logging.InternalLogger;
|
||||
|
||||
|
||||
public class DefaultChannelPipeline implements ChannelPipeline {
|
||||
|
||||
static final Logger logger = Logger.getLogger(DefaultChannelPipeline.class);
|
||||
static final InternalLogger logger = InternalLogger.getLogger(DefaultChannelPipeline.class);
|
||||
|
||||
private final ChannelSink discardingSink = new ChannelSink() {
|
||||
public void eventSunk(ChannelPipeline pipeline, ChannelEvent e) {
|
||||
|
@ -22,7 +22,7 @@
|
||||
*/
|
||||
package org.jboss.netty.channel;
|
||||
|
||||
import org.jboss.netty.logging.Logger;
|
||||
import org.jboss.netty.logging.InternalLogger;
|
||||
|
||||
|
||||
/**
|
||||
@ -34,8 +34,8 @@ import org.jboss.netty.logging.Logger;
|
||||
*/
|
||||
public class SimpleChannelHandler implements ChannelUpstreamHandler {
|
||||
|
||||
private static final Logger logger =
|
||||
Logger.getLogger(SimpleChannelHandler.class.getName());
|
||||
private static final InternalLogger logger =
|
||||
InternalLogger.getLogger(SimpleChannelHandler.class.getName());
|
||||
|
||||
public void handleUpstream(
|
||||
ChannelHandlerContext ctx, ChannelEvent e) throws Exception {
|
||||
|
@ -32,12 +32,12 @@ import org.jboss.netty.channel.ChannelFactory;
|
||||
import org.jboss.netty.channel.ChannelFuture;
|
||||
import org.jboss.netty.channel.ChannelPipeline;
|
||||
import org.jboss.netty.channel.ChannelSink;
|
||||
import org.jboss.netty.logging.Logger;
|
||||
import org.jboss.netty.logging.InternalLogger;
|
||||
|
||||
class NioClientSocketChannel extends NioSocketChannel {
|
||||
|
||||
private static final Logger logger =
|
||||
Logger.getLogger(NioClientSocketChannel.class);
|
||||
private static final InternalLogger logger =
|
||||
InternalLogger.getLogger(NioClientSocketChannel.class);
|
||||
|
||||
private static SocketChannel newSocket() {
|
||||
SocketChannel socket;
|
||||
|
@ -44,13 +44,13 @@ import org.jboss.netty.channel.ChannelPipeline;
|
||||
import org.jboss.netty.channel.ChannelState;
|
||||
import org.jboss.netty.channel.ChannelStateEvent;
|
||||
import org.jboss.netty.channel.MessageEvent;
|
||||
import org.jboss.netty.logging.Logger;
|
||||
import org.jboss.netty.logging.InternalLogger;
|
||||
import org.jboss.netty.util.NamePreservingRunnable;
|
||||
|
||||
class NioClientSocketPipelineSink extends AbstractChannelSink {
|
||||
|
||||
static final Logger logger =
|
||||
Logger.getLogger(NioClientSocketPipelineSink.class);
|
||||
static final InternalLogger logger =
|
||||
InternalLogger.getLogger(NioClientSocketPipelineSink.class);
|
||||
private static final AtomicInteger nextId = new AtomicInteger();
|
||||
|
||||
final int id = nextId.incrementAndGet();
|
||||
|
@ -36,13 +36,13 @@ import org.jboss.netty.channel.ChannelPipeline;
|
||||
import org.jboss.netty.channel.ChannelSink;
|
||||
import org.jboss.netty.channel.socket.DefaultServerSocketChannelConfig;
|
||||
import org.jboss.netty.channel.socket.ServerSocketChannelConfig;
|
||||
import org.jboss.netty.logging.Logger;
|
||||
import org.jboss.netty.logging.InternalLogger;
|
||||
|
||||
class NioServerSocketChannel extends AbstractServerChannel
|
||||
implements org.jboss.netty.channel.socket.ServerSocketChannel {
|
||||
|
||||
private static final Logger logger =
|
||||
Logger.getLogger(NioServerSocketChannel.class);
|
||||
private static final InternalLogger logger =
|
||||
InternalLogger.getLogger(NioServerSocketChannel.class);
|
||||
|
||||
final ServerSocketChannel socket;
|
||||
private final ServerSocketChannelConfig config;
|
||||
|
@ -40,13 +40,13 @@ import org.jboss.netty.channel.ChannelPipeline;
|
||||
import org.jboss.netty.channel.ChannelState;
|
||||
import org.jboss.netty.channel.ChannelStateEvent;
|
||||
import org.jboss.netty.channel.MessageEvent;
|
||||
import org.jboss.netty.logging.Logger;
|
||||
import org.jboss.netty.logging.InternalLogger;
|
||||
import org.jboss.netty.util.NamePreservingRunnable;
|
||||
|
||||
class NioServerSocketPipelineSink extends AbstractChannelSink {
|
||||
|
||||
static final Logger logger =
|
||||
Logger.getLogger(NioServerSocketPipelineSink.class);
|
||||
static final InternalLogger logger =
|
||||
InternalLogger.getLogger(NioServerSocketPipelineSink.class);
|
||||
private static final AtomicInteger nextId = new AtomicInteger();
|
||||
|
||||
private final int id = nextId.incrementAndGet();
|
||||
|
@ -40,12 +40,12 @@ import org.jboss.netty.buffer.ChannelBuffers;
|
||||
import org.jboss.netty.channel.Channel;
|
||||
import org.jboss.netty.channel.ChannelException;
|
||||
import org.jboss.netty.channel.ChannelFuture;
|
||||
import org.jboss.netty.logging.Logger;
|
||||
import org.jboss.netty.logging.InternalLogger;
|
||||
import org.jboss.netty.util.NamePreservingRunnable;
|
||||
|
||||
class NioWorker implements Runnable {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(NioWorker.class);
|
||||
private static final InternalLogger logger = InternalLogger.getLogger(NioWorker.class);
|
||||
|
||||
private final int bossId;
|
||||
private final int id;
|
||||
|
@ -37,13 +37,13 @@ import org.jboss.netty.channel.ChannelSink;
|
||||
import org.jboss.netty.channel.socket.DefaultServerSocketChannelConfig;
|
||||
import org.jboss.netty.channel.socket.ServerSocketChannel;
|
||||
import org.jboss.netty.channel.socket.ServerSocketChannelConfig;
|
||||
import org.jboss.netty.logging.Logger;
|
||||
import org.jboss.netty.logging.InternalLogger;
|
||||
|
||||
class OioServerSocketChannel extends AbstractServerChannel
|
||||
implements ServerSocketChannel {
|
||||
|
||||
private static final Logger logger =
|
||||
Logger.getLogger(OioServerSocketChannel.class);
|
||||
private static final InternalLogger logger =
|
||||
InternalLogger.getLogger(OioServerSocketChannel.class);
|
||||
|
||||
final ServerSocket socket;
|
||||
private final ServerSocketChannelConfig config;
|
||||
|
@ -38,13 +38,13 @@ import org.jboss.netty.channel.ChannelPipeline;
|
||||
import org.jboss.netty.channel.ChannelState;
|
||||
import org.jboss.netty.channel.ChannelStateEvent;
|
||||
import org.jboss.netty.channel.MessageEvent;
|
||||
import org.jboss.netty.logging.Logger;
|
||||
import org.jboss.netty.logging.InternalLogger;
|
||||
import org.jboss.netty.util.NamePreservingRunnable;
|
||||
|
||||
class OioServerSocketPipelineSink extends AbstractChannelSink {
|
||||
|
||||
static final Logger logger =
|
||||
Logger.getLogger(OioServerSocketPipelineSink.class);
|
||||
static final InternalLogger logger =
|
||||
InternalLogger.getLogger(OioServerSocketPipelineSink.class);
|
||||
|
||||
final Executor workerExecutor;
|
||||
|
||||
|
@ -30,13 +30,13 @@ package org.jboss.netty.logging;
|
||||
* @version $Rev$, $Date$
|
||||
*
|
||||
*/
|
||||
public class CommonsLoggerFactory extends LoggerFactory {
|
||||
public class CommonsLoggerFactory extends InternalLoggerFactory {
|
||||
|
||||
@Override
|
||||
public Logger getLogger(String name) {
|
||||
public InternalLogger getInstance(String name) {
|
||||
final org.apache.commons.logging.Log logger =
|
||||
org.apache.commons.logging.LogFactory.getLog(name);
|
||||
return new Logger() {
|
||||
return new InternalLogger() {
|
||||
@Override
|
||||
public void debug(String msg) {
|
||||
logger.debug(msg);
|
||||
|
@ -29,13 +29,13 @@ package org.jboss.netty.logging;
|
||||
* @version $Rev$, $Date$
|
||||
*
|
||||
*/
|
||||
public abstract class Logger {
|
||||
public static Logger getLogger(Class<?> clazz) {
|
||||
public abstract class InternalLogger {
|
||||
public static InternalLogger getLogger(Class<?> clazz) {
|
||||
return getLogger(clazz.getName());
|
||||
}
|
||||
|
||||
public static Logger getLogger(String name) {
|
||||
return LoggerFactory.getDefault().getLogger(name);
|
||||
public static InternalLogger getLogger(String name) {
|
||||
return InternalLoggerFactory.getDefault().getInstance(name);
|
||||
}
|
||||
|
||||
public abstract boolean isDebugEnabled();
|
@ -29,19 +29,19 @@ package org.jboss.netty.logging;
|
||||
* @version $Rev$, $Date$
|
||||
*
|
||||
*/
|
||||
public abstract class LoggerFactory {
|
||||
private static volatile LoggerFactory defaultInstance = new JdkLoggerFactory();
|
||||
public abstract class InternalLoggerFactory {
|
||||
private static volatile InternalLoggerFactory defaultInstance = new JdkLoggerFactory();
|
||||
|
||||
public static LoggerFactory getDefault() {
|
||||
public static InternalLoggerFactory getDefault() {
|
||||
return defaultInstance;
|
||||
}
|
||||
|
||||
public static void setDefault(LoggerFactory defaultInstance) {
|
||||
public static void setDefault(InternalLoggerFactory defaultInstance) {
|
||||
if (defaultInstance == null) {
|
||||
throw new NullPointerException("defaultInstance");
|
||||
}
|
||||
LoggerFactory.defaultInstance = defaultInstance;
|
||||
InternalLoggerFactory.defaultInstance = defaultInstance;
|
||||
}
|
||||
|
||||
public abstract Logger getLogger(String name);
|
||||
public abstract InternalLogger getInstance(String name);
|
||||
}
|
@ -30,13 +30,13 @@ package org.jboss.netty.logging;
|
||||
* @version $Rev$, $Date$
|
||||
*
|
||||
*/
|
||||
public class JBossLoggerFactory extends LoggerFactory {
|
||||
public class JBossLoggerFactory extends InternalLoggerFactory {
|
||||
|
||||
@Override
|
||||
public Logger getLogger(String name) {
|
||||
public InternalLogger getInstance(String name) {
|
||||
final org.jboss.logging.Logger logger =
|
||||
org.jboss.logging.Logger.getLogger(name);
|
||||
return new Logger() {
|
||||
return new InternalLogger() {
|
||||
@Override
|
||||
public void debug(String msg) {
|
||||
logger.debug(msg);
|
||||
|
@ -31,13 +31,13 @@ import java.util.logging.Level;
|
||||
* @version $Rev$, $Date$
|
||||
*
|
||||
*/
|
||||
public class JdkLoggerFactory extends LoggerFactory {
|
||||
public class JdkLoggerFactory extends InternalLoggerFactory {
|
||||
|
||||
@Override
|
||||
public Logger getLogger(String name) {
|
||||
public InternalLogger getInstance(String name) {
|
||||
final java.util.logging.Logger logger =
|
||||
java.util.logging.Logger.getLogger(name);
|
||||
return new Logger() {
|
||||
return new InternalLogger() {
|
||||
@Override
|
||||
public void debug(String msg) {
|
||||
logger.log(Level.FINE, msg);
|
||||
|
@ -30,13 +30,13 @@ package org.jboss.netty.logging;
|
||||
* @version $Rev$, $Date$
|
||||
*
|
||||
*/
|
||||
public class Log4JLoggerFactory extends LoggerFactory {
|
||||
public class Log4JLoggerFactory extends InternalLoggerFactory {
|
||||
|
||||
@Override
|
||||
public Logger getLogger(String name) {
|
||||
public InternalLogger getInstance(String name) {
|
||||
final org.apache.log4j.Logger logger =
|
||||
org.apache.log4j.Logger.getLogger(name);
|
||||
return new Logger() {
|
||||
return new InternalLogger() {
|
||||
@Override
|
||||
public void debug(String msg) {
|
||||
logger.debug(msg);
|
||||
|
@ -30,13 +30,13 @@ package org.jboss.netty.logging;
|
||||
* @version $Rev$, $Date$
|
||||
*
|
||||
*/
|
||||
public class Slf4JLoggerFactory extends LoggerFactory {
|
||||
public class Slf4JLoggerFactory extends InternalLoggerFactory {
|
||||
|
||||
@Override
|
||||
public Logger getLogger(String name) {
|
||||
public InternalLogger getInstance(String name) {
|
||||
final org.slf4j.Logger logger =
|
||||
org.slf4j.LoggerFactory.getLogger(name);
|
||||
return new Logger() {
|
||||
return new InternalLogger() {
|
||||
@Override
|
||||
public void debug(String msg) {
|
||||
logger.debug(msg);
|
||||
|
@ -22,11 +22,11 @@
|
||||
*/
|
||||
package org.jboss.netty.util;
|
||||
|
||||
import org.jboss.netty.logging.Logger;
|
||||
import org.jboss.netty.logging.InternalLogger;
|
||||
|
||||
public class NamePreservingRunnable implements Runnable {
|
||||
private static final Logger logger =
|
||||
Logger.getLogger(NamePreservingRunnable.class);
|
||||
private static final InternalLogger logger =
|
||||
InternalLogger.getLogger(NamePreservingRunnable.class);
|
||||
|
||||
private final String newName;
|
||||
private final Runnable runnable;
|
||||
|
Loading…
x
Reference in New Issue
Block a user