annotate artifact-database/src/main/java/de/intevation/artifactdatabase/FactoryBootstrap.java @ 265:d52947ce8629

XMLUtils.xpathString() returns empty string not null. artifacts/trunk@1976 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Mon, 23 May 2011 09:56:15 +0000
parents c0fb96f88ad1
children 39c0ff00d188
rev   line source
100
933bbc9fc11f Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 94
diff changeset
1 /*
933bbc9fc11f Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 94
diff changeset
2 * Copyright (c) 2010 by Intevation GmbH
933bbc9fc11f Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 94
diff changeset
3 *
933bbc9fc11f Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 94
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: 94
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: 94
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: 94
diff changeset
7 */
933bbc9fc11f Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 94
diff changeset
8
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:
diff changeset
9 package de.intevation.artifactdatabase;
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
10
207
b2115f484edb Move Config and XMLUtils totally to commons package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 155
diff changeset
11 import de.intevation.artifacts.common.utils.Config;
b2115f484edb Move Config and XMLUtils totally to commons package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 155
diff changeset
12
155
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
13 import de.intevation.artifacts.ArtifactCollectionFactory;
70
ce488c1d3fc4 Serve services over artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 19
diff changeset
14 import de.intevation.artifacts.ArtifactContextFactory;
ce488c1d3fc4 Serve services over artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 19
diff changeset
15 import de.intevation.artifacts.ArtifactFactory;
249
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
16 import de.intevation.artifacts.CallContext;
70
ce488c1d3fc4 Serve services over artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 19
diff changeset
17 import de.intevation.artifacts.ServiceFactory;
125
cee54e52000c Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 100
diff changeset
18 import de.intevation.artifacts.UserFactory;
70
ce488c1d3fc4 Serve services over artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 19
diff changeset
19
263
c0fb96f88ad1 Make used HTTP server exchangeable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 249
diff changeset
20
c0fb96f88ad1 Make used HTTP server exchangeable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 249
diff changeset
21 import de.intevation.artifactdatabase.rest.HTTPServer;
c0fb96f88ad1 Make used HTTP server exchangeable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 249
diff changeset
22
70
ce488c1d3fc4 Serve services over artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 19
diff changeset
23 import java.util.ArrayList;
ce488c1d3fc4 Serve services over artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 19
diff changeset
24
ce488c1d3fc4 Serve services over artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 19
diff changeset
25 import org.apache.log4j.Logger;
ce488c1d3fc4 Serve services over artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 19
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:
diff changeset
27 import org.w3c.dom.Document;
130
147610c43863 The UserFactory got a setup() method that is called while bootstrap.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 127
diff changeset
28 import org.w3c.dom.Node;
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:
diff changeset
29 import org.w3c.dom.NodeList;
79
f69e5b87f05f Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
30
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:
diff changeset
31 /**
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
32 * Bootstrap facility for the global context and the artifact factories.
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
33 *
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: 71
diff changeset
34 * @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:
diff changeset
35 */
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
36 public class 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:
diff changeset
37 {
17
5a6b6a3debc7 Integrated logging into artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 16
diff changeset
38 private static Logger logger = Logger.getLogger(FactoryBootstrap.class);
5a6b6a3debc7 Integrated logging into artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 16
diff changeset
39
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
40 /**
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
41 * XPath to figure out the class name of the context factory from
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
42 * the global configuration.
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
43 */
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:
diff changeset
44 public static final String CONTEXT_FACTORY =
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
45 "/artifact-database/factories/context-factory/text()";
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
46
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
47 /**
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
48 * The name of the default context factory.
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
49 */
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:
diff changeset
50 public static final String DEFAULT_CONTEXT_FACTORY =
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
51 "de.intevation.artifactdatabase.DefaultArtifactContextFactory";
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
52
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
53 /**
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
54 * XPath to figure out the names of the artifact factories from
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
55 * the global configuration to be exposed by the artifact database.
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
56 */
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:
diff changeset
57 public static final String ARTIFACT_FACTORIES =
16
635310c6a20e Bug fixed in in XPath Expression.
Tim Englich <tim.englich@intevation.de>
parents: 10
diff changeset
58 "/artifact-database/factories/artifact-factories/artifact-factory";
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:
diff changeset
59
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
60 /**
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
61 * XPath to figure out the names of the service factories from
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
62 * the global configuration to build the services offered by the
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
63 * artifact database.
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
64 */
71
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
65 public static final String SERVICE_FACTORIES =
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
66 "/artifact-database/factories/service-factories/service-factory";
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
67
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
68 /**
125
cee54e52000c Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 100
diff changeset
69 * XPath to figure out the class name of the user factory from global
cee54e52000c Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 100
diff changeset
70 * configuration.
cee54e52000c Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 100
diff changeset
71 */
cee54e52000c Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 100
diff changeset
72 public static final String USER_FACTORY =
155
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
73 "/artifact-database/factories/user-factory";
125
cee54e52000c Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 100
diff changeset
74
cee54e52000c Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 100
diff changeset
75 /**
cee54e52000c Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 100
diff changeset
76 * The name of the default user factory.
cee54e52000c Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 100
diff changeset
77 */
cee54e52000c Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 100
diff changeset
78 public static final String DEFAULT_USER_FACTORY =
cee54e52000c Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 100
diff changeset
79 "de.intevation.artifactdatabase.DefaultUserFactory";
cee54e52000c Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 100
diff changeset
80
cee54e52000c Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 100
diff changeset
81 /**
155
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
82 * XPath to figure out the class name of the collection factory from global
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
83 * configuration.
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
84 */
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
85 public static final String COLLECTION_FACTORY =
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
86 "/artifact-database/factories/collection-factory";
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
87
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
88 /**
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
89 * The name of the default user factory.
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
90 */
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
91 public static final String DEFAULT_COLLECTION_FACTORY =
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
92 "de.intevation.artifactdatabase.DefaultArtifactCollectionFactory";
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
93
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
94 /**
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
95 * XPath to figure out the secret used to sign the artifact exports
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
96 * made by the artfifact database server.
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
97 */
79
f69e5b87f05f Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
98 public static final String EXPORT_SECRET =
f69e5b87f05f Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
99 "/artifact-database/export-secret/text()";
f69e5b87f05f Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
100
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
101 /**
249
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
102 * XPAth that points to a configuration node for a CallContext.Listener.
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
103 */
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
104 public static final String CALLCONTEXT_LISTENER =
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
105 "/artifact-database/callcontext-listener";
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
106
263
c0fb96f88ad1 Make used HTTP server exchangeable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 249
diff changeset
107
c0fb96f88ad1 Make used HTTP server exchangeable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 249
diff changeset
108 public static final String HTTP_SERVER =
c0fb96f88ad1 Make used HTTP server exchangeable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 249
diff changeset
109 "/artifact-database/rest-server/http-server/text()";
c0fb96f88ad1 Make used HTTP server exchangeable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 249
diff changeset
110
c0fb96f88ad1 Make used HTTP server exchangeable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 249
diff changeset
111 public static final String DEFAULT_HTTP_SERVER =
c0fb96f88ad1 Make used HTTP server exchangeable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 249
diff changeset
112 "de.intevation.artifactdatabase.rest.Standalone";
c0fb96f88ad1 Make used HTTP server exchangeable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 249
diff changeset
113
249
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
114 /**
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
115 * Default export signing secret.
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
116 * <strong>PLEASE CHANGE THE SECRET VIA THE XPATH EXPORT_SECRET
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
117 * IN THE CONFIGURATION.</strong>.
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
118 */
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
119 public static final String DEFAULT_EXPORT_SECRET =
79
f69e5b87f05f Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
120 "!!!CHANGE ME! I'M NO SECRET!!!";
f69e5b87f05f Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
121
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
122 /**
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
123 * Reference to the global context build by the global context factory.
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
124 */
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:
diff changeset
125 protected Object context;
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
126
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
127 /**
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
128 * List of the artifact factories to be exposed by the
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
129 * artifact database.
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
130 */
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:
diff changeset
131 protected ArtifactFactory [] artifactFactories;
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
132
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
133 /**
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
134 * List of service factories which creates services that are
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
135 * exposed by the artifact database.
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
136 */
71
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
137 protected ServiceFactory [] serviceFactories;
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
138
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
139 /**
125
cee54e52000c Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 100
diff changeset
140 * The factory that is used to create and list users.
cee54e52000c Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 100
diff changeset
141 */
cee54e52000c Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 100
diff changeset
142 protected UserFactory userFactory;
cee54e52000c Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 100
diff changeset
143
cee54e52000c Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 100
diff changeset
144 /**
155
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
145 * The factory that is used to create new artifact collections.
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
146 */
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
147 protected ArtifactCollectionFactory collectionFactory;
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
148
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
149 /**
249
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
150 * The CallContext.Listener.
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
151 */
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
152 protected CallContext.Listener callContextListener;
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
153
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
154 /**
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
155 * byte array holding the export signing secret.
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
156 */
79
f69e5b87f05f Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
157 protected byte [] exportSecret;
f69e5b87f05f Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
158
263
c0fb96f88ad1 Make used HTTP server exchangeable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 249
diff changeset
159 protected HTTPServer httpServer;
c0fb96f88ad1 Make used HTTP server exchangeable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 249
diff changeset
160
79
f69e5b87f05f Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
161
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
162 /**
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
163 * Default constructor
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
164 */
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:
diff changeset
165 public 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:
diff changeset
166 }
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
167
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
168 void buildContext() {
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
169 String className = Config.getStringXPath(
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
170 CONTEXT_FACTORY, DEFAULT_CONTEXT_FACTORY);
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
171
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
172 ArtifactContextFactory factory = null;
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
173
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
174 try {
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
175 Class clazz = Class.forName(className);
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
176 factory = (ArtifactContextFactory)clazz.newInstance();
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
177 }
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
178 catch (ClassNotFoundException cnfe) {
17
5a6b6a3debc7 Integrated logging into artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 16
diff changeset
179 logger.error(cnfe.getLocalizedMessage(), cnfe);
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:
diff changeset
180 }
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
181 catch (InstantiationException ie) {
17
5a6b6a3debc7 Integrated logging into artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 16
diff changeset
182 logger.error(ie.getLocalizedMessage(), ie);
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:
diff changeset
183 }
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
184 catch (ClassCastException cce) {
17
5a6b6a3debc7 Integrated logging into artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 16
diff changeset
185 logger.error(cce.getLocalizedMessage(), cce);
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:
diff changeset
186 }
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
187 catch (IllegalAccessException iae) {
17
5a6b6a3debc7 Integrated logging into artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 16
diff changeset
188 logger.error(iae.getLocalizedMessage(), iae);
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:
diff changeset
189 }
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
190
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
191 if (factory == null) {
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
192 factory = new DefaultArtifactContextFactory();
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
193 }
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
194
19
1259d192e3c3 * New configuration based on config directory
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 17
diff changeset
195 logger.info("Using class '" + factory.getClass().getName()
1259d192e3c3 * New configuration based on config directory
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 17
diff changeset
196 + "' for context creation.");
1259d192e3c3 * New configuration based on config directory
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 17
diff changeset
197
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:
diff changeset
198 context = factory.createArtifactContext(Config.getConfig());
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
199 }
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
200
155
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
201
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
202 /**
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
203 * Scans the global configuration to load the configured collection factory
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
204 * and sets it up.
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
205 */
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
206 protected void loadCollectionFactory() {
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
207
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
208 logger.info("loading collection factory.");
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
209
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
210 Node factory = Config.getNodeXPath(COLLECTION_FACTORY);
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
211
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
212 String className = Config.getStringXPath(
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
213 factory, "text()", DEFAULT_COLLECTION_FACTORY);
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
214
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
215 try {
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
216 Class clazz = Class.forName(className);
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
217 collectionFactory = (ArtifactCollectionFactory) clazz.newInstance();
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
218
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
219 collectionFactory.setup(Config.getConfig(), factory);
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
220 }
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
221 catch (ClassNotFoundException cnfe) {
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
222 logger.error(cnfe.getLocalizedMessage(), cnfe);
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
223 }
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
224 catch (InstantiationException ie) {
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
225 logger.error(ie.getLocalizedMessage(), ie);
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
226 }
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
227 catch (ClassCastException cce) {
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
228 logger.error(cce.getLocalizedMessage(), cce);
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
229 }
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
230 catch (IllegalAccessException iae) {
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
231 logger.error(iae.getLocalizedMessage(), iae);
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
232 }
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
233 }
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
234
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
235 /**
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
236 * Scans the global configuration to load the configured
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
237 * artifact factories and sets them up.
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
238 */
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:
diff changeset
239 protected void loadArtifactFactories() {
71
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
240
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
241 logger.info("loading artifact factories");
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
242
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:
diff changeset
243 ArrayList loadedFactories = new ArrayList();
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
244
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
245 NodeList nodes = Config.getNodeSetXPath(ARTIFACT_FACTORIES);
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
246
10
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 7
diff changeset
247 if (nodes == null) {
17
5a6b6a3debc7 Integrated logging into artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 16
diff changeset
248 logger.warn("No factories found");
10
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 7
diff changeset
249 }
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 7
diff changeset
250
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:
diff changeset
251 Document config = Config.getConfig();
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
252
19
1259d192e3c3 * New configuration based on config directory
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 17
diff changeset
253 for (int i = 0, N = nodes != null ? nodes.getLength() : 0; i < N; ++i) {
71
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
254 String className = nodes.item(i).getTextContent().trim();
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:
diff changeset
255
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
256 ArtifactFactory factory = null;
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
257
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
258 try {
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
259 Class clazz = Class.forName(className);
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
260 factory = (ArtifactFactory)clazz.newInstance();
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
261 }
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
262 catch (ClassNotFoundException cnfe) {
17
5a6b6a3debc7 Integrated logging into artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 16
diff changeset
263 logger.error(cnfe.getLocalizedMessage(), cnfe);
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:
diff changeset
264 }
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
265 catch (InstantiationException ie) {
17
5a6b6a3debc7 Integrated logging into artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 16
diff changeset
266 logger.error(ie.getLocalizedMessage(), ie);
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:
diff changeset
267 }
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
268 catch (ClassCastException cce) {
17
5a6b6a3debc7 Integrated logging into artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 16
diff changeset
269 logger.error(cce.getLocalizedMessage(), cce);
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:
diff changeset
270 }
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
271 catch (IllegalAccessException iae) {
17
5a6b6a3debc7 Integrated logging into artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 16
diff changeset
272 logger.error(iae.getLocalizedMessage(), iae);
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:
diff changeset
273 }
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
274
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
275 if (factory != null) {
19
1259d192e3c3 * New configuration based on config directory
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 17
diff changeset
276 factory.setup(config, nodes.item(i));
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:
diff changeset
277 loadedFactories.add(factory);
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
278 logger.info("Registering '"
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
279 + factory.getName() + "' as artifact factory.");
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:
diff changeset
280 }
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
281 }
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
282
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
283 artifactFactories = (ArtifactFactory [])loadedFactories.toArray(
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
284 new ArtifactFactory[loadedFactories.size()]);
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
285 }
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
286
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
287 /**
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
288 * Scans the global configuration for the configured service factories
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
289 * and sets them up.
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
290 */
71
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
291 protected void loadServiceFactories() {
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
292
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
293 logger.info("loading service factories");
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
294
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
295 ArrayList loadedFactories = new ArrayList();
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
296
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
297 NodeList nodes = Config.getNodeSetXPath(SERVICE_FACTORIES);
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
298
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
299 if (nodes == null) {
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
300 logger.warn("No factories found");
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
301 }
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
302
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
303 Document config = Config.getConfig();
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
304
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
305 for (int i = 0, N = nodes != null ? nodes.getLength() : 0; i < N; ++i) {
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
306 String className = nodes.item(i).getTextContent().trim();
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
307
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
308 ServiceFactory factory = null;
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
309
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
310 try {
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
311 Class clazz = Class.forName(className);
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
312 factory = (ServiceFactory)clazz.newInstance();
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
313 }
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
314 catch (ClassNotFoundException cnfe) {
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
315 logger.error(cnfe.getLocalizedMessage(), cnfe);
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
316 }
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
317 catch (InstantiationException ie) {
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
318 logger.error(ie.getLocalizedMessage(), ie);
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
319 }
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
320 catch (ClassCastException cce) {
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
321 logger.error(cce.getLocalizedMessage(), cce);
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
322 }
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
323 catch (IllegalAccessException iae) {
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
324 logger.error(iae.getLocalizedMessage(), iae);
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
325 }
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
326
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
327 if (factory != null) {
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
328 factory.setup(config, nodes.item(i));
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
329 loadedFactories.add(factory);
94
5332d956729c Brought all line lengths of non Javadoc lines below 80.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 89
diff changeset
330 logger.info( "Registering '" + factory.getName()
5332d956729c Brought all line lengths of non Javadoc lines below 80.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 89
diff changeset
331 + "' as service factory.");
71
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
332 }
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
333 }
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
334
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
335 serviceFactories = (ServiceFactory [])loadedFactories.toArray(
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
336 new ServiceFactory[loadedFactories.size()]);
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
337 }
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
338
125
cee54e52000c Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 100
diff changeset
339
cee54e52000c Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 100
diff changeset
340 /**
cee54e52000c Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 100
diff changeset
341 * Scans the global configuration for the configured user factory.
cee54e52000c Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 100
diff changeset
342 */
cee54e52000c Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 100
diff changeset
343 protected void loadUserFactory() {
cee54e52000c Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 100
diff changeset
344 logger.info("loading user factory");
cee54e52000c Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 100
diff changeset
345
130
147610c43863 The UserFactory got a setup() method that is called while bootstrap.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 127
diff changeset
346 Node factory = Config.getNodeXPath(USER_FACTORY);
147610c43863 The UserFactory got a setup() method that is called while bootstrap.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 127
diff changeset
347
125
cee54e52000c Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 100
diff changeset
348 String className = Config.getStringXPath(
130
147610c43863 The UserFactory got a setup() method that is called while bootstrap.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 127
diff changeset
349 factory, "text()", DEFAULT_USER_FACTORY);
125
cee54e52000c Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 100
diff changeset
350
cee54e52000c Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 100
diff changeset
351 try {
cee54e52000c Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 100
diff changeset
352 Class clazz = Class.forName(className);
cee54e52000c Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 100
diff changeset
353 userFactory = (UserFactory) clazz.newInstance();
130
147610c43863 The UserFactory got a setup() method that is called while bootstrap.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 127
diff changeset
354
147610c43863 The UserFactory got a setup() method that is called while bootstrap.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 127
diff changeset
355 userFactory.setup(Config.getConfig(), factory);
125
cee54e52000c Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 100
diff changeset
356 }
cee54e52000c Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 100
diff changeset
357 catch (ClassNotFoundException cnfe) {
cee54e52000c Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 100
diff changeset
358 logger.error(cnfe.getLocalizedMessage(), cnfe);
cee54e52000c Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 100
diff changeset
359 }
cee54e52000c Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 100
diff changeset
360 catch (InstantiationException ie) {
cee54e52000c Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 100
diff changeset
361 logger.error(ie.getLocalizedMessage(), ie);
cee54e52000c Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 100
diff changeset
362 }
cee54e52000c Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 100
diff changeset
363 catch (ClassCastException cce) {
cee54e52000c Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 100
diff changeset
364 logger.error(cce.getLocalizedMessage(), cce);
cee54e52000c Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 100
diff changeset
365 }
cee54e52000c Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 100
diff changeset
366 catch (IllegalAccessException iae) {
cee54e52000c Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 100
diff changeset
367 logger.error(iae.getLocalizedMessage(), iae);
cee54e52000c Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 100
diff changeset
368 }
cee54e52000c Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 100
diff changeset
369 }
cee54e52000c Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 100
diff changeset
370
249
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
371
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
372 protected void loadCallContextListener() {
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
373 logger.info("loading CallContext.Listener");
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
374
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
375 Node listener = Config.getNodeXPath(CALLCONTEXT_LISTENER);
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
376
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
377 if (listener == null) {
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
378 return;
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
379 }
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
380
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
381 String className = Config.getStringXPath(listener, "text()");
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
382
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
383 try {
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
384 Class clazz = Class.forName(className);
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
385 callContextListener = (CallContext.Listener) clazz.newInstance();
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
386
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
387 callContextListener.setup(Config.getConfig(), listener);
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
388 }
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
389 catch (ClassNotFoundException cnfe) {
263
c0fb96f88ad1 Make used HTTP server exchangeable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 249
diff changeset
390 logger.error(cnfe.getLocalizedMessage(), cnfe);
c0fb96f88ad1 Make used HTTP server exchangeable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 249
diff changeset
391 }
c0fb96f88ad1 Make used HTTP server exchangeable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 249
diff changeset
392 catch (InstantiationException ie) {
c0fb96f88ad1 Make used HTTP server exchangeable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 249
diff changeset
393 logger.error(ie.getLocalizedMessage(), ie);
c0fb96f88ad1 Make used HTTP server exchangeable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 249
diff changeset
394 }
c0fb96f88ad1 Make used HTTP server exchangeable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 249
diff changeset
395 catch (ClassCastException cce) {
c0fb96f88ad1 Make used HTTP server exchangeable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 249
diff changeset
396 logger.error(cce.getLocalizedMessage(), cce);
c0fb96f88ad1 Make used HTTP server exchangeable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 249
diff changeset
397 }
c0fb96f88ad1 Make used HTTP server exchangeable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 249
diff changeset
398 catch (IllegalAccessException iae) {
c0fb96f88ad1 Make used HTTP server exchangeable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 249
diff changeset
399 logger.error(iae.getLocalizedMessage(), iae);
c0fb96f88ad1 Make used HTTP server exchangeable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 249
diff changeset
400 }
c0fb96f88ad1 Make used HTTP server exchangeable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 249
diff changeset
401 }
c0fb96f88ad1 Make used HTTP server exchangeable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 249
diff changeset
402
c0fb96f88ad1 Make used HTTP server exchangeable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 249
diff changeset
403 protected void loadHTTPServer() {
c0fb96f88ad1 Make used HTTP server exchangeable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 249
diff changeset
404 logger.info("loading HTTPServer");
c0fb96f88ad1 Make used HTTP server exchangeable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 249
diff changeset
405
c0fb96f88ad1 Make used HTTP server exchangeable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 249
diff changeset
406 String className = Config.getStringXPath(
c0fb96f88ad1 Make used HTTP server exchangeable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 249
diff changeset
407 HTTP_SERVER, DEFAULT_HTTP_SERVER);
c0fb96f88ad1 Make used HTTP server exchangeable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 249
diff changeset
408
265
d52947ce8629 XMLUtils.xpathString() returns empty string not null.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 263
diff changeset
409 logger.info("using HTTP server: " + className);
d52947ce8629 XMLUtils.xpathString() returns empty string not null.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 263
diff changeset
410
263
c0fb96f88ad1 Make used HTTP server exchangeable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 249
diff changeset
411 try {
c0fb96f88ad1 Make used HTTP server exchangeable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 249
diff changeset
412 Class clazz = Class.forName(className);
c0fb96f88ad1 Make used HTTP server exchangeable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 249
diff changeset
413 httpServer = (HTTPServer)clazz.newInstance();
c0fb96f88ad1 Make used HTTP server exchangeable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 249
diff changeset
414
c0fb96f88ad1 Make used HTTP server exchangeable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 249
diff changeset
415 httpServer.setup(Config.getConfig());
c0fb96f88ad1 Make used HTTP server exchangeable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 249
diff changeset
416 }
c0fb96f88ad1 Make used HTTP server exchangeable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 249
diff changeset
417 catch (ClassNotFoundException cnfe) {
c0fb96f88ad1 Make used HTTP server exchangeable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 249
diff changeset
418 logger.error(cnfe.getLocalizedMessage(), cnfe);
249
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
419 }
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
420 catch (InstantiationException ie) {
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
421 logger.error(ie.getLocalizedMessage(), ie);
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
422 }
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
423 catch (ClassCastException cce) {
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
424 logger.error(cce.getLocalizedMessage(), cce);
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
425 }
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
426 catch (IllegalAccessException iae) {
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
427 logger.error(iae.getLocalizedMessage(), iae);
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
428 }
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
429 }
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
430
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
431 /**
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
432 * Fetches the export signing secret from the global configuration.
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
433 * If none is found if defaults to the DEFAULT_EXORT_SECRET which
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
434 * is insecure.
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
435 */
79
f69e5b87f05f Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
436 protected void setupExportSecret() {
f69e5b87f05f Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
437 String secret = Config.getStringXPath(EXPORT_SECRET);
f69e5b87f05f Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
438
f69e5b87f05f Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
439 if (secret == null) {
f69e5b87f05f Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
440 logger.warn("NO EXPORT SECRET SET! USING INSECURE DEFAULT!");
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
441 secret = DEFAULT_EXPORT_SECRET;
79
f69e5b87f05f Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
442 }
f69e5b87f05f Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
443
f69e5b87f05f Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
444 exportSecret = StringUtils.getUTF8Bytes(secret);
f69e5b87f05f Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
445 }
f69e5b87f05f Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
446
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
447 /**
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
448 * Loads all the dynamic classes configured by the global configuration.
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
449 */
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:
diff changeset
450 public void boot() {
79
f69e5b87f05f Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
451 setupExportSecret();
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:
diff changeset
452 buildContext();
155
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
453 loadCollectionFactory();
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:
diff changeset
454 loadArtifactFactories();
71
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
455 loadServiceFactories();
125
cee54e52000c Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 100
diff changeset
456 loadUserFactory();
249
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
457 loadCallContextListener();
263
c0fb96f88ad1 Make used HTTP server exchangeable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 249
diff changeset
458 loadHTTPServer();
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:
diff changeset
459 }
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
460
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
461 /**
155
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
462 * Returns the artifact collection factory.
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
463 *
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
464 * @return the artifact collection factory.
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
465 */
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
466 public ArtifactCollectionFactory getArtifactCollectionFactory() {
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
467 return collectionFactory;
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
468 }
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
469
f797093c60bd Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 130
diff changeset
470 /**
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
471 * Returns the list of ready to use artifact factories.
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
472 * @return The list of artifact factories.
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
473 */
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:
diff changeset
474 public ArtifactFactory [] getArtifactFactories() {
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
475 return artifactFactories;
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
476 }
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
477
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
478 /**
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
479 * Returns the ready to use service factories.
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
480 * @return The list of service factories.
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
481 */
70
ce488c1d3fc4 Serve services over artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 19
diff changeset
482 public ServiceFactory [] getServiceFactories() {
71
c99da6837be0 Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 70
diff changeset
483 return serviceFactories;
70
ce488c1d3fc4 Serve services over artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 19
diff changeset
484 }
ce488c1d3fc4 Serve services over artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 19
diff changeset
485
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
486 /**
127
0245a87df368 Made the user factory available in the artifact database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 125
diff changeset
487 * Returns the user factory.
0245a87df368 Made the user factory available in the artifact database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 125
diff changeset
488 *
0245a87df368 Made the user factory available in the artifact database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 125
diff changeset
489 * @return the user factory.
0245a87df368 Made the user factory available in the artifact database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 125
diff changeset
490 */
0245a87df368 Made the user factory available in the artifact database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 125
diff changeset
491 public UserFactory getUserFactory() {
0245a87df368 Made the user factory available in the artifact database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 125
diff changeset
492 return userFactory;
0245a87df368 Made the user factory available in the artifact database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 125
diff changeset
493 }
0245a87df368 Made the user factory available in the artifact database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 125
diff changeset
494
0245a87df368 Made the user factory available in the artifact database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 125
diff changeset
495 /**
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
496 * Returns the global context created by the global context factory.
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
497 * @return The global context.
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
498 */
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:
diff changeset
499 public Object getContext() {
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
500 return context;
8f2de197bce2 Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
501 }
79
f69e5b87f05f Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
502
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
503 /**
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
504 * Returns the signing secret to be used when ex- and importing
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
505 * artifacts from and into the artifact database.
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
506 * @return the byte array containg the signing secret.
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 79
diff changeset
507 */
79
f69e5b87f05f Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
508 public byte [] getExportSecret() {
f69e5b87f05f Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
509 return exportSecret;
f69e5b87f05f Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
510 }
249
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
511
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
512 /**
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
513 * Returns a CallContext.Listener if configured or null.
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
514 *
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
515 * @return a CallContext.Listener.
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
516 */
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
517 public CallContext.Listener getCallContextListener() {
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
518 return callContextListener;
c47a640cfdae Enhanced the bootstrap - the CallContext.Listener is initialized (if configured).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
519 }
263
c0fb96f88ad1 Make used HTTP server exchangeable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 249
diff changeset
520
c0fb96f88ad1 Make used HTTP server exchangeable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 249
diff changeset
521 public HTTPServer getHTTPServer() {
c0fb96f88ad1 Make used HTTP server exchangeable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 249
diff changeset
522 return httpServer;
c0fb96f88ad1 Make used HTTP server exchangeable.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 249
diff changeset
523 }
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:
diff changeset
524 }
79
f69e5b87f05f Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
525 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org