Openfire 3.3.2 Javadoc

org.jivesoftware.util.log.output
Class AbstractTarget

java.lang.Object
  extended by org.jivesoftware.util.log.output.AbstractTarget
All Implemented Interfaces:
ErrorAware, LogTarget
Direct Known Subclasses:
AbstractOutputTarget, AsyncLogTarget

public abstract class AbstractTarget
extends Object
implements LogTarget, ErrorAware

Abstract target.

Author:
Peter Donald

Constructor Summary
AbstractTarget()
           
 
Method Summary
 void close()
          Shutdown target.
protected abstract  void doProcessEvent(LogEvent event)
          Process a log event, via formatting and outputting it.
protected  void error(String message, Throwable throwable)
          Deprecated. Use getErrorHandler().error(...) directly
protected  ErrorHandler getErrorHandler()
          Helper method to retrieve ErrorHandler for subclasses.
protected  boolean isOpen()
           
protected  void open()
          Startup log session.
 void processEvent(LogEvent event)
          Process a log event, via formatting and outputting it.
 void setErrorHandler(ErrorHandler errorHandler)
          Provide component with ErrorHandler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractTarget

public AbstractTarget()
Method Detail

setErrorHandler

public void setErrorHandler(ErrorHandler errorHandler)
Provide component with ErrorHandler.

Specified by:
setErrorHandler in interface ErrorAware
Parameters:
errorHandler - the errorHandler

isOpen

protected boolean isOpen()

open

protected void open()
Startup log session.


processEvent

public void processEvent(LogEvent event)
Process a log event, via formatting and outputting it.

Specified by:
processEvent in interface LogTarget
Parameters:
event - the log event

doProcessEvent

protected abstract void doProcessEvent(LogEvent event)
                                throws Exception
Process a log event, via formatting and outputting it. This should be overidden by subclasses.

Parameters:
event - the log event
Throws:
Exception

close

public void close()
Shutdown target. Attempting to send to target after close() will cause errors to be logged.


getErrorHandler

protected final ErrorHandler getErrorHandler()
Helper method to retrieve ErrorHandler for subclasses.

Returns:
the ErrorHandler

error

protected final void error(String message,
                           Throwable throwable)
Deprecated. Use getErrorHandler().error(...) directly

Helper method to send error messages to error handler.

Parameters:
message - the error message
throwable - the exception if any

Openfire 3.3.2 Javadoc

Copyright © 2003-2007 Jive Software.