From 295088867ebb44699e038014dc33101694fe5653 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 4 Jan 2013 17:54:00 +0100 Subject: [PATCH] Add method to remove reactions. --- .../java/net/pterodactylus/reactor/engine/Engine.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/main/java/net/pterodactylus/reactor/engine/Engine.java b/src/main/java/net/pterodactylus/reactor/engine/Engine.java index 0fb3f18..7c15e5a 100644 --- a/src/main/java/net/pterodactylus/reactor/engine/Engine.java +++ b/src/main/java/net/pterodactylus/reactor/engine/Engine.java @@ -78,6 +78,23 @@ public class Engine extends AbstractExecutionThreadService { } } + /** + * Removes the reaction with the given name. + * + * @param name + * The name of the reaction to remove + */ + public void removeReaction(String name) { + synchronized (reactions) { + if (!reactions.containsKey(name)) { + return; + } + Reaction reaction = reactions.remove(name); + reactionExecutions.remove(reaction); + reactions.notifyAll(); + } + } + // // ABSTRACTSERVICE METHODS // -- 2.7.4