Skip to content

Commit a9aedda

Browse files
committed
close the application so that stop tasks can run
1 parent 8575647 commit a9aedda

5 files changed

Lines changed: 9 additions & 1 deletion

File tree

interfaces-ext/src/main/java/org/dllearner/cli/unife/CLIDistributedLEAP.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ public static void main(String[] args) throws ParseException, IOException,
162162
logger.debug("conf file set");
163163
logger.debug("Start Running");
164164
cli.run();
165+
cli.close();
165166
} catch (Exception e) {
166167
e.printStackTrace();
167168
String stacktraceFileName = "log/error.log";

interfaces/src/main/java/org/dllearner/cli/CLI.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ public static void main(String[] args) throws ParseException, IOException, Reaso
224224
cli.setContext(context);
225225
cli.setConfFile(file);
226226
cli.run();
227+
cli.close();
227228
} catch (Exception e) {
228229
String stacktraceFileName = "log/error.log";
229230

interfaces/src/main/java/org/dllearner/cli/CLIBase2.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import org.slf4j.Logger;
1313
import org.slf4j.LoggerFactory;
1414
import org.springframework.context.ApplicationContext;
15+
import org.springframework.context.ConfigurableApplicationContext;
1516
import org.springframework.core.io.FileSystemResource;
1617
import org.springframework.core.io.Resource;
1718

@@ -90,6 +91,10 @@ public void init() throws IOException {
9091

9192
public abstract void run();
9293

94+
public void close() {
95+
((ConfigurableApplicationContext)context).close();
96+
}
97+
9398
public void setContext(ApplicationContext context) {
9499
this.context = context;
95100
}

interfaces/src/main/java/org/dllearner/cli/SemKernelCLI.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public static void main(String[] args) throws FileNotFoundException {
7171
cli.setContext(context);
7272
cli.setConfFile(file);
7373
cli.run();
74-
74+
cli.close();
7575
} catch (Exception e) {e.printStackTrace();
7676
String stacktraceFileName = "log/error.log";
7777

interfaces/src/test/java/org/dllearner/test/junit/ExampleTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ public void testAllConfFiles() throws ComponentInitException {
178178
} else {
179179
System.out.println("Test skipped, because of GP or SPARQL settings.");
180180
}
181+
start.close();
181182
} catch (Exception e) {
182183
e.printStackTrace();
183184
// unit test not succesful (exceptions are caught explicitly to find

0 commit comments

Comments
 (0)