Building a 'Job Monitoring' View


I am currently trying to build a ‘Job Monitoring’ View using Quartz.
But I am experiencing some problems.

My first approach was simple: Just let the JobsView implement JobListener and add it to the scheduler.
This is not possible, since the newly added instance overwrites the old one.

Now I tried it with a GlobalListener, defined in the and Broadcast the event to all listeners and then push the changes to the view using the EventBus.

This wont work either, because the BroadcastListener can’t get the CurrentUI.

public static DashboardEventBus getDashboardEventbus() { return ((DashboardUI) getCurrent()).dashboardEventbus; } returns Null and causes a NullPointerException.

To clarify it a bit:

class DashboardUI extends UI implements Broadcaster.BroadcastListener {

init() ....

public void broadcastTest(String msg) { DashboardEvent.Test(msg)); --- NullPointer happens here

public void receiveTest(Final DashboardEvent.Test event) {

public class SchedulerGlobalListener implements JobListener {
//Gets initialized by (org.quartz.jobListener.SchedulerGlobalListener.class = ... )
public void jobWasExecuted(JobExecutionContext context, JobExecutionException jobException) {
    Broadcaster.broadcastTest("Job was executed ");

I hope my post isn’t gibberish to you guys.
Thanks for any tips and pointers.

Would it be possible to have the EventBus in it’s own Singleton from which the EventBus is gotten for both the UI and scheduler?

public class DashboardEventBus {
private EventBus eventBus = new EventBus();
private static DashboardEventBus instance;

protected DashboardEventBus() {}

public static DasboardEventBus getInstance() {
if(instance == null) {
instance = new DashboardEventBus();
return instance;
public static EventBus getDashboardEventbus() {
return getInstance().eventBus;
[/code]Then the work of the UI would be to register itself on init and unregister on close.

class DashbboardUI extends UI {
…close() {

public void recieve(…) {…}
[/code]The scheduler would then just need to post and all UI’s listening would get the event:

DashboardEventBus.getDashboardEventBus().post(new DashboardEvent.Test(msg));