annotate artifact-database/src/main/java/de/intevation/artifactdatabase/ProxyArtifact.java @ 341:e0efa2c28d19

Helper function to create a document to remove an artifact from an collection. artifacts/trunk@2958 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Thu, 13 Oct 2011 12:19:43 +0000
parents 933bbc9fc11f
children
rev   line source
100
933bbc9fc11f Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 93
diff changeset
1 /*
933bbc9fc11f Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 93
diff changeset
2 * Copyright (c) 2010 by Intevation GmbH
933bbc9fc11f Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 93
diff changeset
3 *
933bbc9fc11f Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 93
diff changeset
4 * This program is free software under the LGPL (>=v2.1)
933bbc9fc11f Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 93
diff changeset
5 * Read the file LGPL.txt coming with the software for details
933bbc9fc11f Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 93
diff changeset
6 * or visit http://www.gnu.org/licenses/ if it does not exist.
933bbc9fc11f Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 93
diff changeset
7 */
933bbc9fc11f Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 93
diff changeset
8
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 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
10
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
11 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
12 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
13
93
e27cf9c84eb8 Unified imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 90
diff changeset
14 import java.io.IOException;
e27cf9c84eb8 Unified imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 90
diff changeset
15 import java.io.OutputStream;
e27cf9c84eb8 Unified imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 90
diff changeset
16
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
17 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
18
93
e27cf9c84eb8 Unified imports.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 90
diff changeset
19 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
20
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
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: 86
diff changeset
22 * 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
23 * 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
24 * 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
25 * 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
26 * 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
27 * distinct artifact.<br>
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
28 *
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
29 * 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
30 * 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
31 * To do so the proxied artifact has to call
90
68285f7bc476 More javadoc.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 89
diff changeset
32 * <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
33 * 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
34 * 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
35 * with the replacement.
90
68285f7bc476 More javadoc.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 89
diff changeset
36 *
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
37 * @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
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 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
40 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
41 {
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
42 /**
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
43 * 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
44 */
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
45 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
46
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
47 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
48
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
49 /**
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
50 * The proxied artifact.
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
51 */
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
52 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
53
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
54 /**
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
55 * Default constructor.
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
56 */
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
57 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
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 * 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
62 * @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
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 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
65 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
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 * The currently proxied artifact.
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
70 * @return The proxied artifact.
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 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
73 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
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 /**
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
77 * Explicitly set the proxied artifacts.
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
78 * @param proxied
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
79 */
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
80 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
81 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
82 }
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
83
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
84 @Override
81
e9c80fdfee13 Set new identifiers on artifacts after an artifact import.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
85 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
86 this.identifier = identifier;
e9c80fdfee13 Set new identifiers on artifacts after an artifact import.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
87
e9c80fdfee13 Set new identifiers on artifacts after an artifact import.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
88 if (proxied != null)
e9c80fdfee13 Set new identifiers on artifacts after an artifact import.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
89 proxied.setIdentifier(identifier);
e9c80fdfee13 Set new identifiers on artifacts after an artifact import.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
90 }
e9c80fdfee13 Set new identifiers on artifacts after an artifact import.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
91
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
92 /**
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
93 * 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
94 * 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
95 * @param callContext
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
96 */
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 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
98 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
99 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
100 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
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 }
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
103
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
104 @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
105 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
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.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
108 : 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
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
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
111 @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
112 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
113 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
114 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
115 ? 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
116 : 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
117 }
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 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
119 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
120 }
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
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
123 @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
124 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
125 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
126 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
127 ? 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
128 : 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
129 }
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
130 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
131 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
132 }
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
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
135 @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
136 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
137 try {
86
b2e0cb83631c Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 82
diff changeset
138 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
139 ? 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
140 : 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
141 }
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 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
143 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
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 }
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
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
147 @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
148 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
149 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
150 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
151 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
152 )
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 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
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 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
156 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
157 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
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 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
160 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
161 }
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 }
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 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
164 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
165 }
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 }
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
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
168 @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
169 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
170 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
171 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
172 }
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
173 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
174 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
175 }
39fec7d714dc Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
176 }
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
177
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
178 @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
179 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
180 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
181 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
182 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
183 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
184 }
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
185 }
89
d348fe1fd822 More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
186 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org