From 3fe924fdcb1fa71075727a8ca0b707b6f9d31da0 Mon Sep 17 00:00:00 2001 From: SeokYeon Hwang Date: Fri, 12 Jun 2015 12:17:34 +0900 Subject: [PATCH] job: overseer can be named now Change-Id: Ibabceced8cba0c905e88cd8ef5f2f809865fa054 Signed-off-by: SeokYeon Hwang --- src/org/tizen/emulator/manager/EmulatorManager.java | 2 +- src/org/tizen/emulator/manager/job/Overseer.java | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/org/tizen/emulator/manager/EmulatorManager.java b/src/org/tizen/emulator/manager/EmulatorManager.java index c0e3bc8..2dee27d 100755 --- a/src/org/tizen/emulator/manager/EmulatorManager.java +++ b/src/org/tizen/emulator/manager/EmulatorManager.java @@ -304,7 +304,7 @@ public class EmulatorManager { exitEmulatorManager(1); } - Overseer startupOverseer = Overseer.newOverseer(InitAboutContents.class, + Overseer startupOverseer = Overseer.newOverseer("Start-up", InitAboutContents.class, CheckVT.class, CheckSDCard.class); startupOverseer.startWork(); // FIXME: we should not join overseer thread. diff --git a/src/org/tizen/emulator/manager/job/Overseer.java b/src/org/tizen/emulator/manager/job/Overseer.java index 111efee..3134c86 100644 --- a/src/org/tizen/emulator/manager/job/Overseer.java +++ b/src/org/tizen/emulator/manager/job/Overseer.java @@ -40,6 +40,7 @@ public class Overseer { private final List> jobClasses = new ArrayList>(); private Thread overseerThread; private CountDownLatch doneSignal; + private String name; private Overseer() {}; @@ -58,8 +59,9 @@ public class Overseer { } @SafeVarargs - public static Overseer newOverseer(Class... jobClasses) { + public static Overseer newOverseer(String name, Class... jobClasses) { Overseer overseer = new Overseer(); + overseer.name = name; for (Class jobCls: jobClasses) { overseer.registerJob(jobCls); @@ -69,10 +71,10 @@ public class Overseer { } public void startWork() throws InterruptedException { - EMLogger.getLogger().log(Level.INFO, "is starting..."); + EMLogger.getLogger().log(Level.INFO, "Overseer [" + name + "] is starting..."); if (overseerThread != null) { // already started - assert false : "Already started !!!"; // for debugging... + assert false : "Overseer [" + name + "] already started !!!"; // for debugging... return; } @@ -89,6 +91,8 @@ public class Overseer { }); overseerThread.start(); + + EMLogger.getLogger().log(Level.INFO, "Overseer [" + name + "] is done..."); } public void join() throws InterruptedException { -- 2.7.4