diff --git a/bundles/org.openhab.binding.androidtv/src/main/java/org/openhab/binding/androidtv/internal/protocol/googletv/GoogleTVConnectionManager.java b/bundles/org.openhab.binding.androidtv/src/main/java/org/openhab/binding/androidtv/internal/protocol/googletv/GoogleTVConnectionManager.java index 1ba30cb807472..0724f3f95fa33 100644 --- a/bundles/org.openhab.binding.androidtv/src/main/java/org/openhab/binding/androidtv/internal/protocol/googletv/GoogleTVConnectionManager.java +++ b/bundles/org.openhab.binding.androidtv/src/main/java/org/openhab/binding/androidtv/internal/protocol/googletv/GoogleTVConnectionManager.java @@ -579,7 +579,8 @@ public void connect() { logger.trace("{} - Starting Reader Thread for {}:{}", handler.getThingID(), config.ipAddress, config.googletvPort); - Thread readerThread = new Thread(this::readerThreadJob, "GoogleTV reader " + handler.getThingID()); + Thread readerThread = new Thread(this::readerThreadJob, + "OH-binding-" + handler.getThingUID() + "-GoogleTVReader"); readerThread.setDaemon(true); readerThread.start(); this.readerThread = readerThread; @@ -587,7 +588,8 @@ public void connect() { logger.trace("{} - Starting Sender Thread for {}:{}", handler.getThingID(), config.ipAddress, config.googletvPort); - Thread senderThread = new Thread(this::senderThreadJob, "GoogleTV sender " + handler.getThingID()); + Thread senderThread = new Thread(this::senderThreadJob, + "OH-binding-" + handler.getThingUID() + "-GoogleTVSender"); senderThread.setDaemon(true); senderThread.start(); this.senderThread = senderThread; @@ -698,12 +700,14 @@ public void shimInitialize() { this.shimServerSocket = serverSocket; this.shimQueue.clear(); - Thread readerThread = new Thread(this::shimReaderThreadJob, "GoogleTV shim reader"); + Thread readerThread = new Thread(this::shimReaderThreadJob, + "OH-binding-" + handler.getThingUID() + "-GoogleTVShimReader"); readerThread.setDaemon(true); readerThread.start(); this.shimReaderThread = readerThread; - Thread senderThread = new Thread(this::shimSenderThreadJob, "GoogleTV shim sender"); + Thread senderThread = new Thread(this::shimSenderThreadJob, + "OH-binding-" + handler.getThingUID() + "-GoogleTVShimSender"); senderThread.setDaemon(true); senderThread.start(); this.shimSenderThread = senderThread; diff --git a/bundles/org.openhab.binding.androidtv/src/main/java/org/openhab/binding/androidtv/internal/protocol/shieldtv/ShieldTVConnectionManager.java b/bundles/org.openhab.binding.androidtv/src/main/java/org/openhab/binding/androidtv/internal/protocol/shieldtv/ShieldTVConnectionManager.java index 0c79a8f04c558..bf6f173a2801e 100644 --- a/bundles/org.openhab.binding.androidtv/src/main/java/org/openhab/binding/androidtv/internal/protocol/shieldtv/ShieldTVConnectionManager.java +++ b/bundles/org.openhab.binding.androidtv/src/main/java/org/openhab/binding/androidtv/internal/protocol/shieldtv/ShieldTVConnectionManager.java @@ -443,12 +443,14 @@ public void connect() { setStatus(false, "offline.initializing"); - Thread readerThread = new Thread(this::readerThreadJob, "ShieldTV reader " + handler.getThingID()); + Thread readerThread = new Thread(this::readerThreadJob, + "OH-binding-" + handler.getThingUID() + "-ShieldTVReader"); readerThread.setDaemon(true); readerThread.start(); this.readerThread = readerThread; - Thread senderThread = new Thread(this::senderThreadJob, "ShieldTV sender " + handler.getThingID()); + Thread senderThread = new Thread(this::senderThreadJob, + "OH-binding-" + handler.getThingUID() + "-ShieldTVSender"); senderThread.setDaemon(true); senderThread.start(); this.senderThread = senderThread; @@ -513,13 +515,13 @@ public void shimInitialize() { this.shimServerSocket = serverSocket; Thread readerThread = new Thread(this::shimReaderThreadJob, - "ShieldTV shim reader " + handler.getThingID()); + "OH-binding-" + handler.getThingUID() + "-ShieldTVShimReader"); readerThread.setDaemon(true); readerThread.start(); this.shimReaderThread = readerThread; Thread senderThread = new Thread(this::shimSenderThreadJob, - "ShieldTV shim sender" + handler.getThingID()); + "OH-binding-" + handler.getThingUID() + "-ShieldTVShimSender"); senderThread.setDaemon(true); senderThread.start(); this.shimSenderThread = senderThread; diff --git a/bundles/org.openhab.binding.anthem/src/main/java/org/openhab/binding/anthem/internal/handler/AnthemHandler.java b/bundles/org.openhab.binding.anthem/src/main/java/org/openhab/binding/anthem/internal/handler/AnthemHandler.java index 4ea2e505322bd..24445dc02590a 100644 --- a/bundles/org.openhab.binding.anthem/src/main/java/org/openhab/binding/anthem/internal/handler/AnthemHandler.java +++ b/bundles/org.openhab.binding.anthem/src/main/java/org/openhab/binding/anthem/internal/handler/AnthemHandler.java @@ -242,12 +242,12 @@ private synchronized void connect() { scheduleConnectRetry(reconnectIntervalMinutes); return; } - Thread localReaderThread = new Thread(this::readerThreadJob, "Anthem reader"); + Thread localReaderThread = new Thread(this::readerThreadJob, "OH-binding-" + getThing().getUID() + "-Reader"); localReaderThread.setDaemon(true); localReaderThread.start(); this.readerThread = localReaderThread; - Thread localSenderThread = new Thread(this::senderThreadJob, "Anthem sender"); + Thread localSenderThread = new Thread(this::senderThreadJob, "OH-binding-" + getThing().getUID() + "-Sender"); localSenderThread.setDaemon(true); localSenderThread.start(); this.senderThread = localSenderThread; diff --git a/bundles/org.openhab.binding.argoclima/src/main/java/org/openhab/binding/argoclima/internal/device/passthrough/RemoteArgoApiServerStub.java b/bundles/org.openhab.binding.argoclima/src/main/java/org/openhab/binding/argoclima/internal/device/passthrough/RemoteArgoApiServerStub.java index ce3adcbd489fd..64dd206e9aa6e 100644 --- a/bundles/org.openhab.binding.argoclima/src/main/java/org/openhab/binding/argoclima/internal/device/passthrough/RemoteArgoApiServerStub.java +++ b/bundles/org.openhab.binding.argoclima/src/main/java/org/openhab/binding/argoclima/internal/device/passthrough/RemoteArgoApiServerStub.java @@ -290,7 +290,7 @@ public synchronized void start() throws ArgoRemoteServerStubStartupException { // to stop, actually) s.setStopTimeout(1000L); try { - new Thread() { + new Thread("OH-binding-" + this.id + "-APIStub") { @Override public void run() { try { diff --git a/bundles/org.openhab.binding.echonetlite/src/main/java/org/openhab/binding/echonetlite/internal/EchonetLiteBridgeHandler.java b/bundles/org.openhab.binding.echonetlite/src/main/java/org/openhab/binding/echonetlite/internal/EchonetLiteBridgeHandler.java index 078e0cf7bb4c6..11bc6334dc7fe 100644 --- a/bundles/org.openhab.binding.echonetlite/src/main/java/org/openhab/binding/echonetlite/internal/EchonetLiteBridgeHandler.java +++ b/bundles/org.openhab.binding.echonetlite/src/main/java/org/openhab/binding/echonetlite/internal/EchonetLiteBridgeHandler.java @@ -52,7 +52,8 @@ public class EchonetLiteBridgeHandler extends BaseBridgeHandler { private final ArrayBlockingQueue requests = new ArrayBlockingQueue<>(1024); private final Map devicesByKey = new HashMap<>(); private final EchonetMessageBuilder messageBuilder = new EchonetMessageBuilder(); - private final Thread networkingThread = new Thread(this::poll); + private final Thread networkingThread = new Thread(this::poll, + "OH-binding-" + EchonetLiteBindingConstants.BINDING_ID); private final EchonetMessage echonetMessage = new EchonetMessage(); private final MonotonicClock clock = new MonotonicClock(); @@ -76,8 +77,6 @@ private void start(final InstanceKey managementControllerKey, InstanceKey discov logger.debug("Binding echonet channel"); echonetChannel = new EchonetChannel(discoveryKey.address); logger.debug("Starting networking thread"); - - networkingThread.setName("OH-binding-" + EchonetLiteBindingConstants.BINDING_ID); networkingThread.setDaemon(true); networkingThread.start(); } diff --git a/bundles/org.openhab.binding.ekey/src/main/java/org/openhab/binding/ekey/internal/api/EkeyUdpPacketReceiver.java b/bundles/org.openhab.binding.ekey/src/main/java/org/openhab/binding/ekey/internal/api/EkeyUdpPacketReceiver.java index 8648ca2eb5c13..cf58c3d5876ff 100644 --- a/bundles/org.openhab.binding.ekey/src/main/java/org/openhab/binding/ekey/internal/api/EkeyUdpPacketReceiver.java +++ b/bundles/org.openhab.binding.ekey/src/main/java/org/openhab/binding/ekey/internal/api/EkeyUdpPacketReceiver.java @@ -48,10 +48,10 @@ public class EkeyUdpPacketReceiver { private boolean connected = false; - public EkeyUdpPacketReceiver(final String ipAddress, final int port, final String readerThreadName) { + public EkeyUdpPacketReceiver(final String ipAddress, final int port, final String thingUID) { this.ipAddress = ipAddress; this.port = port; - this.readerThreadName = readerThreadName; + this.readerThreadName = "OH-binding-" + thingUID; } public void openConnection() throws IOException { diff --git a/bundles/org.openhab.binding.ekey/src/main/java/org/openhab/binding/ekey/internal/handler/EkeyHandler.java b/bundles/org.openhab.binding.ekey/src/main/java/org/openhab/binding/ekey/internal/handler/EkeyHandler.java index cc9b3cbe369b1..ec5026f0d4338 100644 --- a/bundles/org.openhab.binding.ekey/src/main/java/org/openhab/binding/ekey/internal/handler/EkeyHandler.java +++ b/bundles/org.openhab.binding.ekey/src/main/java/org/openhab/binding/ekey/internal/handler/EkeyHandler.java @@ -82,10 +82,10 @@ public void initialize() { scheduler.submit(() -> { populateChannels(config.protocol); - String readerThreadName = "OH-binding-" + getThing().getUID().getAsString(); EkeyUdpPacketReceiver localReceiver = receiver = new EkeyUdpPacketReceiver( - Objects.requireNonNullElse(config.natIp, config.ipAddress), config.port, readerThreadName); + Objects.requireNonNullElse(config.natIp, config.ipAddress), config.port, + getThing().getUID().getAsString()); localReceiver.addEkeyPacketListener(this); try { localReceiver.openConnection(); diff --git a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/connection/Clip2Bridge.java b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/connection/Clip2Bridge.java index 59cd410a22b47..5799c8b9bc58c 100644 --- a/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/connection/Clip2Bridge.java +++ b/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/connection/Clip2Bridge.java @@ -70,6 +70,7 @@ import org.eclipse.jetty.util.Callback; import org.eclipse.jetty.util.Promise.Completable; import org.eclipse.jetty.util.ssl.SslContextFactory; +import org.openhab.binding.hue.internal.HueBindingConstants; import org.openhab.binding.hue.internal.api.dto.clip1.CreateUserRequest; import org.openhab.binding.hue.internal.api.dto.clip1.SuccessResponse; import org.openhab.binding.hue.internal.api.dto.clip2.BridgeConfig; @@ -397,7 +398,8 @@ public void onFailure(@Nullable Session session, @Nullable Throwable failure) { public void onGoAway(@Nullable Session session, @Nullable GoAwayFrame frame) { Objects.requireNonNull(session); if (session.equals(http2Session)) { - Thread recreateThread = new Thread(() -> recreateSession()); + Thread recreateThread = new Thread(() -> recreateSession(), + "OH-binding-" + HueBindingConstants.BINDING_ID + "-Clip2Bridge"); Clip2Bridge.this.recreateThread = recreateThread; recreateThread.start(); } diff --git a/bundles/org.openhab.binding.insteon/src/main/java/org/openhab/binding/insteon/internal/transport/LegacyPort.java b/bundles/org.openhab.binding.insteon/src/main/java/org/openhab/binding/insteon/internal/transport/LegacyPort.java index 664a1f8386938..28ee847c0be02 100644 --- a/bundles/org.openhab.binding.insteon/src/main/java/org/openhab/binding/insteon/internal/transport/LegacyPort.java +++ b/bundles/org.openhab.binding.insteon/src/main/java/org/openhab/binding/insteon/internal/transport/LegacyPort.java @@ -22,6 +22,7 @@ import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; +import org.openhab.binding.insteon.internal.InsteonBindingConstants; import org.openhab.binding.insteon.internal.InsteonLegacyBindingConstants; import org.openhab.binding.insteon.internal.config.InsteonLegacyNetworkConfiguration; import org.openhab.binding.insteon.internal.device.InsteonAddress; @@ -178,9 +179,9 @@ public void start() { } readThread = new Thread(reader); - setParamsAndStart(readThread, "Reader"); + setParamsAndStart(readThread, "OH-binding-" + InsteonBindingConstants.BINDING_ID + "-LegacyReader"); writeThread = new Thread(writer); - setParamsAndStart(writeThread, "Writer"); + setParamsAndStart(writeThread, "OH-binding-" + InsteonBindingConstants.BINDING_ID + "-LegacyWriter"); if (!mdbb.isComplete()) { modem.initialize(); diff --git a/bundles/org.openhab.binding.intesis/src/main/java/org/openhab/binding/intesis/internal/api/IntesisBoxSocketApi.java b/bundles/org.openhab.binding.intesis/src/main/java/org/openhab/binding/intesis/internal/api/IntesisBoxSocketApi.java index 55c249ba37567..a144b43a1748b 100644 --- a/bundles/org.openhab.binding.intesis/src/main/java/org/openhab/binding/intesis/internal/api/IntesisBoxSocketApi.java +++ b/bundles/org.openhab.binding.intesis/src/main/java/org/openhab/binding/intesis/internal/api/IntesisBoxSocketApi.java @@ -52,10 +52,10 @@ public class IntesisBoxSocketApi { private boolean connected = false; - public IntesisBoxSocketApi(final String ipAddress, final int port, final String readerThreadName) { + public IntesisBoxSocketApi(final String ipAddress, final int port, final String thingUID) { this.ipAddress = ipAddress; this.port = port; - this.readerThreadName = readerThreadName; + this.readerThreadName = "OH-binding-" + thingUID; } private class IntesisSocket { diff --git a/bundles/org.openhab.binding.intesis/src/main/java/org/openhab/binding/intesis/internal/handler/IntesisBoxHandler.java b/bundles/org.openhab.binding.intesis/src/main/java/org/openhab/binding/intesis/internal/handler/IntesisBoxHandler.java index 5a82a2e231899..db98feb252099 100644 --- a/bundles/org.openhab.binding.intesis/src/main/java/org/openhab/binding/intesis/internal/handler/IntesisBoxHandler.java +++ b/bundles/org.openhab.binding.intesis/src/main/java/org/openhab/binding/intesis/internal/handler/IntesisBoxHandler.java @@ -93,11 +93,8 @@ public void initialize() { if (!config.ipAddress.isEmpty()) { updateStatus(ThingStatus.UNKNOWN); scheduler.submit(() -> { - - String readerThreadName = "OH-binding-" + getThing().getUID().getAsString(); - IntesisBoxSocketApi intesisLocalApi = intesisBoxSocketApi = new IntesisBoxSocketApi(config.ipAddress, - config.port, readerThreadName); + config.port, getThing().getUID().getAsString()); intesisLocalApi.addIntesisBoxChangeListener(this); try { intesisLocalApi.openConnection(); diff --git a/bundles/org.openhab.binding.keba/src/main/java/org/openhab/binding/keba/internal/handler/KeContactTransceiver.java b/bundles/org.openhab.binding.keba/src/main/java/org/openhab/binding/keba/internal/handler/KeContactTransceiver.java index 2e2d4503d6814..315009c78d265 100644 --- a/bundles/org.openhab.binding.keba/src/main/java/org/openhab/binding/keba/internal/handler/KeContactTransceiver.java +++ b/bundles/org.openhab.binding.keba/src/main/java/org/openhab/binding/keba/internal/handler/KeContactTransceiver.java @@ -32,6 +32,7 @@ import java.util.Set; import java.util.concurrent.locks.ReentrantLock; +import org.openhab.binding.keba.internal.KebaBindingConstants; import org.openhab.core.thing.ThingStatus; import org.openhab.core.thing.ThingStatusDetail; import org.slf4j.Logger; @@ -71,7 +72,8 @@ public void start() { selector = Selector.open(); if (transceiverThread == null) { - transceiverThread = new Thread(transceiverRunnable, "OH-binding-Keba-Transceiver"); + transceiverThread = new Thread(transceiverRunnable, + "OH-binding-" + KebaBindingConstants.BINDING_ID + "-Transceiver"); transceiverThread.start(); } diff --git a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/security/LxWsSecurity.java b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/security/LxWsSecurity.java index e9f0d155f85fb..65bd792a96ac9 100644 --- a/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/security/LxWsSecurity.java +++ b/bundles/org.openhab.binding.loxone/src/main/java/org/openhab/binding/loxone/internal/security/LxWsSecurity.java @@ -86,7 +86,7 @@ public void authenticate(BiConsumer doneCallback) { authenticationLock.unlock(); } }; - new Thread(init).start(); + new Thread(init, "OH-binding-" + thingHandler.getThingId() + "-Authenticate").start(); } /** diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/IPBridgeHandler.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/IPBridgeHandler.java index 9ea61279430a2..6f8e7cddde02d 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/IPBridgeHandler.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/IPBridgeHandler.java @@ -216,7 +216,8 @@ private synchronized void connect() { sendCommand(new LIPCommand(TargetType.BRIDGE, LutronOperation.QUERY, LutronCommandType.SYSTEM, null, SYSTEM_DBEXPORTDATETIME)); - messageSender = new Thread(this::sendCommandsThread, "Lutron sender"); + messageSender = new Thread(this::sendCommandsThread, + "OH-binding-" + getBridge().getBridgeUID() + "-IPBridgeSender"); messageSender.start(); logger.debug("Starting keepAlive job with interval {}", heartbeatInterval); diff --git a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/LeapBridgeHandler.java b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/LeapBridgeHandler.java index 0bd9a24760cb8..13b0bdc2b9bb5 100644 --- a/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/LeapBridgeHandler.java +++ b/bundles/org.openhab.binding.lutron/src/main/java/org/openhab/binding/lutron/internal/handler/LeapBridgeHandler.java @@ -304,12 +304,14 @@ private synchronized void connect() { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.NONE, STATUS_INITIALIZING); - Thread readerThread = new Thread(this::readerThreadJob, "Lutron reader"); + Thread readerThread = new Thread(this::readerThreadJob, + "OH-binding-" + getBridge().getBridgeUID() + "-BridgeReader"); readerThread.setDaemon(true); readerThread.start(); this.readerThread = readerThread; - Thread senderThread = new Thread(this::senderThreadJob, "Lutron sender"); + Thread senderThread = new Thread(this::senderThreadJob, + "OH-binding-" + getBridge().getBridgeUID() + "-BridgeSender"); senderThread.setDaemon(true); senderThread.start(); this.senderThread = senderThread; diff --git a/bundles/org.openhab.binding.luxom/src/main/java/org/openhab/binding/luxom/internal/handler/LuxomBridgeHandler.java b/bundles/org.openhab.binding.luxom/src/main/java/org/openhab/binding/luxom/internal/handler/LuxomBridgeHandler.java index 0072b7d578376..19137dde5adcf 100644 --- a/bundles/org.openhab.binding.luxom/src/main/java/org/openhab/binding/luxom/internal/handler/LuxomBridgeHandler.java +++ b/bundles/org.openhab.binding.luxom/src/main/java/org/openhab/binding/luxom/internal/handler/LuxomBridgeHandler.java @@ -139,7 +139,7 @@ public void startProcessing() { updateStatus(ThingStatus.ONLINE); - messageSender = new Thread(this::sendCommandsThread, "Luxom sender"); + messageSender = new Thread(this::sendCommandsThread, "OH-binding-" + getBridgeUID() + "-Sender"); messageSender.start(); logger.debug("Starting heartbeat job with interval {} (seconds)", HEARTBEAT_INTERVAL_SECONDS); diff --git a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/handler/MaxCubeBridgeHandler.java b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/handler/MaxCubeBridgeHandler.java index ea8f42a33087b..bf45390d303a7 100644 --- a/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/handler/MaxCubeBridgeHandler.java +++ b/bundles/org.openhab.binding.max/src/main/java/org/openhab/binding/max/internal/handler/MaxCubeBridgeHandler.java @@ -340,7 +340,8 @@ private synchronized void startAutomaticRefresh() { pollingJob = scheduler.scheduleWithFixedDelay(this::refreshData, 0, refreshInterval, TimeUnit.SECONDS); } if (queueConsumerThread == null || !queueConsumerThread.isAlive()) { - queueConsumerThread = new Thread(new QueueConsumer(commandQueue), "max-queue-consumer"); + queueConsumerThread = new Thread(new QueueConsumer(commandQueue), + "OH-binding-" + getBridge().getBridgeUID() + "-max-queue-consumer"); queueConsumerThread.setDaemon(true); queueConsumerThread.start(); } diff --git a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/socket/XiaomiSocket.java b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/socket/XiaomiSocket.java index 1119057d5bd0d..bbb8b3a3848ef 100644 --- a/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/socket/XiaomiSocket.java +++ b/bundles/org.openhab.binding.mihome/src/main/java/org/openhab/binding/mihome/internal/socket/XiaomiSocket.java @@ -71,7 +71,7 @@ public XiaomiSocket(String owner) { */ public XiaomiSocket(int port, String owner) { this.port = port; - socketReceiveThread.setName("XiaomiSocketReceiveThread(" + port + ", " + owner + ")"); + socketReceiveThread.setName("OH-binding-" + this.getThing().getUID() + "-XiaomiSocket(" + port + ", " + owner + ")"); } public void initialize() { diff --git a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/protocol/MilightV6SessionManager.java b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/protocol/MilightV6SessionManager.java index 0d04f8bc4c879..8713451fba7e7 100644 --- a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/protocol/MilightV6SessionManager.java +++ b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/protocol/MilightV6SessionManager.java @@ -32,6 +32,7 @@ import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; +import org.openhab.binding.milight.internal.MilightBindingConstants; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -185,7 +186,7 @@ public MilightV6SessionManager(String bridgeId, ISessionState observer, @Nullabl throw new IllegalArgumentException("keepAliveInterval not within given limits!"); } - sessionThread = new Thread(this, "SessionThread"); + sessionThread = new Thread(this, "OH-binding-" + MilightBindingConstants.BINDING_ID + "-SessionThread"); } /** diff --git a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/protocol/QueuedSend.java b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/protocol/QueuedSend.java index 8666591e45d92..61acb63144cbe 100644 --- a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/protocol/QueuedSend.java +++ b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/protocol/QueuedSend.java @@ -48,7 +48,7 @@ public class QueuedSend implements Runnable, Closeable { */ public void start() { willbeclosed = false; - thread = new Thread(this); + thread = new Thread(this, "OH-binding-" + MilightBindingConstants.BINDING_ID + "-QueueSend"); thread.start(); } diff --git a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/test/EmulatedV6Bridge.java b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/test/EmulatedV6Bridge.java index 243a912d726c1..bdbf8ccbcb800 100644 --- a/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/test/EmulatedV6Bridge.java +++ b/bundles/org.openhab.binding.milight/src/main/java/org/openhab/binding/milight/internal/test/EmulatedV6Bridge.java @@ -92,8 +92,8 @@ public class EmulatedV6Bridge { FAKE_MAC[2], FAKE_MAC[3], FAKE_MAC[4], FAKE_MAC[5], 1 }; EmulatedV6Bridge() { - new Thread(this::runDiscovery).start(); - new Thread(this::runBrigde).start(); + new Thread(this::runDiscovery,"OH-binding-" + MilightBindingConstants.BINDING_ID + "-runDiscovery").start(); + new Thread(this::runBridge,"OH-binding-" + MilightBindingConstants.BINDING_ID + "-runBridge").start(); } private void replaceWithMac(byte[] data, int offset) { @@ -144,7 +144,7 @@ public void runDiscovery() { } } - public void runBrigde() { + public void runBridge() { try { byte[] a = new byte[0]; DatagramPacket sPacket = new DatagramPacket(a, a.length); diff --git a/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/handler/PentairBaseBridgeHandler.java b/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/handler/PentairBaseBridgeHandler.java index 65c0107a37a07..f0c17584ec84b 100644 --- a/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/handler/PentairBaseBridgeHandler.java +++ b/bundles/org.openhab.binding.pentair/src/main/java/org/openhab/binding/pentair/internal/handler/PentairBaseBridgeHandler.java @@ -203,7 +203,7 @@ private void baseConnect() { return; } - Thread parserThread = new Thread(parser, "OH-pentair-" + this.getThing().getUID() + "-parser"); + Thread parserThread = new Thread(parser, "OH-binding-" + this.getThing().getUID() + "-parser"); this.parserThread = parserThread; parserThread.setDaemon(true); diff --git a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/net/SocketChannelSession.java b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/net/SocketChannelSession.java index 4f1c7bed490b3..421475656f4f7 100644 --- a/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/net/SocketChannelSession.java +++ b/bundles/org.openhab.binding.russound/src/main/java/org/openhab/binding/russound/internal/net/SocketChannelSession.java @@ -24,6 +24,8 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicReference; +import org.openhab.binding.lutron.internal.grxprg.SocketSession; +import org.openhab.binding.russound.internal.RussoundBindingConstants; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -127,8 +129,10 @@ public void connect(int timeout) throws IOException { responses.clear(); - dispatchingThread = new Thread(new Dispatcher()); - responseThread = new Thread(new ResponseReader()); + dispatchingThread = new Thread(new Dispatcher(), + "OH-binding-" + RussoundBindingConstants.BINDING_ID + "-dispatcher"); + responseThread = new Thread(new ResponseReader(), + "OH-binding-" + RussoundBindingConstants.BINDING_ID + "-responseReader"); dispatchingThread.start(); responseThread.start(); diff --git a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/protocol/SatelModule.java b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/protocol/SatelModule.java index 502ce80cb0903..9d17bb1c4df98 100644 --- a/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/protocol/SatelModule.java +++ b/bundles/org.openhab.binding.satel/src/main/java/org/openhab/binding/satel/internal/protocol/SatelModule.java @@ -520,7 +520,7 @@ public void run() { SatelModule.this.communicationLoop(CommunicationWatchdog.this); logger.debug("Communication thread stopped"); } - }); + }, "OH-binding-" + SatelBindingConstants.BINDING_ID + "-dispatcher"); thread.start(); this.thread = thread; // if module is not initialized yet, send version command diff --git a/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/manager/ShellyManagerActionPage.java b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/manager/ShellyManagerActionPage.java index 1b6d8e0cb2f9a..fa17d22bb0e08 100644 --- a/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/manager/ShellyManagerActionPage.java +++ b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/manager/ShellyManagerActionPage.java @@ -103,7 +103,7 @@ public ShellyMgrResponse generateContent(String path, Map para // maybe the device restarts before returning the http response } setRestarted(th, uid); // refresh after reboot - }).start(); + }, "OH-binding-" + ShellyBindingConstants.BINDING_ID + "-" + uid + "-deviceReboot").start(); refreshTimer = profile.isMotion ? 60 : 30; } else { message = getMessageS("action.restart.confirm", MCINFO); @@ -162,7 +162,7 @@ public ShellyMgrResponse generateContent(String path, Map para // maybe the device restarts before returning the http response } setRestarted(th, uid); // refresh after reboot - }).start(); + }, "OH-binding-" + ShellyBindingConstants.BINDING_ID + "-" + uid + "-reboot").start(); // The device needs a restart after changing the peer mode message = getMessageP("action.restart.info", MCINFO); @@ -188,7 +188,7 @@ public ShellyMgrResponse generateContent(String path, Map para } catch (ShellyApiException e) { // maybe the device restarts before returning the http response } - }).start(); + }, "OH-binding-" + ShellyBindingConstants.BINDING_ID + "-" + uid + "-factoryReset").start(); message = getMessageP("action.reset.confirm", MCINFO, serviceName); refreshTimer = 5; } @@ -216,7 +216,7 @@ public ShellyMgrResponse generateContent(String path, Map para } catch (ShellyApiException e) { // maybe the device restarts before returning the http response } - }).start(); + }, "OH-binding-" + ShellyBindingConstants.BINDING_ID + "-" + uid + "-setDebug").start(); message = getMessage("action.debug-confirm", enable ? "enabled" : "disabled"); refreshTimer = 3; diff --git a/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/manager/ShellyManagerOtaPage.java b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/manager/ShellyManagerOtaPage.java index eb759411a5f60..92d91ea663d5b 100644 --- a/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/manager/ShellyManagerOtaPage.java +++ b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/manager/ShellyManagerOtaPage.java @@ -134,7 +134,7 @@ public ShellyMgrResponse generatePage(String path, Map paramet // maybe the device restarts before returning the http response logger.warn("{}: {}", th.getThingName(), getMessage("fwupdate.initiated", e.toString())); } - }).start(); + }, "OH-binding-" + ShellyBindingConstants.BINDING_ID + "-" + uid + "-scheduleUpdate").start(); } else { String message = getMessageP("fwupdate.confirm", MCINFO); properties.put(ATTRIBUTE_MESSAGE, message); diff --git a/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/handler/SilvercrestWifiSocketMediatorImpl.java b/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/handler/SilvercrestWifiSocketMediatorImpl.java index d472895cb6602..94b0dc92e8427 100644 --- a/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/handler/SilvercrestWifiSocketMediatorImpl.java +++ b/bundles/org.openhab.binding.silvercrestwifisocket/src/main/java/org/openhab/binding/silvercrestwifisocket/internal/handler/SilvercrestWifiSocketMediatorImpl.java @@ -145,7 +145,8 @@ private void initMediatorWifiSocketUpdateReceiverRunnable() { try { this.receiver = new SilvercrestWifiSocketUpdateReceiverRunnable(this, SilvercrestWifiSocketBindingConstants.WIFI_SOCKET_DEFAULT_UDP_PORT); - this.receiverThread = new Thread(this.receiver); + this.receiverThread = new Thread(this.receiver, + "OH-binding-" + SilvercrestWifiSocketBindingConstants.BINDING_ID + "-receiver"); this.receiverThread.start(); logger.debug("Invoked the start of receiver thread."); } catch (SocketException e) { diff --git a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/core/TelldusCoreBridgeHandler.java b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/core/TelldusCoreBridgeHandler.java index f5b90334de079..8b1387bd1bd28 100644 --- a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/core/TelldusCoreBridgeHandler.java +++ b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/core/TelldusCoreBridgeHandler.java @@ -129,7 +129,8 @@ public void initialize() { } private void setupDeviceController(TellstickBridgeConfiguration configuration) { - deviceController = new TelldusCoreDeviceController(configuration.resendInterval); + deviceController = new TelldusCoreDeviceController(configuration.resendInterval, + getBridge().getUID().getAsString()); eventHandler.addListener((TelldusCoreDeviceController) deviceController); } diff --git a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/core/TelldusCoreDeviceController.java b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/core/TelldusCoreDeviceController.java index ecff75e061d9b..de04ab76838e3 100644 --- a/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/core/TelldusCoreDeviceController.java +++ b/bundles/org.openhab.binding.tellstick/src/main/java/org/openhab/binding/tellstick/internal/core/TelldusCoreDeviceController.java @@ -55,11 +55,11 @@ public class TelldusCoreDeviceController implements DeviceChangeListener, Sensor private Thread workerThread; private SortedMap messageQue; - public TelldusCoreDeviceController(long resendInterval) { + public TelldusCoreDeviceController(long resendInterval, String thingUID) { this.resendInterval = resendInterval; messageQue = Collections.synchronizedSortedMap(new TreeMap<>()); telldusCoreWorker = new TelldusCoreWorker(messageQue); - workerThread = new Thread(telldusCoreWorker); + workerThread = new Thread(telldusCoreWorker, "OH-binding-" + thingUID + "-worker"); } @Override diff --git a/bundles/org.openhab.binding.vitotronic/src/main/java/org/openhab/binding/vitotronic/internal/handler/VitotronicBridgeHandler.java b/bundles/org.openhab.binding.vitotronic/src/main/java/org/openhab/binding/vitotronic/internal/handler/VitotronicBridgeHandler.java index 27536b376a6ea..ba774c8b7176d 100644 --- a/bundles/org.openhab.binding.vitotronic/src/main/java/org/openhab/binding/vitotronic/internal/handler/VitotronicBridgeHandler.java +++ b/bundles/org.openhab.binding.vitotronic/src/main/java/org/openhab/binding/vitotronic/internal/handler/VitotronicBridgeHandler.java @@ -276,8 +276,7 @@ private void startSocketReceiver() { if (!isConnect) { openSocket(); - Thread thread = new Thread(socketReceiverRunnable); - thread.setName("VitotronicSocketThread"); + Thread thread = new Thread(socketReceiverRunnable, "OH-binding-" + getBridge().getUID() + "-SocketThread"); thread.start(); } } diff --git a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/connection/WifiConnection.java b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/connection/WifiConnection.java index 678b9153c22ba..96fae82561455 100644 --- a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/connection/WifiConnection.java +++ b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/device/connection/WifiConnection.java @@ -17,6 +17,7 @@ import java.io.InputStreamReader; import java.net.Socket; +import org.openhab.binding.yeelight.internal.YeelightBindingConstants; import org.openhab.binding.yeelight.internal.lib.device.ConnectState; import org.openhab.binding.yeelight.internal.lib.device.DeviceBase; import org.openhab.binding.yeelight.internal.lib.device.DeviceMethod; @@ -120,7 +121,7 @@ public boolean connect() { mDevice.setConnectionState(ConnectState.DISCONNECTED); mSocket = null; } - }); + }, "OH-binding-" + YeelightBindingConstants.BINDING_ID + "-WIFIConnection"); mConnectThread.start(); return false; } diff --git a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/services/DeviceManager.java b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/services/DeviceManager.java index 652e8e4bd6c49..e6a4ae55a4897 100644 --- a/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/services/DeviceManager.java +++ b/bundles/org.openhab.binding.yeelight/src/main/java/org/openhab/binding/yeelight/internal/lib/services/DeviceManager.java @@ -29,6 +29,7 @@ import java.util.concurrent.Executors; import java.util.stream.Collectors; +import org.openhab.binding.yeelight.internal.YeelightBindingConstants; import org.openhab.binding.yeelight.internal.lib.device.DeviceBase; import org.openhab.binding.yeelight.internal.lib.device.DeviceFactory; import org.openhab.binding.yeelight.internal.lib.device.DeviceStatus; @@ -98,7 +99,7 @@ public void startDiscovery(long timeToStop) { } finally { stopDiscovery(); } - }).start(); + }, "OH-binding-" + YeelightBindingConstants.BINDING_ID + "-DeviceManager").start(); } }