Signed-off-by: Jan Bartel <janb@webtide.com>
This commit is contained in:
Jan Bartel 2019-09-10 18:14:00 +10:00
parent aec8f0a32d
commit 6f0f9d5dcd
6 changed files with 17 additions and 21 deletions

View File

@ -217,17 +217,13 @@ public abstract class AbstractForker extends AbstractLifeCycle
ProcessBuilder command = createCommand();
Process process = command.start();
System.err.println("Started command");
if (waitForChild)
{
//keep executing until the child dies
System.err.println("Waiting for child");
process.waitFor();
}
else
{
System.err.println("NOT WAITING FOR CHILD");
//just wait until the child has started successfully
int attempts = maxChildChecks;
while (!tokenFile.exists() && attempts > 0)

View File

@ -233,8 +233,6 @@ public class JettyDistroForker extends AbstractForker
if (!env.isEmpty())
builder.environment().putAll(env);
System.err.println("COMMAND: "+builder.command());
if (waitForChild)
builder.inheritIO();
else
@ -415,8 +413,6 @@ public class JettyDistroForker extends AbstractForker
int i = name.lastIndexOf('.');
name = (i>0?name.substring(0, i):"distro");
jettyHome = new File (baseDir, name);
System.err.println("JETTY HOME = "+jettyHome);
}
}
}

View File

@ -217,14 +217,13 @@ public class JettyEmbedder extends AbstractLifeCycle
{
if (webAppProperties != null)
webAppProperties.clear();
if (props != null)
{
if (webAppProperties == null)
{
webAppProperties = new Properties();
webAppProperties.putAll(props);
}
webAppProperties.putAll(props);
}
}
@ -261,7 +260,6 @@ public class JettyEmbedder extends AbstractLifeCycle
//regenerate config properties
applyWebAppProperties();
System.err.println("WEbapp is stopped: "+webApp.isStopped());
webApp.start();
}
@ -332,10 +330,9 @@ public class JettyEmbedder extends AbstractLifeCycle
if (contextXml != null)
{
if (webAppProperties == null)
{
webAppProperties = new Properties();
webAppProperties.put("context.xml", contextXml);
}
webAppProperties.put("context.xml", contextXml);
}
WebAppPropertyConverter.fromProperties(webApp, webAppProperties, server, jettyProperties);
}

View File

@ -161,10 +161,8 @@ public class JettyForkedChild extends AbstractLifeCycle
{
//stop the webapp
jetty.getWebApp().stop();
System.err.println("STopped the webapp");
//reload the props
jetty.setWebAppProperties(loadWebAppProps());
System.err.println("Reset the webapp properties");
jetty.setWebApp(jetty.getWebApp());
//restart the webapp
jetty.redeployWebApp();

View File

@ -163,7 +163,6 @@ public class JettyForker extends AbstractForker
{
//regenerating the quickstart will be noticed by the JettyForkedChild process
//which will redeploy the webapp
System.err.println("Redeploying webapp");
generateQuickStart();
}
@ -191,7 +190,6 @@ public class JettyForker extends AbstractForker
//save config of the webapp BEFORE we stop
WebAppPropertyConverter.toProperties(webApp, webAppPropsFile, contextXml);
System.err.println("Generated Quickstart");
}
finally
{
@ -274,7 +272,6 @@ public class JettyForker extends AbstractForker
if (waitForChild)
{
System.err.println("Waiting and inheriting IO");
command.inheritIO();
}
else

View File

@ -191,6 +191,18 @@ public class QuickStartConfiguration extends AbstractConfiguration
}
}
@Override
public void postConfigure(WebAppContext context) throws Exception
{
super.postConfigure(context);
ServletContainerInitializersStarter starter = (ServletContainerInitializersStarter)context.getAttribute(AnnotationConfiguration.CONTAINER_INITIALIZER_STARTER);
if (starter != null)
{
context.removeBean(starter);
context.removeAttribute(AnnotationConfiguration.CONTAINER_INITIALIZER_STARTER);
}
}
protected void quickStart(WebAppContext context)
throws Exception
{