org.eclipse.datatools.connectivity.oda.util.logging
Class Handler

java.lang.Object
  extended by org.eclipse.datatools.connectivity.oda.util.logging.Handler
Direct Known Subclasses:
StreamHandler

public abstract class Handler
extends java.lang.Object

Handler is an abstract class that takes LogRecords from a Logger and processes them using its Formatter. All log handler should inherit from this class and may publish log records to its supported sources. (e.g. console, file, etc. )


Method Summary
abstract  void close()
          Close the Handler and free up resources.
abstract  void flush()
          Flushes buffered output.
 Filter getFilter()
          Gets the Filter associated with this Handler.
 LogFormatter getFormatter()
          Gets the LogFormatter associated with this Handler.
 Level getLevel()
          Gets the Level associated with this Handler.
 LoggingErrorHandler getLoggingErrorHandler()
          Gets the LoggingErrorHandler associated with this Handler.
 boolean isLoggable(LogRecord record)
          Checks whether the specified LogRecord should be logged.
abstract  void publish(LogRecord record)
          Publish the specified LogRecord.
 void setFilter(Filter filter)
          Sets the Filter for this Handler.
 void setFormatter(LogFormatter formatter)
          Sets the LogFormatter for this Handler.
 void setLevel(Level level)
          Sets the Level for this Handler.
 void setLoggingErrorHandler(LoggingErrorHandler errorHandler)
          Sets the LoggingErrorHandler for this Handler.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

close

public abstract void close()
Close the Handler and free up resources.


flush

public abstract void flush()
Flushes buffered output.


publish

public abstract void publish(LogRecord record)
Publish the specified LogRecord. The record should only be published if it has the adequate log level, passes the associated Filter. This is responsible for formatting the LogRecord, if necessary.

Parameters:
record - the log record to publish.

isLoggable

public boolean isLoggable(LogRecord record)
Checks whether the specified LogRecord should be logged. This checks whether the LogRecord has the adequate log level, passes the associated Filter, or other Handler specific checks.

Parameters:
record - the log record.
Returns:
true if the log record should be logged.

setLoggingErrorHandler

public void setLoggingErrorHandler(LoggingErrorHandler errorHandler)
Sets the LoggingErrorHandler for this Handler.

Parameters:
errorHandler - the error handler to set.

getLoggingErrorHandler

public LoggingErrorHandler getLoggingErrorHandler()
Gets the LoggingErrorHandler associated with this Handler.

Returns:
the associated error handler.

setFilter

public void setFilter(Filter filter)
Sets the Filter for this Handler.

Parameters:
filter - the filter to set.

getFilter

public Filter getFilter()
Gets the Filter associated with this Handler.

Returns:
the associated filter.

setFormatter

public void setFormatter(LogFormatter formatter)
Sets the LogFormatter for this Handler.

Parameters:
formatter - the formatter to set.

getFormatter

public LogFormatter getFormatter()
Gets the LogFormatter associated with this Handler.

Returns:
the associated formatter.

setLevel

public void setLevel(Level level)
Sets the Level for this Handler.

Parameters:
level - the level to set.

getLevel

public Level getLevel()
Gets the Level associated with this Handler.

Returns:
the associated level.