annotate artifact-database/src/main/java/de/intevation/artifactdatabase/ProxyArtifact.java @ 94:5332d956729c

Brought all line lengths of non Javadoc lines below 80. artifacts/trunk@937 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Sat, 17 Apr 2010 10:28:43 +0000
parents e27cf9c84eb8
children 933bbc9fc11f
rev   line source
58
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
1 package de.intevation.artifactdatabase;
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
2
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
3 import de.intevation.artifacts.Artifact;
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
4 import de.intevation.artifacts.CallContext;
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
5
93
e27cf9c84eb8 Unified imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 90
diff changeset
6 import java.io.IOException;
e27cf9c84eb8 Unified imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 90
diff changeset
7 import java.io.OutputStream;
e27cf9c84eb8 Unified imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 90
diff changeset
8
58
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
9 import org.apache.log4j.Logger;
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
10
93
e27cf9c84eb8 Unified imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 90
diff changeset
11 import org.w3c.dom.Document;
58
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
12
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
13 /**
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
14 * The proxy artifact is a wrapper around another artifact. It simply forwards
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
15 * the interface calls to this underlaying artifact.
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
16 * The reason for using proxy artifacts is enable the workflow to exchange
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
17 * artifacts at any time by something else without losing the concrete
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
18 * artifact. From the outside it always looks like there is only one
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
19 * distinct artifact.<br>
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
20 *
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
21 * An inner artifact is able to replace itself by indirectly hand over
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
22 * the replacement via the call context to the proxy artifact.<br>
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
23 * To do so the proxied artifact has to call
90
68285f7bc476 More javadoc.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 89
diff changeset
24 * <code>callContext.getContextValue(EPLACE_PROXY, replacement);</code>.
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
25 * After the current call (describe, feed, advance and out) of the proxied
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
26 * artifact is finished the proxy artifact replaces the former proxied artifact
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
27 * with the replacement.
90
68285f7bc476 More javadoc.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 89
diff changeset
28 *
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: 60
diff changeset
29 * @author <a href="mailto:sascha.teichmann@intevation.de">Sascha L. Teichmann</a>
58
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
30 */
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
31 public class ProxyArtifact
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
32 extends DefaultArtifact
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
33 {
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
34 /**
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
35 * Key to signal that the proxied artifact should be replaced.
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
36 */
58
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
37 public static final Object REPLACE_PROXY = new Object();
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
38
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
39 private static Logger logger = Logger.getLogger(ProxyArtifact.class);
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
40
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
41 /**
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
42 * The proxied artifact.
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
43 */
58
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
44 protected Artifact proxied;
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
45
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
46 /**
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
47 * Default constructor.
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
48 */
58
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
49 public ProxyArtifact() {
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
50 }
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
51
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
52 /**
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
53 * Constructor to create a new proxy artifact around a given artifact.
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
54 * @param proxied The artifact to be proxied.
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
55 */
58
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
56 public ProxyArtifact(Artifact proxied) {
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
57 this.proxied = proxied;
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
58 }
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
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: 86
diff changeset
60 /**
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
61 * The currently proxied artifact.
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
62 * @return The proxied artifact.
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
63 */
58
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
64 public Artifact getProxied() {
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
65 return proxied;
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
66 }
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
67
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
68 /**
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
69 * Explicitly set the proxied artifacts.
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
70 * @param proxied
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
71 */
58
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
72 public void setProxied(Artifact proxied) {
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
73 this.proxied = proxied;
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
74 }
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
75
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
76 @Override
81
e9c80fdfee13 Set new identifiers on artifacts after an artifact import.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
77 public void setIdentifier(String identifier) {
e9c80fdfee13 Set new identifiers on artifacts after an artifact import.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
78 this.identifier = identifier;
e9c80fdfee13 Set new identifiers on artifacts after an artifact import.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
79
e9c80fdfee13 Set new identifiers on artifacts after an artifact import.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
80 if (proxied != null)
e9c80fdfee13 Set new identifiers on artifacts after an artifact import.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
81 proxied.setIdentifier(identifier);
e9c80fdfee13 Set new identifiers on artifacts after an artifact import.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
82 }
e9c80fdfee13 Set new identifiers on artifacts after an artifact import.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
83
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
84 /**
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
85 * Method to check if the current proxied artifact should be replaced
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
86 * by a new one coming from the call context.
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
87 * @param callContext
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
88 */
58
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
89 protected void checkReplacement(CallContext callContext) {
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
90 Object replacement = callContext.getContextValue(REPLACE_PROXY);
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
91 if (replacement instanceof Artifact) {
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
92 setProxied((Artifact)replacement);
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
93 }
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
94 }
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
95
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
96 @Override
58
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
97 public String hash() {
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
98 return proxied != null
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
99 ? proxied.hash()
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
100 : super.hash();
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
101 }
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
102
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
103 @Override
58
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
104 public Document describe(Document data, CallContext context) {
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
105 try {
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
106 return proxied != null
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
107 ? proxied.describe(data, context)
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
108 : super.describe(data, context);
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
109 }
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
110 finally {
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
111 checkReplacement(context);
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
112 }
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
113 }
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
114
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
115 @Override
58
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
116 public Document advance(Document target, CallContext context) {
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
117 try {
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
118 return proxied != null
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
119 ? proxied.advance(target, context)
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
120 : super.advance(target, context);
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
121 }
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
122 finally {
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
123 checkReplacement(context);
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
124 }
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
125 }
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
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: 86
diff changeset
127 @Override
58
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
128 public Document feed(Document target, CallContext context) {
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
129 try {
86
b2e0cb83631c Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 82
diff changeset
130 return proxied != null
58
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
131 ? proxied.feed(target, context)
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
132 : super.feed(target, context);
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
133 }
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
134 finally {
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
135 checkReplacement(context);
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
136 }
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
137 }
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
138
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
139 @Override
58
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
140 public void out(
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
141 Document format,
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
142 OutputStream out,
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
143 CallContext context
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
144 )
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
145 throws IOException
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
146 {
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
147 try {
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
148 if (proxied != null) {
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
149 proxied.out(format, out, context);
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
150 }
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
151 else {
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
152 super.out(format, out, context);
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
153 }
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
154 }
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
155 finally {
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
156 checkReplacement(context);
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
157 }
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
158 }
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
159
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
160 @Override
58
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
161 public void endOfLife(Object context) {
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
162 if (proxied != null) {
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
163 proxied.endOfLife(context);
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
164 }
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
165 else {
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
166 super.endOfLife(context);
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
167 }
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
168 }
82
efe752c4f8b2 Call cleanup method to remove special data stored by an 'out'-target before exporting an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 81
diff changeset
169
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
170 @Override
82
efe752c4f8b2 Call cleanup method to remove special data stored by an 'out'-target before exporting an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 81
diff changeset
171 public void cleanup(Object context) {
efe752c4f8b2 Call cleanup method to remove special data stored by an 'out'-target before exporting an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 81
diff changeset
172 if (proxied != null)
efe752c4f8b2 Call cleanup method to remove special data stored by an 'out'-target before exporting an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 81
diff changeset
173 proxied.cleanup(context);
efe752c4f8b2 Call cleanup method to remove special data stored by an 'out'-target before exporting an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 81
diff changeset
174 else
efe752c4f8b2 Call cleanup method to remove special data stored by an 'out'-target before exporting an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 81
diff changeset
175 super.cleanup(context);
efe752c4f8b2 Call cleanup method to remove special data stored by an 'out'-target before exporting an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 81
diff changeset
176 }
58
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
177 }
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
178 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org