diff artifact-database/src/main/java/de/intevation/artifactdatabase/ArtifactDatabaseImpl.java @ 155:f797093c60bd

Made a (single one) artifact collection factory configurable. artifacts/trunk@1380 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 03 Mar 2011 09:51:09 +0000
parents 1a72f08ce8d7
children 6e6965873a48
line wrap: on
line diff
--- a/artifact-database/src/main/java/de/intevation/artifactdatabase/ArtifactDatabaseImpl.java	Thu Mar 03 09:36:03 2011 +0000
+++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/ArtifactDatabaseImpl.java	Thu Mar 03 09:51:09 2011 +0000
@@ -11,6 +11,7 @@
 import de.intevation.artifactdatabase.Backend.PersistentArtifact;
 
 import de.intevation.artifacts.Artifact;
+import de.intevation.artifacts.ArtifactCollectionFactory;
 import de.intevation.artifacts.ArtifactDatabase;
 import de.intevation.artifacts.ArtifactDatabaseException;
 import de.intevation.artifacts.ArtifactFactory;
@@ -386,6 +387,11 @@
     protected HashMap     name2service;
 
     /**
+     * The factory that is used to create new artifact collections.
+     */
+    protected ArtifactCollectionFactory collectionFactory;
+
+    /**
      * The factory that is used to create and list users.
      */
     protected UserFactory userFactory;
@@ -438,6 +444,7 @@
 
         backgroundIds = new HashSet();
 
+        setupArtifactCollectionFactory(bootstrap);
         setupArtifactFactories(bootstrap);
         setupServices(bootstrap);
         setupUserFactory(bootstrap);
@@ -449,6 +456,15 @@
     }
 
     /**
+     * Used to extract the artifact collection factory from bootstrap.
+     *
+     * @param bootstrap The bootstrap parameters.
+     */
+    protected void setupArtifactCollectionFactory(FactoryBootstrap bootstrap) {
+        collectionFactory = bootstrap.getArtifactCollectionFactory();
+    }
+
+    /**
      * Used to extract the artifact factories from the bootstrap
      * parameters and building the internal lookup tables.
      * @param bootstrap The bootstrap parameters.

http://dive4elements.wald.intevation.org