From 85883a528500ac3d49027e9d335c8cff6f5e060e Mon Sep 17 00:00:00 2001 From: stroomdev66 Date: Sat, 15 Jul 2017 11:23:47 +0100 Subject: [PATCH] Further fixes to headless. --- .../main/java/stroom/headless/Headless.java | 27 +++++++++++-------- .../spring/HeadlessConfiguration.java | 6 ----- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/stroom-pipeline/src/main/java/stroom/headless/Headless.java b/stroom-pipeline/src/main/java/stroom/headless/Headless.java index edfe68468b7..5fe1f75e7c0 100644 --- a/stroom-pipeline/src/main/java/stroom/headless/Headless.java +++ b/stroom-pipeline/src/main/java/stroom/headless/Headless.java @@ -42,6 +42,7 @@ import stroom.util.logging.StroomLogger; import stroom.util.shared.ModelStringUtil; import stroom.util.spring.StroomSpringProfiles; +import stroom.util.task.ExternalShutdownController; import stroom.util.task.TaskScopeRunnable; import stroom.util.thread.ThreadScopeRunnable; import stroom.util.zip.StroomZipFile; @@ -142,19 +143,21 @@ private void init() { @Override public void run() { try { - StroomProperties.setProperty("stroom.jpaHbm2DdlAuto", "update", Source.TEST); + StroomProperties.setOverrideProperty("stroom.jpaHbm2DdlAuto", "update", Source.TEST); - StroomProperties.setProperty("stroom.jdbcDriverClassName", "org.hsqldb.jdbcDriver", Source.TEST); - StroomProperties.setProperty("stroom.jpaDialect", "org.hibernate.dialect.HSQLDialect", Source.TEST); - StroomProperties.setProperty("stroom.jdbcDriverUrl", "jdbc:hsqldb:file:${stroom.temp}/stroom/HSQLDB.DAT;shutdown=true", Source.TEST); - StroomProperties.setProperty("stroom.jdbcDriverUsername", "sa", Source.TEST); - StroomProperties.setProperty("stroom.jdbcDriverPassword", "", Source.TEST); + StroomProperties.setOverrideProperty("stroom.jdbcDriverClassName", "org.hsqldb.jdbcDriver", Source.TEST); + StroomProperties.setOverrideProperty("stroom.jpaDialect", "org.hibernate.dialect.HSQLDialect", Source.TEST); + StroomProperties.setOverrideProperty("stroom.jdbcDriverUrl", "jdbc:hsqldb:file:${stroom.temp}/stroom/HSQLDB.DAT;shutdown=true", Source.TEST); + StroomProperties.setOverrideProperty("stroom.jdbcDriverUsername", "sa", Source.TEST); + StroomProperties.setOverrideProperty("stroom.jdbcDriverPassword", "", Source.TEST); - StroomProperties.setProperty("stroom.statistics.sql.jdbcDriverClassName", "org.hsqldb.jdbcDriver", Source.TEST); - StroomProperties.setProperty("stroom.statistics.sql.jpaDialect", "org.hibernate.dialect.HSQLDialect", Source.TEST); - StroomProperties.setProperty("stroom.statistics.sql.jdbcDriverUrl", "jdbc:hsqldb:file:${stroom.temp}/statistics/HSQLDB.DAT;shutdown=true", Source.TEST); - StroomProperties.setProperty("stroom.statistics.sql.jdbcDriverUsername", "sa", Source.TEST); - StroomProperties.setProperty("stroom.statistics.sql.jdbcDriverPassword", "", Source.TEST); + StroomProperties.setOverrideProperty("stroom.statistics.sql.jdbcDriverClassName", "org.hsqldb.jdbcDriver", Source.TEST); + StroomProperties.setOverrideProperty("stroom.statistics.sql.jpaDialect", "org.hibernate.dialect.HSQLDialect", Source.TEST); + StroomProperties.setOverrideProperty("stroom.statistics.sql.jdbcDriverUrl", "jdbc:hsqldb:file:${stroom.temp}/statistics/HSQLDB.DAT;shutdown=true", Source.TEST); + StroomProperties.setOverrideProperty("stroom.statistics.sql.jdbcDriverUsername", "sa", Source.TEST); + StroomProperties.setOverrideProperty("stroom.statistics.sql.jdbcDriverPassword", "", Source.TEST); + + StroomProperties.setOverrideProperty("stroom.lifecycle.enabled", "false", Source.TEST); new TaskScopeRunnable(GenericServerTask.create("Headless Stroom", null)) { @Override @@ -169,6 +172,8 @@ protected void exec() { }.run(); } finally { StroomProperties.removeOverrides(); + + ExternalShutdownController.shutdown(); } } diff --git a/stroom-pipeline/src/main/java/stroom/headless/spring/HeadlessConfiguration.java b/stroom-pipeline/src/main/java/stroom/headless/spring/HeadlessConfiguration.java index bdef884e876..0b36ced1eb8 100644 --- a/stroom-pipeline/src/main/java/stroom/headless/spring/HeadlessConfiguration.java +++ b/stroom-pipeline/src/main/java/stroom/headless/spring/HeadlessConfiguration.java @@ -29,9 +29,7 @@ @Configuration @ComponentScan(basePackages = { "stroom.cache", - "stroom.cluster", "stroom.datafeed", - "stroom.db", "stroom.dictionary", "stroom.entity", "stroom.feed", @@ -42,17 +40,13 @@ "stroom.lifecycle", "stroom.node", "stroom.pipeline", - "stroom.policy", "stroom.pool", "stroom.process", - "stroom.proxy", - "stroom.query", "stroom.resource", "stroom.spring", "stroom.streamstore", "stroom.streamtask", "stroom.task", - "stroom.upgrade", "stroom.util", "stroom.volume", "stroom.xmlschema",