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-7.4.1-SNAPSHOT
|
||||||
|
+ JETTY-954 WebAppContext eats any start exceptions instead of stopping the server load
|
||||||
+ 343083 Set nested dispatch type and connection
|
+ 343083 Set nested dispatch type and connection
|
||||||
+ 343277 add support for a context white list
|
+ 343277 add support for a context white list
|
||||||
+ 343352 make sure that jetty.osgi.boot is activated when a WAB is registered
|
+ 343352 make sure that jetty.osgi.boot is activated when a WAB is registered
|
||||||
|
|
|
@ -234,6 +234,8 @@ public class Server extends HandlerWrapper implements Attributes
|
||||||
_dumpBeforeStop = dumpBeforeStop;
|
_dumpBeforeStop = dumpBeforeStop;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------ */
|
/* ------------------------------------------------------------ */
|
||||||
@Override
|
@Override
|
||||||
protected void doStart() throws Exception
|
protected void doStart() throws Exception
|
||||||
|
@ -254,7 +256,7 @@ public class Server extends HandlerWrapper implements Attributes
|
||||||
}
|
}
|
||||||
catch(Throwable e)
|
catch(Throwable e)
|
||||||
{
|
{
|
||||||
Log.warn("Error starting handlers",e);
|
mex.add(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_connectors!=null)
|
if (_connectors!=null)
|
||||||
|
|
|
@ -143,6 +143,7 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL
|
||||||
private boolean _configurationClassesSet=false;
|
private boolean _configurationClassesSet=false;
|
||||||
private boolean _configurationsSet=false;
|
private boolean _configurationsSet=false;
|
||||||
private boolean _allowDuplicateFragmentNames = false;
|
private boolean _allowDuplicateFragmentNames = false;
|
||||||
|
private boolean _throwUnavailableOnStartupException = false;
|
||||||
|
|
||||||
|
|
||||||
private MetaData _metadata=new MetaData();
|
private MetaData _metadata=new MetaData();
|
||||||
|
@ -448,6 +449,8 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL
|
||||||
Log.warn("Failed startup of context "+this, e);
|
Log.warn("Failed startup of context "+this, e);
|
||||||
_unavailableException=e;
|
_unavailableException=e;
|
||||||
setAvailable(false);
|
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
|
@Override
|
||||||
protected void startContext()
|
protected void startContext()
|
||||||
|
|
Loading…
Reference in New Issue