annotate artifacts/src/main/java/de/intevation/artifacts/ArtifactFactory.java @ 75:d4c4c23847f5

Extended the Artifact-Interface-Method setup to be able to put the XML-Document which can contain further Data to the Artifact-Implementation. artifacts/trunk@649 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Mon, 01 Feb 2010 13:54:05 +0000
parents 5e4bc24ea438
children 48d1a9a082c2
rev   line source
1
11c82d3f125e Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
1 package de.intevation.artifacts;
11c82d3f125e Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
2
33
251e8904d6c2 Make the Interfaces Serializable to make them usable in the Artifactdatabase.
Tim Englich <tim.englich@intevation.de>
parents: 10
diff changeset
3 import java.io.Serializable;
251e8904d6c2 Make the Interfaces Serializable to make them usable in the Artifactdatabase.
Tim Englich <tim.englich@intevation.de>
parents: 10
diff changeset
4
4
13a12b607baf Added mechanism to create an share a global context in the artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1
diff changeset
5 import org.w3c.dom.Document;
7
f95d9a449215 Insert new Parameter to Setuproutine
Tim Englich <tim.englich@intevation.de>
parents: 4
diff changeset
6 import org.w3c.dom.Node;
4
13a12b607baf Added mechanism to create an share a global context in the artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1
diff changeset
7
1
11c82d3f125e Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
8 /**
11c82d3f125e Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
9 * Interface of an artifact producing factory.
11c82d3f125e Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
10 *
11c82d3f125e Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
11 * @author Sascha L. Teichmann (sascha.teichmann@intevation.de)
11c82d3f125e Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
12 */
33
251e8904d6c2 Make the Interfaces Serializable to make them usable in the Artifactdatabase.
Tim Englich <tim.englich@intevation.de>
parents: 10
diff changeset
13 public interface ArtifactFactory extends Serializable
1
11c82d3f125e Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
14 {
11c82d3f125e Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
15 /**
11c82d3f125e Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
16 * The short name of this factory.
11c82d3f125e Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
17 * @return the name of this factory.
11c82d3f125e Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
18 */
11c82d3f125e Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
19 String getName();
11c82d3f125e Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
20
11c82d3f125e Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
21 /**
11c82d3f125e Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
22 * Description of this factory.
11c82d3f125e Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
23 * @return description of the factory.
11c82d3f125e Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
24 */
11c82d3f125e Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
25 String getDescription();
11c82d3f125e Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
26
11c82d3f125e Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
27 /**
11c82d3f125e Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
28 * Create a new artifact of certain type, given a general purpose context and
11c82d3f125e Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
29 * an identifier.
11c82d3f125e Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
30 * @param context a context from the ArtifactDatabase.
11c82d3f125e Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
31 * @param identifier unique identifer for the new artifact
75
d4c4c23847f5 Extended the Artifact-Interface-Method setup to be able to put the XML-Document which can contain further Data
Tim Englich <tim.englich@intevation.de>
parents: 41
diff changeset
32 * @param data the data containing more details for the setup of an Artifact.
1
11c82d3f125e Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
33 * @return a new {@linkplain de.intevation.artifacts.Artifact Artifact}
11c82d3f125e Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
34 */
75
d4c4c23847f5 Extended the Artifact-Interface-Method setup to be able to put the XML-Document which can contain further Data
Tim Englich <tim.englich@intevation.de>
parents: 41
diff changeset
35 Artifact createArtifact(String identifier, Object context, Document data);
4
13a12b607baf Added mechanism to create an share a global context in the artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1
diff changeset
36
13a12b607baf Added mechanism to create an share a global context in the artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1
diff changeset
37 /**
13a12b607baf Added mechanism to create an share a global context in the artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1
diff changeset
38 * Setup the factory with a given configuration
13a12b607baf Added mechanism to create an share a global context in the artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1
diff changeset
39 * @param config the configuration
7
f95d9a449215 Insert new Parameter to Setuproutine
Tim Englich <tim.englich@intevation.de>
parents: 4
diff changeset
40 * @param factoryNode the ConfigurationNode of this Factory
4
13a12b607baf Added mechanism to create an share a global context in the artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 1
diff changeset
41 */
7
f95d9a449215 Insert new Parameter to Setuproutine
Tim Englich <tim.englich@intevation.de>
parents: 4
diff changeset
42 void setup(Document config, Node factoryNode);
10
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 7
diff changeset
43
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 7
diff changeset
44 /**
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 7
diff changeset
45 * Tells how long an artifact should survive if it is
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 7
diff changeset
46 * not touched. This is put in the factory because
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 7
diff changeset
47 * life time is nothing a artifact should handle it self.
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 7
diff changeset
48 * This method is only called once directly after the
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 7
diff changeset
49 * artifact is created.
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 7
diff changeset
50 * @param artifact The artifact to be rated.
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 7
diff changeset
51 * @param context The global context.
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 7
diff changeset
52 * return time to live in ms. null means eternal.
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 7
diff changeset
53 */
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 7
diff changeset
54 Long timeToLiveUntouched(Artifact artifact, Object context);
41
5e4bc24ea438 Made serilization more flexible. DB update required!!!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 33
diff changeset
55
5e4bc24ea438 Made serilization more flexible. DB update required!!!
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 33
diff changeset
56 ArtifactSerializer getSerializer();
1
11c82d3f125e Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
57 }
11c82d3f125e Checked in the central interfaces of the artifact system.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
58 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8:

http://dive4elements.wald.intevation.org