338607 improve destruction of handlers
git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@2845 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
parent
7b892d18a0
commit
d77069a8ea
|
@ -53,7 +53,7 @@ public class StandardUndeployer implements AppLifeCycle.Binding
|
|||
{
|
||||
Log.debug("Removing handler: " + child);
|
||||
coll.removeHandler(child);
|
||||
((ContextHandler)child).destroy();
|
||||
child.destroy();
|
||||
Log.debug(String.format("After removal: %d (originally %d)",coll.getHandlers().length,originalCount));
|
||||
}
|
||||
else if (child instanceof HandlerCollection)
|
||||
|
|
|
@ -21,7 +21,6 @@ import java.net.URL;
|
|||
import java.net.URLClassLoader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Enumeration;
|
||||
import java.util.EventListener;
|
||||
|
|
|
@ -298,5 +298,16 @@ public class HandlerCollection extends AbstractHandlerContainer
|
|||
return list;
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
@Override
|
||||
public void destroy()
|
||||
{
|
||||
if (!isStopped())
|
||||
throw new IllegalStateException("!STOPPED");
|
||||
Handler[] children=getChildHandlers();
|
||||
setHandlers(null);
|
||||
for (Handler child: children)
|
||||
child.destroy();
|
||||
super.destroy();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -163,6 +163,20 @@ public class HandlerWrapper extends AbstractHandlerContainer
|
|||
return null;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
@Override
|
||||
public void destroy()
|
||||
{
|
||||
if (!isStopped())
|
||||
throw new IllegalStateException("!STOPPED");
|
||||
Handler child=getHandler();
|
||||
if (child!=null)
|
||||
{
|
||||
setHandler(null);
|
||||
child.destroy();
|
||||
}
|
||||
super.destroy();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -155,7 +155,6 @@ public class HotSwapHandler extends AbstractHandlerContainer
|
|||
server.getContainer().update(this, null,_handler, "handler");
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
@Override
|
||||
protected Object expandChildren(Object list, Class byClass)
|
||||
|
@ -163,5 +162,18 @@ public class HotSwapHandler extends AbstractHandlerContainer
|
|||
return expandHandler(_handler,list,byClass);
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
@Override
|
||||
public void destroy()
|
||||
{
|
||||
if (!isStopped())
|
||||
throw new IllegalStateException("!STOPPED");
|
||||
Handler child=getHandler();
|
||||
if (child!=null)
|
||||
{
|
||||
setHandler(null);
|
||||
child.destroy();
|
||||
}
|
||||
super.destroy();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue