Top Description Fields Constructors Methods
org.apache.log.output

public abstract Class AbstractTarget

extends Object
implements LogTarget, ErrorAware, Closeable
Class Inheritance
All Implemented Interfaces
org.apache.log.util.Closeable, org.apache.log.ErrorAware, org.apache.log.LogTarget
Known Direct Subclasses
org.apache.log.output.AbstractWrappingTarget, org.apache.log.output.MemoryTarget, org.apache.log.output.PriorityFilteringTarget, org.apache.log.output.db.AbstractJDBCTarget, org.apache.log.output.jms.AbstractJMSTarget, org.apache.log.output.AbstractOutputTarget
Imports
org.apache.log.ErrorAware, .ErrorHandler, .LogEvent, .LogTarget, org.apache.log.util.Closeable, .DefaultErrorHandler

Abstract target.
Authors
Avalon Development Team, Peter Donald

Field Summary

Modifier and TypeField and Description
private static final ErrorHandler
private ErrorHandler
private boolean

Constructor Summary

AccessConstructor and Description
public
AbstractTarget()

AbstractTarget constructor.

public
AbstractTarget(final ErrorHandler
the error handler
errorHandler
)

AbstractTarget constructor.

Method Summary

Modifier and TypeMethod and Description
public synchronized void
close()

Implements org.apache.log.util.Closeable.close.

Shutdown target.
protected abstract void
doProcessEvent(LogEvent
the log event
event
)

Process a log event, via formatting and outputting it.

protected final ErrorHandler

Returns:

the ErrorHandler
getErrorHandler
()

Helper method to retrieve ErrorHandler for subclasses.

protected synchronized boolean

Returns:

TRUE if the target is open else FALSE
isOpen
()

Return the open state of the target.

protected synchronized void
open()

Startup log session.

public synchronized void
processEvent(final LogEvent
the log event
event
)

Implements org.apache.log.LogTarget.processEvent.

Process a log event, via formatting and outputting it.
public synchronized void
setErrorHandler(final ErrorHandler
the errorHandler
errorHandler
)

Implements org.apache.log.ErrorAware.setErrorHandler.

Provide component with ErrorHandler.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULT_ERROR_HANDLERback to summary
private static final ErrorHandler DEFAULT_ERROR_HANDLER
m_errorHandlerback to summary
private ErrorHandler m_errorHandler
m_isOpenback to summary
private boolean m_isOpen

Constructor Detail

AbstractTargetback to summary
public AbstractTarget()

AbstractTarget constructor.

AbstractTargetback to summary
public AbstractTarget(final ErrorHandler errorHandler)

AbstractTarget constructor.

Parameters
errorHandler:ErrorHandler

the error handler

Method Detail

closeback to summary
public synchronized void close()

Implements org.apache.log.util.Closeable.close.

Shutdown target. Attempting to write to target after close() will cause errors to be logged.

doProcessEventback to summary
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:LogEvent

the log event

Exceptions
Exception:
if an event processing error occurs
getErrorHandlerback to summary
protected final ErrorHandler getErrorHandler()

Helper method to retrieve ErrorHandler for subclasses.

Returns:ErrorHandler

the ErrorHandler

isOpenback to summary
protected synchronized boolean isOpen()

Return the open state of the target.

Returns:boolean

TRUE if the target is open else FALSE

openback to summary
protected synchronized void open()

Startup log session.

processEventback to summary
public synchronized void processEvent(final LogEvent event)

Implements org.apache.log.LogTarget.processEvent.

Process a log event, via formatting and outputting it.

Parameters
event:LogEvent

the log event

setErrorHandlerback to summary
public synchronized void setErrorHandler(final ErrorHandler errorHandler)

Implements org.apache.log.ErrorAware.setErrorHandler.

Provide component with ErrorHandler.

Parameters
errorHandler:ErrorHandler

the errorHandler