Search in sources :

Example 1 with ThreadLocalAppenderRunnable

use of com.revolsys.logging.log4j.ThreadLocalAppenderRunnable in project com.revolsys.open by revolsys.

the class ProcessNetwork method start.

private synchronized void start(final Process process) {
    if (this.parent == null) {
        if (this.processes != null) {
            Thread thread = this.processes.get(process);
            if (thread == null) {
                final Process runProcess;
                if (process instanceof TargetBeanProcess) {
                    final TargetBeanProcess targetBeanProcess = (TargetBeanProcess) process;
                    runProcess = targetBeanProcess.getProcess();
                    this.processes.remove(process);
                } else {
                    runProcess = process;
                }
                final Runnable runnable = new ProcessRunnable(this, runProcess);
                final String name = runProcess.toString();
                final Runnable appenderRunnable = new ThreadLocalAppenderRunnable(runnable);
                thread = new Thread(this.threadGroup, appenderRunnable, name);
                this.processes.put(runProcess, thread);
                if (!thread.isAlive()) {
                    thread.start();
                    this.count++;
                }
            }
        }
    }
}
Also used : TargetBeanProcess(com.revolsys.spring.TargetBeanProcess) ThreadLocalAppenderRunnable(com.revolsys.logging.log4j.ThreadLocalAppenderRunnable) ThreadLocalAppenderRunnable(com.revolsys.logging.log4j.ThreadLocalAppenderRunnable) TargetBeanProcess(com.revolsys.spring.TargetBeanProcess)

Aggregations

ThreadLocalAppenderRunnable (com.revolsys.logging.log4j.ThreadLocalAppenderRunnable)1 TargetBeanProcess (com.revolsys.spring.TargetBeanProcess)1