Fixes #341206 (Stop order is wrong in HandlerWrapper).
git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@2919 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
parent
f1a3caeaca
commit
0dcf64caa1
|
@ -11,10 +11,11 @@ jetty-7.3.2-SNAPSHOT
|
|||
+ 340878 Integrations should be able to load their own keystores
|
||||
+ 340920 Dynamically assign RMI registry port for integration testing
|
||||
+ 341006 Move inner enums out into separate file
|
||||
+ 341105 Stack trace is printed for an ignored exception
|
||||
+ 341105 Stack trace is printed for an ignored exception
|
||||
+ 341145 WebAppContext MBean attribute serverClasses returns empty value
|
||||
+ Ensure generated fragment names are unique
|
||||
+ JETTY-1245 Pooled Buffers implementation
|
||||
+ 341206 Stop order is wrong in HandlerWrapper
|
||||
|
||||
jetty-7.3.1.v20110307 7 March 2011
|
||||
+ 316382 Support a more strict SSL option with certificates
|
||||
|
|
|
@ -4,17 +4,16 @@
|
|||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// and Apache License v2.0 which accompanies this distribution.
|
||||
// The Eclipse Public License is available at
|
||||
// The Eclipse Public License is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
// The Apache License v2.0 is available at
|
||||
// http://www.opensource.org/licenses/apache2.0.php
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// You may elect to redistribute this code under either of these licenses.
|
||||
// ========================================================================
|
||||
|
||||
package org.eclipse.jetty.server.handler;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
@ -27,7 +26,7 @@ import org.eclipse.jetty.util.component.LifeCycle;
|
|||
/* ------------------------------------------------------------ */
|
||||
/** A <code>HandlerWrapper</code> acts as a {@link Handler} but delegates the {@link Handler#handle handle} method and
|
||||
* {@link LifeCycle life cycle} events to a delegate. This is primarily used to implement the <i>Decorator</i> pattern.
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class HandlerWrapper extends AbstractHandlerContainer
|
||||
{
|
||||
|
@ -35,7 +34,7 @@ public class HandlerWrapper extends AbstractHandlerContainer
|
|||
|
||||
/* ------------------------------------------------------------ */
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
public HandlerWrapper()
|
||||
{
|
||||
|
@ -49,7 +48,7 @@ public class HandlerWrapper extends AbstractHandlerContainer
|
|||
{
|
||||
return _handler;
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
/**
|
||||
* @return Returns the handlers.
|
||||
|
@ -60,7 +59,7 @@ public class HandlerWrapper extends AbstractHandlerContainer
|
|||
return new Handler[0];
|
||||
return new Handler[] {_handler};
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
/**
|
||||
* @param handler Set the {@link Handler} which should be wrapped.
|
||||
|
@ -69,7 +68,7 @@ public class HandlerWrapper extends AbstractHandlerContainer
|
|||
{
|
||||
if (isStarted())
|
||||
throw new IllegalStateException(STARTED);
|
||||
|
||||
|
||||
Handler old_handler = _handler;
|
||||
|
||||
if (getServer()!=null)
|
||||
|
@ -82,9 +81,9 @@ public class HandlerWrapper extends AbstractHandlerContainer
|
|||
|
||||
_handler = handler;
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
/*
|
||||
/*
|
||||
* @see org.eclipse.thread.AbstractLifeCycle#doStart()
|
||||
*/
|
||||
@Override
|
||||
|
@ -94,19 +93,19 @@ public class HandlerWrapper extends AbstractHandlerContainer
|
|||
_handler.start();
|
||||
super.doStart();
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
/*
|
||||
/*
|
||||
* @see org.eclipse.thread.AbstractLifeCycle#doStop()
|
||||
*/
|
||||
@Override
|
||||
protected void doStop() throws Exception
|
||||
{
|
||||
super.doStop();
|
||||
if (_handler!=null)
|
||||
_handler.stop();
|
||||
super.doStop();
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
|
||||
{
|
||||
|
@ -115,7 +114,7 @@ public class HandlerWrapper extends AbstractHandlerContainer
|
|||
_handler.handle(target,baseRequest, request, response);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
@Override
|
||||
|
@ -124,20 +123,20 @@ public class HandlerWrapper extends AbstractHandlerContainer
|
|||
Server old_server=getServer();
|
||||
if (server==old_server)
|
||||
return;
|
||||
|
||||
|
||||
if (isStarted())
|
||||
throw new IllegalStateException(STARTED);
|
||||
|
||||
|
||||
super.setServer(server);
|
||||
|
||||
|
||||
Handler h=getHandler();
|
||||
if (h!=null)
|
||||
h.setServer(server);
|
||||
|
||||
|
||||
if (server!=null && server!=old_server)
|
||||
server.getContainer().update(this, null,_handler, "handler");
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
@Override
|
||||
|
@ -160,7 +159,7 @@ public class HandlerWrapper extends AbstractHandlerContainer
|
|||
else break;
|
||||
}
|
||||
return null;
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
|
@ -177,5 +176,5 @@ public class HandlerWrapper extends AbstractHandlerContainer
|
|||
}
|
||||
super.destroy();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue