logahawk.swing
Class EventDispatchThreadListener
java.lang.Object
logahawk.listeners.ProxyListener
logahawk.swing.EventDispatchThreadListener
- All Implemented Interfaces:
- Listener
public class EventDispatchThreadListener
- extends ProxyListener
Ensures that the proxied Listener is only called on the EDT.
This will use either SwingUtilities.invokeLater(Runnable) or SwingUtilities.invokeAndWait(Runnable)
depending on block. The benefit of using SwingUtilities.invokeAndWait(Runnable) the application
needs to pause and wait for the user to do something before continuing -- insert a new disk, remove a disk before
reboot, connect a peripheral, change a tape, etc. (Note that you cannot block if you are using something like
BlockingQueueLogger.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
block
protected final boolean block
- If true this will use
SwingUtilities.invokeAndWait(Runnable), blocking the calling thread. Default
value is false.
EventDispatchThreadListener
public EventDispatchThreadListener(Listener listener)
EventDispatchThreadListener
public EventDispatchThreadListener(Listener listener,
boolean block)
log
public void log(LogMeta meta,
String text)
- Description copied from interface:
Listener
- Logs the provided statement.
Normally this method should not throw any exceptions. If exceptions are expected it is recommend to wrap this
Listener with a FailSafeListener.