diff --git a/src/main/java/org/jboss/logmanager/config/HandlerConfigurationImpl.java b/src/main/java/org/jboss/logmanager/config/HandlerConfigurationImpl.java index 8ce39d1f..13ec76c1 100644 --- a/src/main/java/org/jboss/logmanager/config/HandlerConfigurationImpl.java +++ b/src/main/java/org/jboss/logmanager/config/HandlerConfigurationImpl.java @@ -375,19 +375,20 @@ public boolean removeHandlerName(final String name) { } final int index = handlerNames.indexOf(name); handlerNames.remove(index); - configuration.addAction(new ConfigAction() { - public Void validate() throws IllegalArgumentException { - return null; + configuration.addAction(new ConfigAction() { + public Handler validate() throws IllegalArgumentException { + final Map handlerRefs = configuration.getHandlerRefs(); + return handlerRefs.get(name); } - public void applyPreCreate(final Void param) { + public void applyPreCreate(final Handler param) { addPostConfigurationActions(); } - public void applyPostCreate(final Void param) { + public void applyPostCreate(final Handler param) { final Map handlerRefs = configuration.getHandlerRefs(); final ExtHandler handler = (ExtHandler) handlerRefs.get(getName()); - handler.removeHandler(handlerRefs.get(name)); + handler.removeHandler(param); } public void rollback() { diff --git a/src/main/java/org/jboss/logmanager/config/LoggerConfigurationImpl.java b/src/main/java/org/jboss/logmanager/config/LoggerConfigurationImpl.java index 730278db..acd56c90 100644 --- a/src/main/java/org/jboss/logmanager/config/LoggerConfigurationImpl.java +++ b/src/main/java/org/jboss/logmanager/config/LoggerConfigurationImpl.java @@ -310,19 +310,19 @@ public boolean removeHandlerName(final String name) { } final int index = handlerNames.indexOf(name); handlerNames.remove(index); - configuration.addAction(new ConfigAction() { - public Void validate() throws IllegalArgumentException { - return null; + configuration.addAction(new ConfigAction() { + public Handler validate() throws IllegalArgumentException { + final Map handlerRefs = configuration.getHandlerRefs(); + return handlerRefs.get(name); } - public void applyPreCreate(final Void param) { + public void applyPreCreate(final Handler param) { } - public void applyPostCreate(final Void param) { - final Map handlerRefs = configuration.getHandlerRefs(); + public void applyPostCreate(final Handler param) { final Map loggerRefs = configuration.getLoggerRefs(); - final Logger logger = (Logger) loggerRefs.get(getName()); - logger.removeHandler(handlerRefs.get(name)); + final Logger logger = loggerRefs.get(getName()); + logger.removeHandler(param); } public void rollback() {