net.dpml.transit.monitor
Class LoggingAdapter

java.lang.Object
  extended bynet.dpml.transit.monitor.LoggingAdapter
All Implemented Interfaces:
Adapter, Logger

public class LoggingAdapter
extends Object
implements Adapter

Generic adapter that redirects monitor events to a logging channel.

Version:
1.0.1
Author:
Digital Product Meta Library

Constructor Summary
LoggingAdapter()
          Creation of a new console adapter that is used to redirect transit events the system output stream.
LoggingAdapter(Logger logger)
          Creation of a new console adapter that is used to redirect transit events the system output stream.
LoggingAdapter(String category)
          Creation of a new console adapter that is used to redirect transit events the system output stream.
 
Method Summary
 void debug(String message)
          Log a debug message is debug mode is enabled.
 void error(String message)
          Log a error message.
 void error(String message, Throwable e)
          Log a error message.
 Logger getChildLogger(String category)
          Return a child logger.
 void info(String message)
          Log a info level message.
 boolean isDebugEnabled()
          Return TRUE is debug level logging is enabled.
 boolean isErrorEnabled()
          Return TRUE is error level logging is enabled.
 boolean isInfoEnabled()
          Return TRUE is info level logging is enabled.
 boolean isTraceEnabled()
          Return TRUE is trace level logging is enabled.
 boolean isWarnEnabled()
          Return TRUE is error level logging is enabled.
 void notify(URL resource, int total, int count)
          Handle download notification.
 void trace(String message)
          Log a debug message is trace mode is enabled.
 void warn(String message)
          Record a warning message.
 void warn(String message, Throwable cause)
          Record a warning message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoggingAdapter

public LoggingAdapter()
Creation of a new console adapter that is used to redirect transit events the system output stream.


LoggingAdapter

public LoggingAdapter(Logger logger)
Creation of a new console adapter that is used to redirect transit events the system output stream.

Parameters:
logger - the assigned logging channel

LoggingAdapter

public LoggingAdapter(String category)
Creation of a new console adapter that is used to redirect transit events the system output stream.

Parameters:
category - the logging channel category name
Method Detail

isTraceEnabled

public boolean isTraceEnabled()
Return TRUE is trace level logging is enabled.

Specified by:
isTraceEnabled in interface Logger
Returns:
the enabled state of trace logging

isDebugEnabled

public boolean isDebugEnabled()
Return TRUE is debug level logging is enabled.

Specified by:
isDebugEnabled in interface Logger
Returns:
the enabled state of debug logging

isInfoEnabled

public boolean isInfoEnabled()
Return TRUE is info level logging is enabled.

Specified by:
isInfoEnabled in interface Logger
Returns:
the enabled state of info logging

isWarnEnabled

public boolean isWarnEnabled()
Return TRUE is error level logging is enabled.

Specified by:
isWarnEnabled in interface Logger
Returns:
the enabled state of error logging

isErrorEnabled

public boolean isErrorEnabled()
Return TRUE is error level logging is enabled.

Specified by:
isErrorEnabled in interface Logger
Returns:
the enabled state of error logging

trace

public void trace(String message)
Log a debug message is trace mode is enabled.

Specified by:
trace in interface Logger
Parameters:
message - the message to log

debug

public void debug(String message)
Log a debug message is debug mode is enabled.

Specified by:
debug in interface Logger
Parameters:
message - the message to log

info

public void info(String message)
Log a info level message.

Specified by:
info in interface Logger
Parameters:
message - the message to log

warn

public void warn(String message)
Record a warning message.

Specified by:
warn in interface Logger
Parameters:
message - the warning message to record

warn

public void warn(String message,
                 Throwable cause)
Record a warning message.

Specified by:
warn in interface Logger
Parameters:
message - the warning message to record
cause - the causal exception

error

public void error(String message)
Log a error message.

Specified by:
error in interface Logger
Parameters:
message - the message to log

error

public void error(String message,
                  Throwable e)
Log a error message.

Specified by:
error in interface Logger
Parameters:
message - the message to log
e - the causal exception

getChildLogger

public Logger getChildLogger(String category)
Return a child logger.

Specified by:
getChildLogger in interface Logger
Parameters:
category - the sub-category name.
Returns:
the child logging channel

notify

public void notify(URL resource,
                   int total,
                   int count)
Handle download notification.

Specified by:
notify in interface Adapter
Parameters:
resource - the resource under attention
total - the estimated download size
count - the progress towards expected