|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.log4j.AppenderSkeleton
org.semanticweb.elk.util.logging.MessageDialogAppender
public class MessageDialogAppender
A Log4J Appender that creates dialogs in order to "log" messages. Like all Log4J loggers, this logger can be set to report only messages above a certain threshold using setThreshold(). The default threshold is WARN. Only one dialog is shown at any single time: the user has to close it before getting the next. The display of message dialogs is controlled by an independent thread, so that the code that reports a message does not have to wait for the user to close dialogs. Incoming events are queued and processed in order. For events of type ElkMessage (rather than plain String), the appender allows to filter by message type, that is, it offers the user the option to not show such messages again. Here, "such messages" means messages of the same message type.
| Field Summary | |
|---|---|
protected ConcurrentLinkedQueue<org.apache.log4j.spi.LoggingEvent> |
eventBuffer
|
protected Set<String> |
ignoredMessageTypes
|
protected AtomicReference<String> |
messengerThreadName
|
| Fields inherited from class org.apache.log4j.AppenderSkeleton |
|---|
closed, errorHandler, headFilter, layout, name, tailFilter, threshold |
| Constructor Summary | |
|---|---|
MessageDialogAppender()
|
|
| Method Summary | |
|---|---|
protected void |
append(org.apache.log4j.spi.LoggingEvent event)
Append a logging event. |
void |
close()
Shut down. |
protected void |
ensureMessengerRuns()
Make sure that a messenger thread is run. |
protected String |
getCheckboxMessage(org.apache.log4j.spi.LoggingEvent event)
Generate the additional check box message specific to the given event |
protected void |
initConfiguration()
|
boolean |
requiresLayout()
|
void |
run()
Display messages until none are left to display. |
protected boolean |
showMessage(org.apache.log4j.spi.LoggingEvent event)
Display a dialog window to inform the user about one message event. |
| Methods inherited from class org.apache.log4j.AppenderSkeleton |
|---|
activateOptions, addFilter, clearFilters, doAppend, finalize, getErrorHandler, getFilter, getFirstFilter, getLayout, getName, getThreshold, isAsSevereAsThreshold, setErrorHandler, setLayout, setName, setThreshold |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final ConcurrentLinkedQueue<org.apache.log4j.spi.LoggingEvent> eventBuffer
protected final AtomicReference<String> messengerThreadName
protected final Set<String> ignoredMessageTypes
| Constructor Detail |
|---|
public MessageDialogAppender()
| Method Detail |
|---|
protected void initConfiguration()
public void close()
close in interface org.apache.log4j.Appenderclose in class org.apache.log4j.AppenderSkeletonpublic boolean requiresLayout()
requiresLayout in interface org.apache.log4j.AppenderrequiresLayout in class org.apache.log4j.AppenderSkeletonprotected void append(org.apache.log4j.spi.LoggingEvent event)
append in class org.apache.log4j.AppenderSkeletonprotected void ensureMessengerRuns()
protected String getCheckboxMessage(org.apache.log4j.spi.LoggingEvent event)
event - the event for which the check box message should be generated
protected boolean showMessage(org.apache.log4j.spi.LoggingEvent event)
event - the event for which to display the message
true if the message has been shownpublic void run()
run in interface Runnable
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||