diff --git a/plugins/org.eclipse.glsp.server/src/org/eclipse/glsp/server/internal/actions/DefaultActionDispatcher.java b/plugins/org.eclipse.glsp.server/src/org/eclipse/glsp/server/internal/actions/DefaultActionDispatcher.java index 4f26f60c..0c2aa34b 100644 --- a/plugins/org.eclipse.glsp.server/src/org/eclipse/glsp/server/internal/actions/DefaultActionDispatcher.java +++ b/plugins/org.eclipse.glsp.server/src/org/eclipse/glsp/server/internal/actions/DefaultActionDispatcher.java @@ -26,10 +26,9 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; +import java.util.logging.LogManager; import java.util.stream.Collectors; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; import org.eclipse.glsp.server.actions.Action; import org.eclipse.glsp.server.actions.ActionDispatcher; import org.eclipse.glsp.server.actions.ActionHandler; @@ -87,11 +86,23 @@ public class DefaultActionDispatcher extends Disposable implements ActionDispatc protected Provider client; public DefaultActionDispatcher() { + this.initialize(); + } + + protected void initialize() { this.name = getClass().getSimpleName() + " " + COUNT.incrementAndGet(); - this.thread = new Thread(this::runThread); - this.thread.setName(this.name); - this.thread.setDaemon(true); - this.thread.start(); + this.thread = this.createThread(); + this.initializeThread(thread, name); + thread.start(); + } + + protected Thread createThread() { + return new Thread(this::runThread); + } + + protected void initializeThread(final Thread thread, final String name) { + thread.setName(name); + thread.setDaemon(true); } @Override