use of com.centurylink.mdw.designer.runtime.LogSubscriberSocket in project mdw-designer by CenturyLinkCloud.
the class LogWatcher method startup.
public void startup(boolean watchProcess) {
this.watchProcess = watchProcess;
if (logListener != null)
// already started
return;
pattern = Pattern.compile(MESSAGE_REG_EX, Pattern.DOTALL);
processInstancePages = new HashMap<Long, ProcessInstancePage>();
processInstances = new HashMap<Long, ProcessInstanceVO>();
accumulated = new LinkedList<ProcessInstanceUpdater>();
scheduleShutdown = false;
MessageConsole console = MessageConsole.findConsole("Live View Log", icon, display);
console.setRunnableEntity(this);
console.setDefaultShowPref(true);
console.setStatus(MessageConsole.STATUS_RUNNING);
console.clearConsole();
outputStream = console.newMessageStream();
try {
dataAccess = new DesignerDataAccess(process.getProject().getDesignerProxy().getDesignerDataAccess());
logListener = new LogSubscriberSocket(dataAccess, serverSettings.getLogWatcherPort(), process.getProject().isOldNamespaces()) {
protected void handleMessage(String message) {
handleLogMessage(message);
}
};
logListener.start(true);
new Thread(new Runnable() {
public void run() {
processQueue();
}
}).start();
} catch (Exception ex) {
if (outputStream != null)
ex.printStackTrace(new PrintStream(outputStream));
if (logListener != null && !logListener.isClosed()) {
logListener.shutdown();
logListener = null;
}
PluginMessages.uiError(ex, "Monitor Logs", process.getProject());
}
}
Aggregations