annotate artifact-database/src/main/java/org/dive4elements/artifactdatabase/App.java @ 568:5cd1c627cda9 3.2.x

Rely on log4j's default initialization procedure This should make upgrading to Log4j 2.x easier. In passing, use latest Log4j 1.
author Tom Gottfried <tom@intevation.de>
date Fri, 25 Feb 2022 15:01:23 +0100
parents 3b1e48d22ce0
children
rev   line source
100
933bbc9fc11f Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 93
diff changeset
1 /*
933bbc9fc11f Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 93
diff changeset
2 * Copyright (c) 2010 by Intevation GmbH
933bbc9fc11f Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 93
diff changeset
3 *
933bbc9fc11f Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 93
diff changeset
4 * This program is free software under the LGPL (>=v2.1)
933bbc9fc11f Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 93
diff changeset
5 * Read the file LGPL.txt coming with the software for details
933bbc9fc11f Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 93
diff changeset
6 * or visit http://www.gnu.org/licenses/ if it does not exist.
933bbc9fc11f Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 93
diff changeset
7 */
933bbc9fc11f Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 93
diff changeset
8
475
415df0fc4fa1 Fixed maven group ids
Sascha L. Teichmann <teichmann@intevation.de>
parents: 473
diff changeset
9 package org.dive4elements.artifactdatabase;
2
141457e0d7b1 Created a new sub project for artifact database server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
10
475
415df0fc4fa1 Fixed maven group ids
Sascha L. Teichmann <teichmann@intevation.de>
parents: 473
diff changeset
11 import org.dive4elements.artifactdatabase.rest.HTTPServer;
19
1259d192e3c3 * New configuration based on config directory
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 13
diff changeset
12
83
8c4638abd518 Installed a SLF4J bridge to route incoming jul logs (used by restlet) to log4j.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 79
diff changeset
13
5
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2
diff changeset
14 /**
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2
diff changeset
15 * Starting point of the artifact database.
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2
diff changeset
16 *
77
48d1a9a082c2 Bring @author javadoc tags in form '@author <a href="john.doe@example.com">John Doe</a>'
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 41
diff changeset
17 * @author <a href="mailto:sascha.teichmann@intevation.de">Sascha L. Teichmann</a>
5
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2
diff changeset
18 */
2
141457e0d7b1 Created a new sub project for artifact database server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
19 public class App
141457e0d7b1 Created a new sub project for artifact database server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
20 {
87
0f48188a6e02 Added some javadoc to the artifactdatabase module. Not done yet.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 83
diff changeset
21 /**
0f48188a6e02 Added some javadoc to the artifactdatabase module. Not done yet.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 83
diff changeset
22 * Starts the artifact database.
0f48188a6e02 Added some javadoc to the artifactdatabase module. Not done yet.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 83
diff changeset
23 * @param args The commandline arguments. Unused.
0f48188a6e02 Added some javadoc to the artifactdatabase module. Not done yet.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 83
diff changeset
24 */
2
141457e0d7b1 Created a new sub project for artifact database server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
25 public static void main(String[] args) {
19
1259d192e3c3 * New configuration based on config directory
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 13
diff changeset
26
5
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2
diff changeset
27 FactoryBootstrap bootstrap = new FactoryBootstrap();
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2
diff changeset
28
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2
diff changeset
29 bootstrap.boot();
13
0d6badf6af42 Added not yet working backend to artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 5
diff changeset
30
128
bfa65a812c7a Made the backend singleton.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 100
diff changeset
31 Backend backend = Backend.getInstance();
32
c2d53bd30ab8 Re-factored artifact API for better integration of background processing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 30
diff changeset
32
c2d53bd30ab8 Re-factored artifact API for better integration of background processing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 30
diff changeset
33 ArtifactDatabaseImpl db = new ArtifactDatabaseImpl(
c2d53bd30ab8 Re-factored artifact API for better integration of background processing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 30
diff changeset
34 bootstrap, backend);
c2d53bd30ab8 Re-factored artifact API for better integration of background processing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 30
diff changeset
35
30
88972c6daa4f Added a cleanup thread which periodically removes
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 19
diff changeset
36 DatabaseCleaner cleaner = new DatabaseCleaner(
541
3b1e48d22ce0 Experimentally let database cleaner and backend share the same sql executor.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 475
diff changeset
37 bootstrap.getContext(),
3b1e48d22ce0 Experimentally let database cleaner and backend share the same sql executor.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 475
diff changeset
38 backend,
3b1e48d22ce0 Experimentally let database cleaner and backend share the same sql executor.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 475
diff changeset
39 backend.getSQLExecutor(),
3b1e48d22ce0 Experimentally let database cleaner and backend share the same sql executor.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 475
diff changeset
40 backend.getConfig());
30
88972c6daa4f Added a cleanup thread which periodically removes
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 19
diff changeset
41
263
c0fb96f88ad1 Make used HTTP server exchangeable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 230
diff changeset
42 HTTPServer httpServer = bootstrap.getHTTPServer();
c0fb96f88ad1 Make used HTTP server exchangeable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 230
diff changeset
43
79
f69e5b87f05f Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
44 bootstrap = null;
f69e5b87f05f Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
45
32
c2d53bd30ab8 Re-factored artifact API for better integration of background processing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 30
diff changeset
46 backend.setCleaner(cleaner);
30
88972c6daa4f Added a cleanup thread which periodically removes
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 19
diff changeset
47
230
fbd57d2eeaef Changed semantics of locked artifact ids.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 207
diff changeset
48 cleaner.setLockedIdsProvider(db);
13
0d6badf6af42 Added not yet working backend to artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 5
diff changeset
49
32
c2d53bd30ab8 Re-factored artifact API for better integration of background processing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 30
diff changeset
50 cleaner.start();
19
1259d192e3c3 * New configuration based on config directory
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 13
diff changeset
51
304
40b64b4aafce Added lifetime listeners to be called when system is up and is going down.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 263
diff changeset
52 db.start();
40b64b4aafce Added lifetime listeners to be called when system is up and is going down.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 263
diff changeset
53
263
c0fb96f88ad1 Make used HTTP server exchangeable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 230
diff changeset
54 httpServer.startAsServer(db);
2
141457e0d7b1 Created a new sub project for artifact database server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
55 }
141457e0d7b1 Created a new sub project for artifact database server.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
56 }
79
f69e5b87f05f Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
57 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org