- for (Map.Entry<String, Integer> entry : enabledEvents.entrySet()) {
- String eventName = entry.getKey();
- Integer nb = entry.getValue();
- for (int i = 0; i < nb.intValue(); i++) {
- fcn.removeEventRules(eventName);
- }
- }
- enabledEvents.clear();
-
- for (Map.Entry<String, Integer> entry : enabledEventPrefixes.entrySet()) {
- /* Re-add the * at the end, the FCN tracks the rules that way */
- String eventName = (entry.getKey() + "*");
- Integer nb = entry.getValue();
- for (int i = 0; i < nb.intValue(); i++) {
- fcn.removeEventRules(eventName);
+ enabledEventNamesLock.lock();
+ try {
+ for (Map.Entry<EventNamePattern, Integer> entry : enabledPatterns.entrySet()) {
+ String eventName = entry.getKey().getEventName();
+ Integer nb = entry.getValue();
+ for (int i = 0; i < nb.intValue(); i++) {
+ fcn.removeEventRules(eventName);
+ }