CE-1887 Test on QAppJavalinServer

This commit is contained in:
2024-10-21 13:41:54 -05:00
parent c5fdfceae6
commit a5051e559a
2 changed files with 232 additions and 3 deletions

View File

@ -74,6 +74,8 @@ public class QApplicationJavalinServer
private long millisBetweenHotSwaps = 2500;
private Consumer<QInstance> hotSwapCustomizer = null;
private Javalin service;
/*******************************************************************************
@ -94,7 +96,7 @@ public class QApplicationJavalinServer
{
QInstance qInstance = application.defineValidatedQInstance();
Javalin service = Javalin.create(config ->
service = Javalin.create(config ->
{
if(serveFrontendMaterialDashboard)
{
@ -187,6 +189,22 @@ public class QApplicationJavalinServer
/***************************************************************************
**
***************************************************************************/
public void stop()
{
if(this.service == null)
{
LOG.info("Stop called, but there is no javalin service, so noop.");
return;
}
this.service.stop();
}
/*******************************************************************************
** If there's a qInstanceHotSwapSupplier, and its been a little while, replace
** the qInstance with a new one from the supplier. Meant to be used while doing
@ -440,12 +458,14 @@ public class QApplicationJavalinServer
/*******************************************************************************
** Fluent setter for MILLIS_BETWEEN_HOT_SWAPS
*******************************************************************************/
public void withMillisBetweenHotSwaps(long millisBetweenHotSwaps)
public QApplicationJavalinServer withMillisBetweenHotSwaps(long millisBetweenHotSwaps)
{
this.millisBetweenHotSwaps = millisBetweenHotSwaps;
return (this);
}
/*******************************************************************************
** Getter for hotSwapCustomizer
*******************************************************************************/
@ -506,5 +526,4 @@ public class QApplicationJavalinServer
return (this);
}
}