summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorThomas Becker2012-01-20 07:39:57 (EST)
committer Thomas Becker2012-03-01 09:32:22 (EST)
commitab5592daf0a37f486bea6d17eafe925a51a2f826 (patch)
treea9b54aac80ed73da791a560def5aa6ee5d8cf35d
parent5c0c8c7e73c86dd334e856cc28d1cefae3a8f462 (diff)
downloadorg.eclipse.jetty.project-ab5592daf0a37f486bea6d17eafe925a51a2f826.zip
org.eclipse.jetty.project-ab5592daf0a37f486bea6d17eafe925a51a2f826.tar.gz
org.eclipse.jetty.project-ab5592daf0a37f486bea6d17eafe925a51a2f826.tar.bz2
369214: HotSwapHandler code formatrefs/changes/07/5207/1
-rw-r--r--jetty-server/src/main/java/org/eclipse/jetty/server/handler/HotSwapHandler.java72
1 files changed, 36 insertions, 36 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 dadf6e6..534d83b 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
@@ -24,8 +24,8 @@ import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.Server;
/* ------------------------------------------------------------ */
-/** A <code>HandlerContainer</code> that allows a hot swap
- * of a wrapped handler.
+/**
+ * A <code>HandlerContainer</code> that allows a hot swap of a wrapped handler.
*
*/
public class HotSwapHandler extends AbstractHandlerContainer
@@ -48,19 +48,21 @@ public class HotSwapHandler extends AbstractHandlerContainer
{
return _handler;
}
-
+
/* ------------------------------------------------------------ */
/**
* @return Returns the handlers.
*/
public Handler[] getHandlers()
{
- return new Handler[] {_handler};
+ return new Handler[]
+ { _handler };
}
-
+
/* ------------------------------------------------------------ */
/**
- * @param handler Set the {@link Handler} which should be wrapped.
+ * @param handler
+ * Set the {@link Handler} which should be wrapped.
*/
public void setHandler(Handler handler)
{
@@ -68,17 +70,16 @@ public class HotSwapHandler extends AbstractHandlerContainer
{
Handler old_handler = _handler;
_handler = handler;
- if (handler!=null)
+ if (handler != null)
{
handler.setServer(getServer());
if (isStarted())
handler.start();
}
- if (getServer()!=null)
- getServer().getContainer().update(this, old_handler, handler, "handler");
+ if (getServer() != null)
+ getServer().getContainer().update(this,old_handler,handler,"handler");
-
// if there is an old handler and it was started, stop it
if (old_handler != null && isStarted())
{
@@ -86,74 +87,73 @@ public class HotSwapHandler extends AbstractHandlerContainer
}
}
- catch(RuntimeException e)
+ catch (RuntimeException e)
{
throw e;
}
- catch(Exception e)
+ catch (Exception e)
{
throw new RuntimeException(e);
}
}
-
+
/* ------------------------------------------------------------ */
- /*
+ /*
* @see org.eclipse.thread.AbstractLifeCycle#doStart()
*/
@Override
protected void doStart() throws Exception
{
- if (_handler!=null)
+ if (_handler != null)
_handler.start();
super.doStart();
}
-
+
/* ------------------------------------------------------------ */
- /*
+ /*
* @see org.eclipse.thread.AbstractLifeCycle#doStop()
*/
@Override
protected void doStop() throws Exception
{
super.doStop();
- if (_handler!=null)
+ if (_handler != null)
_handler.stop();
}
-
+
/* ------------------------------------------------------------ */
- /*
+ /*
* @see org.eclipse.jetty.server.server.EventHandler#handle(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
*/
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{
- if (_handler!=null && isStarted())
+ if (_handler != null && isStarted())
{
- _handler.handle(target,baseRequest, request, response);
+ _handler.handle(target,baseRequest,request,response);
}
}
-
/* ------------------------------------------------------------ */
@Override
public void setServer(Server server)
{
- Server old_server=getServer();
- if (server==old_server)
+ Server old_server = getServer();
+ if (server == old_server)
return;
-
+
if (isRunning())
throw new IllegalStateException(RUNNING);
-
+
super.setServer(server);
-
- Handler h=getHandler();
- if (h!=null)
+
+ Handler h = getHandler();
+ if (h != null)
h.setServer(server);
-
- if (server!=null && server!=old_server)
- server.getContainer().update(this, null,_handler, "handler");
+
+ if (server != null && server != old_server)
+ server.getContainer().update(this,null,_handler,"handler");
}
-
+
/* ------------------------------------------------------------ */
@Override
protected Object expandChildren(Object list, Class byClass)
@@ -167,8 +167,8 @@ public class HotSwapHandler extends AbstractHandlerContainer
{
if (!isStopped())
throw new IllegalStateException("!STOPPED");
- Handler child=getHandler();
- if (child!=null)
+ Handler child = getHandler();
+ if (child != null)
{
setHandler(null);
child.destroy();