comparison 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
comparison
equal deleted inserted replaced
154:1a72f08ce8d7 155:f797093c60bd
9 package de.intevation.artifactdatabase; 9 package de.intevation.artifactdatabase;
10 10
11 import de.intevation.artifactdatabase.Backend.PersistentArtifact; 11 import de.intevation.artifactdatabase.Backend.PersistentArtifact;
12 12
13 import de.intevation.artifacts.Artifact; 13 import de.intevation.artifacts.Artifact;
14 import de.intevation.artifacts.ArtifactCollectionFactory;
14 import de.intevation.artifacts.ArtifactDatabase; 15 import de.intevation.artifacts.ArtifactDatabase;
15 import de.intevation.artifacts.ArtifactDatabaseException; 16 import de.intevation.artifacts.ArtifactDatabaseException;
16 import de.intevation.artifacts.ArtifactFactory; 17 import de.intevation.artifacts.ArtifactFactory;
17 import de.intevation.artifacts.ArtifactNamespaceContext; 18 import de.intevation.artifacts.ArtifactNamespaceContext;
18 import de.intevation.artifacts.ArtifactSerializer; 19 import de.intevation.artifacts.ArtifactSerializer;
384 * Map to access services by there name. 385 * Map to access services by there name.
385 */ 386 */
386 protected HashMap name2service; 387 protected HashMap name2service;
387 388
388 /** 389 /**
390 * The factory that is used to create new artifact collections.
391 */
392 protected ArtifactCollectionFactory collectionFactory;
393
394 /**
389 * The factory that is used to create and list users. 395 * The factory that is used to create and list users.
390 */ 396 */
391 protected UserFactory userFactory; 397 protected UserFactory userFactory;
392 398
393 /** 399 /**
436 */ 442 */
437 public ArtifactDatabaseImpl(FactoryBootstrap bootstrap, Backend backend) { 443 public ArtifactDatabaseImpl(FactoryBootstrap bootstrap, Backend backend) {
438 444
439 backgroundIds = new HashSet(); 445 backgroundIds = new HashSet();
440 446
447 setupArtifactCollectionFactory(bootstrap);
441 setupArtifactFactories(bootstrap); 448 setupArtifactFactories(bootstrap);
442 setupServices(bootstrap); 449 setupServices(bootstrap);
443 setupUserFactory(bootstrap); 450 setupUserFactory(bootstrap);
444 451
445 context = bootstrap.getContext(); 452 context = bootstrap.getContext();
446 exportSecret = bootstrap.getExportSecret(); 453 exportSecret = bootstrap.getExportSecret();
447 454
448 wireWithBackend(backend); 455 wireWithBackend(backend);
456 }
457
458 /**
459 * Used to extract the artifact collection factory from bootstrap.
460 *
461 * @param bootstrap The bootstrap parameters.
462 */
463 protected void setupArtifactCollectionFactory(FactoryBootstrap bootstrap) {
464 collectionFactory = bootstrap.getArtifactCollectionFactory();
449 } 465 }
450 466
451 /** 467 /**
452 * Used to extract the artifact factories from the bootstrap 468 * Used to extract the artifact factories from the bootstrap
453 * parameters and building the internal lookup tables. 469 * parameters and building the internal lookup tables.

http://dive4elements.wald.intevation.org