comparison gnv-artifacts/src/main/java/de/intevation/gnv/transition/TransitionFactory.java @ 204:734ac082c8d1

Split the Configuration File in several small Documents to speed up the Artifactinstantiation and also make the administration of the Artifactdatabase easier. issue40 and issue59 gnv-artifacts/trunk@259 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Thu, 22 Oct 2009 08:50:21 +0000
parents 7fb9441dd8af
children
comparison
equal deleted inserted replaced
203:226091ed3cbd 204:734ac082c8d1
4 package de.intevation.gnv.transition; 4 package de.intevation.gnv.transition;
5 5
6 import org.apache.log4j.Logger; 6 import org.apache.log4j.Logger;
7 import org.w3c.dom.Node; 7 import org.w3c.dom.Node;
8 8
9 import de.intevation.artifactdatabase.Config;
10 import de.intevation.gnv.artifacts.GNVArtifactBase; 9 import de.intevation.gnv.artifacts.GNVArtifactBase;
11 10
12 /** 11 /**
13 * @author Tim Englich <tim.englich@intevation.de> 12 * @author Tim Englich <tim.englich@intevation.de>
14 * 13 *
38 37
39 public Transition createTransition(Node configuration) { 38 public Transition createTransition(Node configuration) {
40 log.debug("TransitionFactory.createTransition"); 39 log.debug("TransitionFactory.createTransition");
41 Transition transition = null; 40 Transition transition = null;
42 try { 41 try {
43 String classname = Config.getStringXPath(configuration, 42 String classname = ((org.w3c.dom.Element)configuration).getAttribute("transition");
44 "@transition");
45 transition = (Transition) (Class.forName(classname).newInstance()); 43 transition = (Transition) (Class.forName(classname).newInstance());
46 transition.setup(configuration); 44 transition.setup(configuration);
47 } catch (InstantiationException e) { 45 } catch (InstantiationException e) {
48 log.error(e, e); 46 log.error(e, e);
49 } catch (IllegalAccessException e) { 47 } catch (IllegalAccessException e) {

http://dive4elements.wald.intevation.org