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:
parent
57c2cc31fa
commit
3b6dd2778b
|
@ -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
|
||||
|
|
|
@ -233,7 +233,9 @@ 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)
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1161,6 +1164,17 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL
|
|||
_allowDuplicateFragmentNames = allowDuplicateFragmentNames;
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
public void setThrowUnavailableOnStartupException (boolean throwIfStartupException) {
|
||||
_throwUnavailableOnStartupException = throwIfStartupException;
|
||||
}
|
||||
|
||||
|
||||
public boolean isThrowUnavailableOnStartupException () {
|
||||
return _throwUnavailableOnStartupException;
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue