mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
Normalize thread names (#17804)
Signed-off-by: Leo Siepel <leosiepel@gmail.com>
This commit is contained in:
parent
5829b9056b
commit
fb54c2baca
@ -579,7 +579,8 @@ public class GoogleTVConnectionManager {
|
|||||||
logger.trace("{} - Starting Reader Thread for {}:{}", handler.getThingID(), config.ipAddress,
|
logger.trace("{} - Starting Reader Thread for {}:{}", handler.getThingID(), config.ipAddress,
|
||||||
config.googletvPort);
|
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.setDaemon(true);
|
||||||
readerThread.start();
|
readerThread.start();
|
||||||
this.readerThread = readerThread;
|
this.readerThread = readerThread;
|
||||||
@ -587,7 +588,8 @@ public class GoogleTVConnectionManager {
|
|||||||
logger.trace("{} - Starting Sender Thread for {}:{}", handler.getThingID(), config.ipAddress,
|
logger.trace("{} - Starting Sender Thread for {}:{}", handler.getThingID(), config.ipAddress,
|
||||||
config.googletvPort);
|
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.setDaemon(true);
|
||||||
senderThread.start();
|
senderThread.start();
|
||||||
this.senderThread = senderThread;
|
this.senderThread = senderThread;
|
||||||
@ -698,12 +700,14 @@ public class GoogleTVConnectionManager {
|
|||||||
this.shimServerSocket = serverSocket;
|
this.shimServerSocket = serverSocket;
|
||||||
this.shimQueue.clear();
|
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.setDaemon(true);
|
||||||
readerThread.start();
|
readerThread.start();
|
||||||
this.shimReaderThread = readerThread;
|
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.setDaemon(true);
|
||||||
senderThread.start();
|
senderThread.start();
|
||||||
this.shimSenderThread = senderThread;
|
this.shimSenderThread = senderThread;
|
||||||
|
@ -443,12 +443,14 @@ public class ShieldTVConnectionManager {
|
|||||||
|
|
||||||
setStatus(false, "offline.initializing");
|
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.setDaemon(true);
|
||||||
readerThread.start();
|
readerThread.start();
|
||||||
this.readerThread = readerThread;
|
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.setDaemon(true);
|
||||||
senderThread.start();
|
senderThread.start();
|
||||||
this.senderThread = senderThread;
|
this.senderThread = senderThread;
|
||||||
@ -513,13 +515,13 @@ public class ShieldTVConnectionManager {
|
|||||||
this.shimServerSocket = serverSocket;
|
this.shimServerSocket = serverSocket;
|
||||||
|
|
||||||
Thread readerThread = new Thread(this::shimReaderThreadJob,
|
Thread readerThread = new Thread(this::shimReaderThreadJob,
|
||||||
"ShieldTV shim reader " + handler.getThingID());
|
"OH-binding-" + handler.getThingUID() + "-ShieldTVShimReader");
|
||||||
readerThread.setDaemon(true);
|
readerThread.setDaemon(true);
|
||||||
readerThread.start();
|
readerThread.start();
|
||||||
this.shimReaderThread = readerThread;
|
this.shimReaderThread = readerThread;
|
||||||
|
|
||||||
Thread senderThread = new Thread(this::shimSenderThreadJob,
|
Thread senderThread = new Thread(this::shimSenderThreadJob,
|
||||||
"ShieldTV shim sender" + handler.getThingID());
|
"OH-binding-" + handler.getThingUID() + "-ShieldTVShimSender");
|
||||||
senderThread.setDaemon(true);
|
senderThread.setDaemon(true);
|
||||||
senderThread.start();
|
senderThread.start();
|
||||||
this.shimSenderThread = senderThread;
|
this.shimSenderThread = senderThread;
|
||||||
|
@ -242,12 +242,12 @@ public class AnthemHandler extends BaseThingHandler {
|
|||||||
scheduleConnectRetry(reconnectIntervalMinutes);
|
scheduleConnectRetry(reconnectIntervalMinutes);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Thread localReaderThread = new Thread(this::readerThreadJob, "Anthem reader");
|
Thread localReaderThread = new Thread(this::readerThreadJob, "OH-binding-" + getThing().getUID() + "-Reader");
|
||||||
localReaderThread.setDaemon(true);
|
localReaderThread.setDaemon(true);
|
||||||
localReaderThread.start();
|
localReaderThread.start();
|
||||||
this.readerThread = localReaderThread;
|
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.setDaemon(true);
|
||||||
localSenderThread.start();
|
localSenderThread.start();
|
||||||
this.senderThread = localSenderThread;
|
this.senderThread = localSenderThread;
|
||||||
|
@ -290,7 +290,7 @@ public class RemoteArgoApiServerStub {
|
|||||||
// to stop, actually)
|
// to stop, actually)
|
||||||
s.setStopTimeout(1000L);
|
s.setStopTimeout(1000L);
|
||||||
try {
|
try {
|
||||||
new Thread() {
|
new Thread("OH-binding-" + this.id + "-APIStub") {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
|
@ -52,7 +52,8 @@ public class EchonetLiteBridgeHandler extends BaseBridgeHandler {
|
|||||||
private final ArrayBlockingQueue<Message> requests = new ArrayBlockingQueue<>(1024);
|
private final ArrayBlockingQueue<Message> requests = new ArrayBlockingQueue<>(1024);
|
||||||
private final Map<InstanceKey, EchonetObject> devicesByKey = new HashMap<>();
|
private final Map<InstanceKey, EchonetObject> devicesByKey = new HashMap<>();
|
||||||
private final EchonetMessageBuilder messageBuilder = new EchonetMessageBuilder();
|
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 EchonetMessage echonetMessage = new EchonetMessage();
|
||||||
private final MonotonicClock clock = new MonotonicClock();
|
private final MonotonicClock clock = new MonotonicClock();
|
||||||
|
|
||||||
@ -76,8 +77,6 @@ public class EchonetLiteBridgeHandler extends BaseBridgeHandler {
|
|||||||
logger.debug("Binding echonet channel");
|
logger.debug("Binding echonet channel");
|
||||||
echonetChannel = new EchonetChannel(discoveryKey.address);
|
echonetChannel = new EchonetChannel(discoveryKey.address);
|
||||||
logger.debug("Starting networking thread");
|
logger.debug("Starting networking thread");
|
||||||
|
|
||||||
networkingThread.setName("OH-binding-" + EchonetLiteBindingConstants.BINDING_ID);
|
|
||||||
networkingThread.setDaemon(true);
|
networkingThread.setDaemon(true);
|
||||||
networkingThread.start();
|
networkingThread.start();
|
||||||
}
|
}
|
||||||
|
@ -82,10 +82,10 @@ public class EkeyHandler extends BaseThingHandler implements EkeyPacketListener
|
|||||||
|
|
||||||
scheduler.submit(() -> {
|
scheduler.submit(() -> {
|
||||||
populateChannels(config.protocol);
|
populateChannels(config.protocol);
|
||||||
String readerThreadName = "OH-binding-" + getThing().getUID().getAsString();
|
|
||||||
|
|
||||||
EkeyUdpPacketReceiver localReceiver = receiver = new EkeyUdpPacketReceiver(
|
EkeyUdpPacketReceiver localReceiver = receiver = new EkeyUdpPacketReceiver(
|
||||||
Objects.requireNonNullElse(config.natIp, config.ipAddress), config.port, readerThreadName);
|
Objects.requireNonNullElse(config.natIp, config.ipAddress), config.port,
|
||||||
|
"OH-binding-" + getThing().getUID());
|
||||||
localReceiver.addEkeyPacketListener(this);
|
localReceiver.addEkeyPacketListener(this);
|
||||||
try {
|
try {
|
||||||
localReceiver.openConnection();
|
localReceiver.openConnection();
|
||||||
|
@ -397,7 +397,8 @@ public class Clip2Bridge implements Closeable {
|
|||||||
public void onGoAway(@Nullable Session session, @Nullable GoAwayFrame frame) {
|
public void onGoAway(@Nullable Session session, @Nullable GoAwayFrame frame) {
|
||||||
Objects.requireNonNull(session);
|
Objects.requireNonNull(session);
|
||||||
if (session.equals(http2Session)) {
|
if (session.equals(http2Session)) {
|
||||||
Thread recreateThread = new Thread(() -> recreateSession());
|
Thread recreateThread = new Thread(() -> recreateSession(),
|
||||||
|
"OH-binding-" + bridgeHandler.getThing().getUID() + "-RecreateSession");
|
||||||
Clip2Bridge.this.recreateThread = recreateThread;
|
Clip2Bridge.this.recreateThread = recreateThread;
|
||||||
recreateThread.start();
|
recreateThread.start();
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
|||||||
|
|
||||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||||
import org.eclipse.jdt.annotation.Nullable;
|
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.InsteonLegacyBindingConstants;
|
||||||
import org.openhab.binding.insteon.internal.config.InsteonLegacyNetworkConfiguration;
|
import org.openhab.binding.insteon.internal.config.InsteonLegacyNetworkConfiguration;
|
||||||
import org.openhab.binding.insteon.internal.device.InsteonAddress;
|
import org.openhab.binding.insteon.internal.device.InsteonAddress;
|
||||||
@ -178,9 +179,9 @@ public class LegacyPort {
|
|||||||
}
|
}
|
||||||
|
|
||||||
readThread = new Thread(reader);
|
readThread = new Thread(reader);
|
||||||
setParamsAndStart(readThread, "Reader");
|
setParamsAndStart(readThread, "OH-binding-" + InsteonBindingConstants.BINDING_ID + "-LegacyReader");
|
||||||
writeThread = new Thread(writer);
|
writeThread = new Thread(writer);
|
||||||
setParamsAndStart(writeThread, "Writer");
|
setParamsAndStart(writeThread, "OH-binding-" + InsteonBindingConstants.BINDING_ID + "-LegacyWriter");
|
||||||
|
|
||||||
if (!mdbb.isComplete()) {
|
if (!mdbb.isComplete()) {
|
||||||
modem.initialize();
|
modem.initialize();
|
||||||
|
@ -93,11 +93,8 @@ public class IntesisBoxHandler extends BaseThingHandler implements IntesisBoxCha
|
|||||||
if (!config.ipAddress.isEmpty()) {
|
if (!config.ipAddress.isEmpty()) {
|
||||||
updateStatus(ThingStatus.UNKNOWN);
|
updateStatus(ThingStatus.UNKNOWN);
|
||||||
scheduler.submit(() -> {
|
scheduler.submit(() -> {
|
||||||
|
|
||||||
String readerThreadName = "OH-binding-" + getThing().getUID().getAsString();
|
|
||||||
|
|
||||||
IntesisBoxSocketApi intesisLocalApi = intesisBoxSocketApi = new IntesisBoxSocketApi(config.ipAddress,
|
IntesisBoxSocketApi intesisLocalApi = intesisBoxSocketApi = new IntesisBoxSocketApi(config.ipAddress,
|
||||||
config.port, readerThreadName);
|
config.port, "OH-binding-" + getThing().getUID());
|
||||||
intesisLocalApi.addIntesisBoxChangeListener(this);
|
intesisLocalApi.addIntesisBoxChangeListener(this);
|
||||||
try {
|
try {
|
||||||
intesisLocalApi.openConnection();
|
intesisLocalApi.openConnection();
|
||||||
|
@ -32,6 +32,7 @@ import java.util.Map;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.locks.ReentrantLock;
|
import java.util.concurrent.locks.ReentrantLock;
|
||||||
|
|
||||||
|
import org.openhab.binding.keba.internal.KebaBindingConstants;
|
||||||
import org.openhab.core.thing.ThingStatus;
|
import org.openhab.core.thing.ThingStatus;
|
||||||
import org.openhab.core.thing.ThingStatusDetail;
|
import org.openhab.core.thing.ThingStatusDetail;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
@ -71,7 +72,8 @@ public class KeContactTransceiver {
|
|||||||
selector = Selector.open();
|
selector = Selector.open();
|
||||||
|
|
||||||
if (transceiverThread == null) {
|
if (transceiverThread == null) {
|
||||||
transceiverThread = new Thread(transceiverRunnable, "OH-binding-Keba-Transceiver");
|
transceiverThread = new Thread(transceiverRunnable,
|
||||||
|
"OH-binding-" + KebaBindingConstants.BINDING_ID + "-Transceiver");
|
||||||
transceiverThread.start();
|
transceiverThread.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ public abstract class LxWsSecurity {
|
|||||||
authenticationLock.unlock();
|
authenticationLock.unlock();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
new Thread(init).start();
|
new Thread(init, "OH-binding-" + thingHandler.getThingId() + "-Authenticate").start();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -216,7 +216,7 @@ public class IPBridgeHandler extends LutronBridgeHandler {
|
|||||||
sendCommand(new LIPCommand(TargetType.BRIDGE, LutronOperation.QUERY, LutronCommandType.SYSTEM, null,
|
sendCommand(new LIPCommand(TargetType.BRIDGE, LutronOperation.QUERY, LutronCommandType.SYSTEM, null,
|
||||||
SYSTEM_DBEXPORTDATETIME));
|
SYSTEM_DBEXPORTDATETIME));
|
||||||
|
|
||||||
messageSender = new Thread(this::sendCommandsThread, "Lutron sender");
|
messageSender = new Thread(this::sendCommandsThread, "OH-binding-" + getThing().getUID() + "-IPBridgeSender");
|
||||||
messageSender.start();
|
messageSender.start();
|
||||||
|
|
||||||
logger.debug("Starting keepAlive job with interval {}", heartbeatInterval);
|
logger.debug("Starting keepAlive job with interval {}", heartbeatInterval);
|
||||||
|
@ -304,12 +304,12 @@ public class LeapBridgeHandler extends LutronBridgeHandler implements LeapMessag
|
|||||||
|
|
||||||
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.NONE, STATUS_INITIALIZING);
|
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.NONE, STATUS_INITIALIZING);
|
||||||
|
|
||||||
Thread readerThread = new Thread(this::readerThreadJob, "Lutron reader");
|
Thread readerThread = new Thread(this::readerThreadJob, "OH-binding-" + getThing().getUID() + "-BridgeReader");
|
||||||
readerThread.setDaemon(true);
|
readerThread.setDaemon(true);
|
||||||
readerThread.start();
|
readerThread.start();
|
||||||
this.readerThread = readerThread;
|
this.readerThread = readerThread;
|
||||||
|
|
||||||
Thread senderThread = new Thread(this::senderThreadJob, "Lutron sender");
|
Thread senderThread = new Thread(this::senderThreadJob, "OH-binding-" + getThing().getUID() + "-BridgeSender");
|
||||||
senderThread.setDaemon(true);
|
senderThread.setDaemon(true);
|
||||||
senderThread.start();
|
senderThread.start();
|
||||||
this.senderThread = senderThread;
|
this.senderThread = senderThread;
|
||||||
|
@ -139,7 +139,7 @@ public class LuxomBridgeHandler extends BaseBridgeHandler {
|
|||||||
|
|
||||||
updateStatus(ThingStatus.ONLINE);
|
updateStatus(ThingStatus.ONLINE);
|
||||||
|
|
||||||
messageSender = new Thread(this::sendCommandsThread, "Luxom sender");
|
messageSender = new Thread(this::sendCommandsThread, "OH-binding-" + getThing().getUID() + "-Sender");
|
||||||
messageSender.start();
|
messageSender.start();
|
||||||
|
|
||||||
logger.debug("Starting heartbeat job with interval {} (seconds)", HEARTBEAT_INTERVAL_SECONDS);
|
logger.debug("Starting heartbeat job with interval {} (seconds)", HEARTBEAT_INTERVAL_SECONDS);
|
||||||
|
@ -340,7 +340,8 @@ public class MaxCubeBridgeHandler extends BaseBridgeHandler {
|
|||||||
pollingJob = scheduler.scheduleWithFixedDelay(this::refreshData, 0, refreshInterval, TimeUnit.SECONDS);
|
pollingJob = scheduler.scheduleWithFixedDelay(this::refreshData, 0, refreshInterval, TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
if (queueConsumerThread == null || !queueConsumerThread.isAlive()) {
|
if (queueConsumerThread == null || !queueConsumerThread.isAlive()) {
|
||||||
queueConsumerThread = new Thread(new QueueConsumer(commandQueue), "max-queue-consumer");
|
queueConsumerThread = new Thread(new QueueConsumer(commandQueue),
|
||||||
|
"OH-binding-" + getThing().getUID() + "-max-queue-consumer");
|
||||||
queueConsumerThread.setDaemon(true);
|
queueConsumerThread.setDaemon(true);
|
||||||
queueConsumerThread.start();
|
queueConsumerThread.start();
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
*/
|
*/
|
||||||
package org.openhab.binding.mihome.internal.socket;
|
package org.openhab.binding.mihome.internal.socket;
|
||||||
|
|
||||||
|
import static org.openhab.binding.mihome.internal.XiaomiGatewayBindingConstants.BINDING_ID;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.DatagramPacket;
|
import java.net.DatagramPacket;
|
||||||
import java.net.DatagramSocket;
|
import java.net.DatagramSocket;
|
||||||
@ -71,7 +73,7 @@ public abstract class XiaomiSocket {
|
|||||||
*/
|
*/
|
||||||
public XiaomiSocket(int port, String owner) {
|
public XiaomiSocket(int port, String owner) {
|
||||||
this.port = port;
|
this.port = port;
|
||||||
socketReceiveThread.setName("XiaomiSocketReceiveThread(" + port + ", " + owner + ")");
|
socketReceiveThread.setName("OH-binding-" + BINDING_ID + "-XiaomiSocket(" + port + ", " + owner + ")");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
|
@ -32,6 +32,7 @@ import java.util.concurrent.CompletableFuture;
|
|||||||
|
|
||||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||||
import org.eclipse.jdt.annotation.Nullable;
|
import org.eclipse.jdt.annotation.Nullable;
|
||||||
|
import org.openhab.binding.milight.internal.MilightBindingConstants;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@ -185,7 +186,7 @@ public class MilightV6SessionManager implements Runnable, Closeable {
|
|||||||
throw new IllegalArgumentException("keepAliveInterval not within given limits!");
|
throw new IllegalArgumentException("keepAliveInterval not within given limits!");
|
||||||
}
|
}
|
||||||
|
|
||||||
sessionThread = new Thread(this, "SessionThread");
|
sessionThread = new Thread(this, "OH-binding-" + MilightBindingConstants.BINDING_ID + "-SessionThread");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -21,6 +21,7 @@ import java.util.concurrent.LinkedBlockingQueue;
|
|||||||
|
|
||||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||||
import org.eclipse.jdt.annotation.Nullable;
|
import org.eclipse.jdt.annotation.Nullable;
|
||||||
|
import org.openhab.binding.milight.internal.MilightBindingConstants;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@ -48,7 +49,7 @@ public class QueuedSend implements Runnable, Closeable {
|
|||||||
*/
|
*/
|
||||||
public void start() {
|
public void start() {
|
||||||
willbeclosed = false;
|
willbeclosed = false;
|
||||||
thread = new Thread(this);
|
thread = new Thread(this, "OH-binding-" + MilightBindingConstants.BINDING_ID + "-QueuedSend");
|
||||||
thread.start();
|
thread.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,8 +92,8 @@ public class EmulatedV6Bridge {
|
|||||||
FAKE_MAC[2], FAKE_MAC[3], FAKE_MAC[4], FAKE_MAC[5], 1 };
|
FAKE_MAC[2], FAKE_MAC[3], FAKE_MAC[4], FAKE_MAC[5], 1 };
|
||||||
|
|
||||||
EmulatedV6Bridge() {
|
EmulatedV6Bridge() {
|
||||||
new Thread(this::runDiscovery).start();
|
new Thread(this::runDiscovery, "OH-binding-" + MilightBindingConstants.BINDING_ID + "-runDiscovery").start();
|
||||||
new Thread(this::runBrigde).start();
|
new Thread(this::runBridge, "OH-binding-" + MilightBindingConstants.BINDING_ID + "-runBridge").start();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void replaceWithMac(byte[] data, int offset) {
|
private void replaceWithMac(byte[] data, int offset) {
|
||||||
@ -144,7 +144,7 @@ public class EmulatedV6Bridge {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void runBrigde() {
|
public void runBridge() {
|
||||||
try {
|
try {
|
||||||
byte[] a = new byte[0];
|
byte[] a = new byte[0];
|
||||||
DatagramPacket sPacket = new DatagramPacket(a, a.length);
|
DatagramPacket sPacket = new DatagramPacket(a, a.length);
|
||||||
|
@ -203,7 +203,7 @@ public abstract class PentairBaseBridgeHandler extends BaseBridgeHandler
|
|||||||
return;
|
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;
|
this.parserThread = parserThread;
|
||||||
|
|
||||||
parserThread.setDaemon(true);
|
parserThread.setDaemon(true);
|
||||||
|
@ -24,6 +24,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
|
|||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
|
|
||||||
|
import org.openhab.binding.russound.internal.RussoundBindingConstants;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@ -127,8 +128,10 @@ public class SocketChannelSession implements SocketSession {
|
|||||||
|
|
||||||
responses.clear();
|
responses.clear();
|
||||||
|
|
||||||
dispatchingThread = new Thread(new Dispatcher());
|
dispatchingThread = new Thread(new Dispatcher(),
|
||||||
responseThread = new Thread(new ResponseReader());
|
"OH-binding-" + RussoundBindingConstants.BINDING_ID + "-dispatcher");
|
||||||
|
responseThread = new Thread(new ResponseReader(),
|
||||||
|
"OH-binding-" + RussoundBindingConstants.BINDING_ID + "-responseReader");
|
||||||
|
|
||||||
dispatchingThread.start();
|
dispatchingThread.start();
|
||||||
responseThread.start();
|
responseThread.start();
|
||||||
|
@ -23,6 +23,7 @@ import java.util.concurrent.LinkedBlockingQueue;
|
|||||||
|
|
||||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||||
import org.eclipse.jdt.annotation.Nullable;
|
import org.eclipse.jdt.annotation.Nullable;
|
||||||
|
import org.openhab.binding.satel.internal.SatelBindingConstants;
|
||||||
import org.openhab.binding.satel.internal.command.IntegraVersionCommand;
|
import org.openhab.binding.satel.internal.command.IntegraVersionCommand;
|
||||||
import org.openhab.binding.satel.internal.command.SatelCommand;
|
import org.openhab.binding.satel.internal.command.SatelCommand;
|
||||||
import org.openhab.binding.satel.internal.command.SatelCommand.State;
|
import org.openhab.binding.satel.internal.command.SatelCommand.State;
|
||||||
@ -520,7 +521,7 @@ public abstract class SatelModule extends EventDispatcher implements SatelEventL
|
|||||||
SatelModule.this.communicationLoop(CommunicationWatchdog.this);
|
SatelModule.this.communicationLoop(CommunicationWatchdog.this);
|
||||||
logger.debug("Communication thread stopped");
|
logger.debug("Communication thread stopped");
|
||||||
}
|
}
|
||||||
});
|
}, "OH-binding-" + SatelBindingConstants.BINDING_ID + "-dispatcher");
|
||||||
thread.start();
|
thread.start();
|
||||||
this.thread = thread;
|
this.thread = thread;
|
||||||
// if module is not initialized yet, send version command
|
// if module is not initialized yet, send version command
|
||||||
|
@ -24,6 +24,7 @@ import java.util.Map;
|
|||||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||||
import org.eclipse.jetty.client.HttpClient;
|
import org.eclipse.jetty.client.HttpClient;
|
||||||
import org.eclipse.jetty.http.HttpStatus;
|
import org.eclipse.jetty.http.HttpStatus;
|
||||||
|
import org.openhab.binding.shelly.internal.ShellyBindingConstants;
|
||||||
import org.openhab.binding.shelly.internal.ShellyHandlerFactory;
|
import org.openhab.binding.shelly.internal.ShellyHandlerFactory;
|
||||||
import org.openhab.binding.shelly.internal.api.ShellyApiException;
|
import org.openhab.binding.shelly.internal.api.ShellyApiException;
|
||||||
import org.openhab.binding.shelly.internal.api.ShellyApiInterface;
|
import org.openhab.binding.shelly.internal.api.ShellyApiInterface;
|
||||||
@ -103,7 +104,7 @@ public class ShellyManagerActionPage extends ShellyManagerPage {
|
|||||||
// maybe the device restarts before returning the http response
|
// maybe the device restarts before returning the http response
|
||||||
}
|
}
|
||||||
setRestarted(th, uid); // refresh after reboot
|
setRestarted(th, uid); // refresh after reboot
|
||||||
}).start();
|
}, "OH-binding-" + ShellyBindingConstants.BINDING_ID + "-" + uid + "-deviceReboot").start();
|
||||||
refreshTimer = profile.isMotion ? 60 : 30;
|
refreshTimer = profile.isMotion ? 60 : 30;
|
||||||
} else {
|
} else {
|
||||||
message = getMessageS("action.restart.confirm", MCINFO);
|
message = getMessageS("action.restart.confirm", MCINFO);
|
||||||
@ -162,7 +163,7 @@ public class ShellyManagerActionPage extends ShellyManagerPage {
|
|||||||
// maybe the device restarts before returning the http response
|
// maybe the device restarts before returning the http response
|
||||||
}
|
}
|
||||||
setRestarted(th, uid); // refresh after reboot
|
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
|
// The device needs a restart after changing the peer mode
|
||||||
message = getMessageP("action.restart.info", MCINFO);
|
message = getMessageP("action.restart.info", MCINFO);
|
||||||
@ -188,7 +189,7 @@ public class ShellyManagerActionPage extends ShellyManagerPage {
|
|||||||
} catch (ShellyApiException e) {
|
} catch (ShellyApiException e) {
|
||||||
// maybe the device restarts before returning the http response
|
// 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);
|
message = getMessageP("action.reset.confirm", MCINFO, serviceName);
|
||||||
refreshTimer = 5;
|
refreshTimer = 5;
|
||||||
}
|
}
|
||||||
@ -216,7 +217,7 @@ public class ShellyManagerActionPage extends ShellyManagerPage {
|
|||||||
} catch (ShellyApiException e) {
|
} catch (ShellyApiException e) {
|
||||||
// maybe the device restarts before returning the http response
|
// 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");
|
message = getMessage("action.debug-confirm", enable ? "enabled" : "disabled");
|
||||||
refreshTimer = 3;
|
refreshTimer = 3;
|
||||||
|
@ -31,6 +31,7 @@ import org.eclipse.jetty.client.api.Request;
|
|||||||
import org.eclipse.jetty.http.HttpFields;
|
import org.eclipse.jetty.http.HttpFields;
|
||||||
import org.eclipse.jetty.http.HttpMethod;
|
import org.eclipse.jetty.http.HttpMethod;
|
||||||
import org.eclipse.jetty.http.HttpStatus;
|
import org.eclipse.jetty.http.HttpStatus;
|
||||||
|
import org.openhab.binding.shelly.internal.ShellyBindingConstants;
|
||||||
import org.openhab.binding.shelly.internal.ShellyHandlerFactory;
|
import org.openhab.binding.shelly.internal.ShellyHandlerFactory;
|
||||||
import org.openhab.binding.shelly.internal.api.ShellyApiException;
|
import org.openhab.binding.shelly.internal.api.ShellyApiException;
|
||||||
import org.openhab.binding.shelly.internal.api.ShellyApiInterface;
|
import org.openhab.binding.shelly.internal.api.ShellyApiInterface;
|
||||||
@ -134,7 +135,7 @@ public class ShellyManagerOtaPage extends ShellyManagerPage {
|
|||||||
// maybe the device restarts before returning the http response
|
// maybe the device restarts before returning the http response
|
||||||
logger.warn("{}: {}", th.getThingName(), getMessage("fwupdate.initiated", e.toString()));
|
logger.warn("{}: {}", th.getThingName(), getMessage("fwupdate.initiated", e.toString()));
|
||||||
}
|
}
|
||||||
}).start();
|
}, "OH-binding-" + ShellyBindingConstants.BINDING_ID + "-" + uid + "-scheduleUpdate").start();
|
||||||
} else {
|
} else {
|
||||||
String message = getMessageP("fwupdate.confirm", MCINFO);
|
String message = getMessageP("fwupdate.confirm", MCINFO);
|
||||||
properties.put(ATTRIBUTE_MESSAGE, message);
|
properties.put(ATTRIBUTE_MESSAGE, message);
|
||||||
|
@ -145,7 +145,8 @@ public class SilvercrestWifiSocketMediatorImpl implements SilvercrestWifiSocketM
|
|||||||
try {
|
try {
|
||||||
this.receiver = new SilvercrestWifiSocketUpdateReceiverRunnable(this,
|
this.receiver = new SilvercrestWifiSocketUpdateReceiverRunnable(this,
|
||||||
SilvercrestWifiSocketBindingConstants.WIFI_SOCKET_DEFAULT_UDP_PORT);
|
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();
|
this.receiverThread.start();
|
||||||
logger.debug("Invoked the start of receiver thread.");
|
logger.debug("Invoked the start of receiver thread.");
|
||||||
} catch (SocketException e) {
|
} catch (SocketException e) {
|
||||||
|
@ -129,7 +129,8 @@ public class TelldusCoreBridgeHandler extends BaseBridgeHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void setupDeviceController(TellstickBridgeConfiguration configuration) {
|
private void setupDeviceController(TellstickBridgeConfiguration configuration) {
|
||||||
deviceController = new TelldusCoreDeviceController(configuration.resendInterval);
|
deviceController = new TelldusCoreDeviceController(configuration.resendInterval,
|
||||||
|
"OH-binding-" + getThing().getUID() + "-worker");
|
||||||
eventHandler.addListener((TelldusCoreDeviceController) deviceController);
|
eventHandler.addListener((TelldusCoreDeviceController) deviceController);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,11 +55,11 @@ public class TelldusCoreDeviceController implements DeviceChangeListener, Sensor
|
|||||||
private Thread workerThread;
|
private Thread workerThread;
|
||||||
private SortedMap<Device, TelldusCoreSendEvent> messageQue;
|
private SortedMap<Device, TelldusCoreSendEvent> messageQue;
|
||||||
|
|
||||||
public TelldusCoreDeviceController(long resendInterval) {
|
public TelldusCoreDeviceController(long resendInterval, final String threadName) {
|
||||||
this.resendInterval = resendInterval;
|
this.resendInterval = resendInterval;
|
||||||
messageQue = Collections.synchronizedSortedMap(new TreeMap<>());
|
messageQue = Collections.synchronizedSortedMap(new TreeMap<>());
|
||||||
telldusCoreWorker = new TelldusCoreWorker(messageQue);
|
telldusCoreWorker = new TelldusCoreWorker(messageQue);
|
||||||
workerThread = new Thread(telldusCoreWorker);
|
workerThread = new Thread(telldusCoreWorker, threadName);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -276,8 +276,7 @@ public class VitotronicBridgeHandler extends BaseBridgeHandler {
|
|||||||
if (!isConnect) {
|
if (!isConnect) {
|
||||||
openSocket();
|
openSocket();
|
||||||
|
|
||||||
Thread thread = new Thread(socketReceiverRunnable);
|
Thread thread = new Thread(socketReceiverRunnable, "OH-binding-" + getThing().getUID() + "-SocketThread");
|
||||||
thread.setName("VitotronicSocketThread");
|
|
||||||
thread.start();
|
thread.start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,7 @@ import java.io.BufferedReader;
|
|||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.net.Socket;
|
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.ConnectState;
|
||||||
import org.openhab.binding.yeelight.internal.lib.device.DeviceBase;
|
import org.openhab.binding.yeelight.internal.lib.device.DeviceBase;
|
||||||
import org.openhab.binding.yeelight.internal.lib.device.DeviceMethod;
|
import org.openhab.binding.yeelight.internal.lib.device.DeviceMethod;
|
||||||
@ -120,7 +121,7 @@ public class WifiConnection implements ConnectionBase {
|
|||||||
mDevice.setConnectionState(ConnectState.DISCONNECTED);
|
mDevice.setConnectionState(ConnectState.DISCONNECTED);
|
||||||
mSocket = null;
|
mSocket = null;
|
||||||
}
|
}
|
||||||
});
|
}, "OH-binding-" + YeelightBindingConstants.BINDING_ID + "-WifiConnection");
|
||||||
mConnectThread.start();
|
mConnectThread.start();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -29,6 +29,7 @@ import java.util.concurrent.ExecutorService;
|
|||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
import java.util.stream.Collectors;
|
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.DeviceBase;
|
||||||
import org.openhab.binding.yeelight.internal.lib.device.DeviceFactory;
|
import org.openhab.binding.yeelight.internal.lib.device.DeviceFactory;
|
||||||
import org.openhab.binding.yeelight.internal.lib.device.DeviceStatus;
|
import org.openhab.binding.yeelight.internal.lib.device.DeviceStatus;
|
||||||
@ -98,7 +99,7 @@ public class DeviceManager {
|
|||||||
} finally {
|
} finally {
|
||||||
stopDiscovery();
|
stopDiscovery();
|
||||||
}
|
}
|
||||||
}).start();
|
}, "OH-binding-" + YeelightBindingConstants.BINDING_ID + "-DeviceManager").start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user