summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorThomas Becker2012-01-20 13:27:00 (EST)
committer Thomas Becker2012-03-01 09:32:22 (EST)
commit9f68c6e6bf518f255cfb4c90d987cbe357cba6fa (patch)
treefb74778adfe8725e5d15dbd2a819621f10f222c8
parentab5592daf0a37f486bea6d17eafe925a51a2f826 (diff)
downloadorg.eclipse.jetty.project-9f68c6e6bf518f255cfb4c90d987cbe357cba6fa.zip
org.eclipse.jetty.project-9f68c6e6bf518f255cfb4c90d987cbe357cba6fa.tar.gz
org.eclipse.jetty.project-9f68c6e6bf518f255cfb4c90d987cbe357cba6fa.tar.bz2
369214: HotSwapHandler uses AggregateLifeCycles.addBean()refs/changes/08/5208/1
-rw-r--r--jetty-server/src/main/java/org/eclipse/jetty/server/handler/HotSwapHandler.java29
1 files changed, 11 insertions, 18 deletions
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/HotSwapHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/HotSwapHandler.java
index 534d83b..47395fb 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/HotSwapHandler.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/HotSwapHandler.java
@@ -66,31 +66,26 @@ public class HotSwapHandler extends AbstractHandlerContainer
*/
public void setHandler(Handler handler)
{
+ if (handler == null)
+ throw new IllegalArgumentException("Parameter handler is null.");
try
{
Handler old_handler = _handler;
_handler = handler;
- if (handler != null)
- {
- handler.setServer(getServer());
- if (isStarted())
- handler.start();
- }
+ Server server = getServer();
+ handler.setServer(server);
+ addBean(handler);
- if (getServer() != null)
- getServer().getContainer().update(this,old_handler,handler,"handler");
+ if (server != null)
+ server.getContainer().update(this,old_handler,handler,"handler");
// if there is an old handler and it was started, stop it
- if (old_handler != null && isStarted())
+ if (old_handler != null)
{
- old_handler.stop();
+ removeBean(old_handler);
}
}
- catch (RuntimeException e)
- {
- throw e;
- }
catch (Exception e)
{
throw new RuntimeException(e);
@@ -104,8 +99,6 @@ public class HotSwapHandler extends AbstractHandlerContainer
@Override
protected void doStart() throws Exception
{
- if (_handler != null)
- _handler.start();
super.doStart();
}
@@ -117,8 +110,6 @@ public class HotSwapHandler extends AbstractHandlerContainer
protected void doStop() throws Exception
{
super.doStop();
- if (_handler != null)
- _handler.stop();
}
/* ------------------------------------------------------------ */
@@ -155,6 +146,8 @@ public class HotSwapHandler extends AbstractHandlerContainer
}
/* ------------------------------------------------------------ */
+ @SuppressWarnings(
+ { "rawtypes", "unchecked" })
@Override
protected Object expandChildren(Object list, Class byClass)
{