From 8568d6ee05fc254f12f20da0698dbf4f9e674bc4 Mon Sep 17 00:00:00 2001 From: James Strachan Date: Wed, 8 Mar 2006 12:09:49 +0000 Subject: [PATCH] minor refactor to make it easier to override starting git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@384193 13f79535-47bb-0310-9956-ffa450edef68 --- .../transport/TransportServerThreadSupport.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/TransportServerThreadSupport.java b/activemq-core/src/main/java/org/apache/activemq/transport/TransportServerThreadSupport.java index ddfb0e7127..1fde3cbc5f 100644 --- a/activemq-core/src/main/java/org/apache/activemq/transport/TransportServerThreadSupport.java +++ b/activemq-core/src/main/java/org/apache/activemq/transport/TransportServerThreadSupport.java @@ -50,11 +50,7 @@ public abstract class TransportServerThreadSupport extends TransportServerSuppor public void start() throws Exception { if (started.compareAndSet(false, true)) { - log.info("Listening for connections at: " + getLocation()); - runner = new Thread(this, toString()); - runner.setDaemon(daemon); - runner.setPriority(ThreadPriorities.BROKER_MANAGEMENT); - runner.start(); + doStart(); } } @@ -117,5 +113,13 @@ public abstract class TransportServerThreadSupport extends TransportServerSuppor this.joinOnStop = joinOnStop; } + protected void doStart() { + log.info("Listening for connections at: " + getLocation()); + runner = new Thread(this, toString()); + runner.setDaemon(daemon); + runner.setPriority(ThreadPriorities.BROKER_MANAGEMENT); + runner.start(); + } + protected abstract void doStop(ServiceStopper stopper) throws Exception; }