From: David ‘Bombe’ Roden Date: Fri, 4 Jan 2013 16:54:00 +0000 (+0100) Subject: Add method to remove reactions. X-Git-Tag: 0.1~82 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=295088867ebb44699e038014dc33101694fe5653;p=rhynodge.git Add method to remove reactions. --- 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 //