diff 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
line wrap: on
line diff
--- a/artifacts/src/main/java/de/intevation/artifacts/Artifact.java	Fri Sep 04 16:06:44 2009 +0000
+++ b/artifacts/src/main/java/de/intevation/artifacts/Artifact.java	Sun Sep 06 12:00:56 2009 +0000
@@ -22,6 +22,15 @@
  *   <li>{@link #out(Document, Object) out()}: Produces output for this artifact.</li>
  * </ol>
  *
+ * There are two more methods involved with the life cycle of the are:
+ * <ol>
+ *   <li>{@link #setup(String, Object) setup()}: Called after created by the 
+ *                                               factory.</li>
+ *   <li>{@link #endOfLife(Object) endOfLife()}: Called when the artifact
+ *                                               is going to be removed from
+ *                                               system. Useful to clean up.</li>
+ * </ol>
+ *
  * @author Sascha L. Teichmann (sascha.teichmann@intevation.de)
  */
 public interface Artifact
@@ -72,6 +81,14 @@
     public byte [] out(Document format, Object context);
 
     /**
+     * When created by a factory this method is called to
+     * initialize the artifact.
+     * @param identifier The identifier from artifact database
+     * @param context    The global context of the runtime system.
+     */
+    public void setup(String identifier, Object context);
+
+    /**
      * Called from artifact database when an artifact is
      * going to be removed from system.
      * @param context The global context of the runtime system.

http://dive4elements.wald.intevation.org