Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

TUTORIALVaadin lets you build secure, UX-first PWAs entirely in Java.
Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Calling javascript synchronously by Enver Haase, 2 weeks ago
Static like access wirh ThreadLocal Problem
Hi,
I followed this guide from this page ThreadLocal Example.
public static void addLog(String s)
{
if (VMPortal.getInstance() != null && VMPortal.getInstance().getEventBus() != null)
VMPortal.getInstance().getEventBus().post(new AddLogEvent(s));
}
I used ThreadLocal for having a static-like function for adding Strings to a Log window. This works well unless I create a worker-Thread which needs add Strings to the log.
Does someone have a tip how my worker thread could get access to my log (without needing the reference of my Application)?
Last updated on Jun, 29th 2012
You cannot reply to this thread.