annotate artifact-database/src/main/java/de/intevation/artifactdatabase/DefaultService.java @ 95:0edcaf5b5c78

The path to database can be configured with a path relative to the configuration directory. artifacts/trunk@1007 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 27 Apr 2010 16:12:37 +0000
parents 68285f7bc476
children 933bbc9fc11f
rev   line source
69
498bb84334d0 Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
1 package de.intevation.artifactdatabase;
498bb84334d0 Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
2
498bb84334d0 Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
3 import de.intevation.artifacts.CallMeta;
498bb84334d0 Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
4 import de.intevation.artifacts.Service;
498bb84334d0 Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
5 import de.intevation.artifacts.ServiceFactory;
498bb84334d0 Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
6
498bb84334d0 Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
7 import org.apache.log4j.Logger;
498bb84334d0 Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
8
498bb84334d0 Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
9 import org.w3c.dom.Document;
498bb84334d0 Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
10
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 69
diff changeset
11 /**
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 69
diff changeset
12 * Trivial implementation of an artifact database service. Useful to
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 69
diff changeset
13 * be subclassed.
90
68285f7bc476 More javadoc.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 89
diff changeset
14 *
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 69
diff changeset
15 * @author <a href="mailto:sascha.teichmann@intevation.de">Sascha L. Teichmann</a>
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 69
diff changeset
16 */
69
498bb84334d0 Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
17 public class DefaultService
498bb84334d0 Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
18 implements Service
498bb84334d0 Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
19 {
498bb84334d0 Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
20 private static Logger logger = Logger.getLogger(DefaultService.class);
498bb84334d0 Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
21
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 69
diff changeset
22 public Document process(
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 69
diff changeset
23 Document data,
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 69
diff changeset
24 Object globalContext,
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 69
diff changeset
25 CallMeta callMeta
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 69
diff changeset
26 ) {
69
498bb84334d0 Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
27 if (logger.isDebugEnabled()) {
498bb84334d0 Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
28 logger.debug("Service.process");
498bb84334d0 Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
29 }
498bb84334d0 Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
30 return XMLUtils.newDocument();
498bb84334d0 Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
31 }
498bb84334d0 Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
32
498bb84334d0 Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
33 public void setup(ServiceFactory factory, Object globalContext) {
498bb84334d0 Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
34 if (logger.isDebugEnabled()) {
498bb84334d0 Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
35 logger.debug("Service.setup");
498bb84334d0 Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
36 }
498bb84334d0 Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
37 }
498bb84334d0 Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
38 }
498bb84334d0 Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
39 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org