[Project] updated strolch maven archetypes

This commit is contained in:
Robert von Burg 2019-09-25 11:16:00 +02:00
parent 2f6b7e7b05
commit d9aadc61f5
4 changed files with 24 additions and 19 deletions

View File

@ -6,6 +6,7 @@
<Properties>
<locale>en</locale>
<verbose>true</verbose>
<timezone>Europe/Zurich</timezone>
</Properties>
</Runtime>
<Component>

View File

@ -33,18 +33,16 @@ public class Main {
throw e;
}
Runtime.getRuntime().addShutdownHook(new Thread() {
public void run() {
try {
Thread.sleep(200);
System.out.println("Shutting down ...");
Main.agent.stop();
Main.agent.destroy();
} catch (InterruptedException e) {
logger.error("Failed to stop " + APP_NAME + " due to " + e.getMessage(), e);
}
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
try {
Thread.sleep(200);
System.out.println("Shutting down ...");
Main.agent.stop();
Main.agent.destroy();
} catch (InterruptedException e) {
logger.error("Failed to stop " + APP_NAME + " due to " + e.getMessage(), e);
}
});
}));
long took = System.currentTimeMillis() - start;
logger.info("Started " + APP_NAME + " in " + (StringHelper.formatMillisecondsDuration(took)));

View File

@ -24,6 +24,13 @@ public class PostInitializer extends SimplePostInitializer {
@Override
public void start() throws Exception {
registerJobs();
notifyStart();
super.start();
}
private void registerJobs() throws Exception {
if (!getContainer().hasComponent(StrolchJobsHandler.class))
return;
@ -45,10 +52,6 @@ public class PostInitializer extends SimplePostInitializer {
JobMode.Recurring, 5, TimeUnit.MINUTES, 6, TimeUnit.HOURS);
jobsHandler.register(archiveExecutedActivitiesJob).runNow();
}
notifyStart();
super.start();
}
private void notifyStart() {

View File

@ -24,6 +24,13 @@ public class PostInitializer extends SimplePostInitializer {
@Override
public void start() throws Exception {
registerJobs();
notifyStart();
super.start();
}
private void registerJobs() throws Exception {
if (!getContainer().hasComponent(StrolchJobsHandler.class))
return;
@ -45,10 +52,6 @@ public class PostInitializer extends SimplePostInitializer {
JobMode.Recurring, 5, TimeUnit.MINUTES, 6, TimeUnit.HOURS);
jobsHandler.register(archiveExecutedActivitiesJob).runNow();
}
notifyStart();
super.start();
}
private void notifyStart() {