JETTY-954 WebApp context can now throw optionally throw an error out of doStart(), and the Server doStart() is modified to not catch and log all errors.

git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@3033 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
Jan Bartel 2011-04-27 07:35:59 +00:00
parent 57c2cc31fa
commit 3b6dd2778b
3 changed files with 19 additions and 2 deletions

View File

@ -1,4 +1,5 @@
jetty-7.4.1-SNAPSHOT
+ JETTY-954 WebAppContext eats any start exceptions instead of stopping the server load
+ 343083 Set nested dispatch type and connection
+ 343277 add support for a context white list
+ 343352 make sure that jetty.osgi.boot is activated when a WAB is registered

View File

@ -234,6 +234,8 @@ public class Server extends HandlerWrapper implements Attributes
_dumpBeforeStop = dumpBeforeStop;
}
/* ------------------------------------------------------------ */
@Override
protected void doStart() throws Exception
@ -254,7 +256,7 @@ public class Server extends HandlerWrapper implements Attributes
}
catch(Throwable e)
{
Log.warn("Error starting handlers",e);
mex.add(e);
}
if (_connectors!=null)

View File

@ -143,6 +143,7 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL
private boolean _configurationClassesSet=false;
private boolean _configurationsSet=false;
private boolean _allowDuplicateFragmentNames = false;
private boolean _throwUnavailableOnStartupException = false;
private MetaData _metadata=new MetaData();
@ -448,6 +449,8 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL
Log.warn("Failed startup of context "+this, e);
_unavailableException=e;
setAvailable(false);
if (isThrowUnavailableOnStartupException())
throw e;
}
}
@ -1162,6 +1165,17 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL
}
/* ------------------------------------------------------------ */
public void setThrowUnavailableOnStartupException (boolean throwIfStartupException) {
_throwUnavailableOnStartupException = throwIfStartupException;
}
public boolean isThrowUnavailableOnStartupException () {
return _throwUnavailableOnStartupException;
}
/* ------------------------------------------------------------ */
@Override
protected void startContext()