public static final String FAILED_DATA_TABLE_NAME = "FailedData"; //$NON-NLS-1$
/* thread names */
- public static final String LOG_QUEUE_OBSERVING_THREAD = "Log Queue Observing thread"; //$NON-NLS-1$
- public static final String COMMUNICATOR_RECEIVE_THREAD = "Communicator Receive Thread"; //$NON-NLS-1$
+ public static final String LOG_QUEUE_OBSERVING_THREAD = "Log parser thread"; //$NON-NLS-1$
+ public static final String COMMUNICATOR_RECEIVE_THREAD = "Data channel recv thread"; //$NON-NLS-1$
public static final String MESSAGE_INTERNAL_IMAGE_THREAD = "Internal Image Process Thread"; //$NON-NLS-1$
public static final String STOP_LOG_THREAD = "Stop Log Thread"; //$NON-NLS-1$
public static final String BATTERY_RECEIVE_THREAD = "Battery Receive Thread"; //$NON-NLS-1$
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.constant.CommonConstants;
import org.tizen.dynamicanalyzer.util.Logger;
public abstract class PageDataManager implements Runnable {
- private String name = null;
+ protected String name = null;
private Thread thread = null;
private BlockingQueue<LogPackage> logPackQueue = new LinkedBlockingQueue<LogPackage>();
private enum State {
- NOT_RUNNING,
- RUNNING,
- TO_BE_STOPED
+ NOT_RUNNING, RUNNING, TO_BE_STOPED
}
private State state = State.NOT_RUNNING;
public final String getName() {
if (name == null) {
- name = getClass().getName();
+ String[] tnames = getClass().getName().split(CommonConstants.CMD_SPLIT_DOT);
+ name = tnames[tnames.length - 1];
}
return name;
}
-
+
public final void updateLog(LogPackage logPack) {
try {
logPackQueue.put(logPack);
LogPackage pack = null;
try {
if (state == State.RUNNING)
- pack = logPackQueue.take(); // wait if empty
+ pack = logPackQueue.take(); // wait if empty
else if (state == State.TO_BE_STOPED)
- pack = logPackQueue.poll(); // return null if empty
+ pack = logPackQueue.poll(); // return null if empty
} catch (InterruptedException e) {
e.printStackTrace();
}
-
+
return pack;
}
}
// "called stopThread" means that there is no more data
- // coming in this page data manager
+ // coming in this page data manager
// It means that this function should be called only in data offerer
// when all data offer is finished.
public synchronized final void stopThread() {
private void sendNotify() {
LogPackage endOfStream = new LogPackage();
endOfStream.setEndOfStream();
-
+
try {
logPackQueue.put(endOfStream);
} catch (InterruptedException e) {
makeData(pack);
}
-
+
onThreadStop();
/* log for debug */