Mercurial > dive4elements > framework
comparison artifacts/src/main/java/de/intevation/artifacts/Artifact.java @ 10:e8626caac353
* Made Artifact life cycle symmetric: setup/endOfLife.
* Implement defaults for Artifact and ArtifactFactory.
* Added connection pooling from apache commons dbcp
* Made sql schema of artifact database more compatible.
* Improve example config.
* Made artifactdb start with 'mvn exec:exec'
* minor fixes.
artifacts/trunk@25 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Sun, 06 Sep 2009 12:00:56 +0000 |
parents | a5a279a0ee35 |
children | d5dc2900392f |
comparison
equal
deleted
inserted
replaced
9:a5a279a0ee35 | 10:e8626caac353 |
---|---|
18 * <li>{@link #describe(Object)}: Returns a description of this artifact.</li> | 18 * <li>{@link #describe(Object)}: Returns a description of this artifact.</li> |
19 * <li>{@link #advance(Document, Object) advance()}: Advances this artifact | 19 * <li>{@link #advance(Document, Object) advance()}: Advances this artifact |
20 * to the next internal state</li> | 20 * to the next internal state</li> |
21 * <li>{@link #feed(Document, Object) feed()}: Feed new data into this artifact.</li> | 21 * <li>{@link #feed(Document, Object) feed()}: Feed new data into this artifact.</li> |
22 * <li>{@link #out(Document, Object) out()}: Produces output for this artifact.</li> | 22 * <li>{@link #out(Document, Object) out()}: Produces output for this artifact.</li> |
23 * </ol> | |
24 * | |
25 * There are two more methods involved with the life cycle of the are: | |
26 * <ol> | |
27 * <li>{@link #setup(String, Object) setup()}: Called after created by the | |
28 * factory.</li> | |
29 * <li>{@link #endOfLife(Object) endOfLife()}: Called when the artifact | |
30 * is going to be removed from | |
31 * system. Useful to clean up.</li> | |
23 * </ol> | 32 * </ol> |
24 * | 33 * |
25 * @author Sascha L. Teichmann (sascha.teichmann@intevation.de) | 34 * @author Sascha L. Teichmann (sascha.teichmann@intevation.de) |
26 */ | 35 */ |
27 public interface Artifact | 36 public interface Artifact |
70 * @return a byte representation of the output. | 79 * @return a byte representation of the output. |
71 */ | 80 */ |
72 public byte [] out(Document format, Object context); | 81 public byte [] out(Document format, Object context); |
73 | 82 |
74 /** | 83 /** |
84 * When created by a factory this method is called to | |
85 * initialize the artifact. | |
86 * @param identifier The identifier from artifact database | |
87 * @param context The global context of the runtime system. | |
88 */ | |
89 public void setup(String identifier, Object context); | |
90 | |
91 /** | |
75 * Called from artifact database when an artifact is | 92 * Called from artifact database when an artifact is |
76 * going to be removed from system. | 93 * going to be removed from system. |
77 * @param context The global context of the runtime system. | 94 * @param context The global context of the runtime system. |
78 */ | 95 */ |
79 public void endOfLife(Object context); | 96 public void endOfLife(Object context); |