From 8f7a029dfd55243fc944a9cfea10d446df5a9034 Mon Sep 17 00:00:00 2001 From: Robert von Burg Date: Tue, 25 Apr 2023 14:43:40 +0200 Subject: [PATCH] [New] Added PlcExecutionPolicy.unregister() --- .../plc/gw/server/policy/execution/PlcExecutionPolicy.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plc-gw-server/src/main/java/li/strolch/plc/gw/server/policy/execution/PlcExecutionPolicy.java b/plc-gw-server/src/main/java/li/strolch/plc/gw/server/policy/execution/PlcExecutionPolicy.java index 58f842c..b1124e9 100644 --- a/plc-gw-server/src/main/java/li/strolch/plc/gw/server/policy/execution/PlcExecutionPolicy.java +++ b/plc-gw-server/src/main/java/li/strolch/plc/gw/server/policy/execution/PlcExecutionPolicy.java @@ -57,6 +57,11 @@ public abstract class PlcExecutionPolicy extends SimpleExecution this.registeredKeys.add(key); } + protected void unregister(PlcAddressKey key) { + this.plcHandler.unregister(getPlcId(), key, this); + this.registeredKeys.remove(key); + } + protected void unregisterAll() { this.registeredKeys.forEach(k -> this.plcHandler.unregister(getPlcId(), k, this)); }