Mercurial > dive4elements > framework
comparison artifact-database/src/main/java/de/intevation/artifactdatabase/ArtifactCallContext.java @ 331:089c6f7794b5
Integrated a messaging system for Artifacts and Collections that started background threads.
artifacts/trunk@2688 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Fri, 09 Sep 2011 14:06:55 +0000 |
parents | 3168af23aec5 |
children |
comparison
equal
deleted
inserted
replaced
330:3168af23aec5 | 331:089c6f7794b5 |
---|---|
5 * Read the file LGPL.txt coming with the software for details | 5 * Read the file LGPL.txt coming with the software for details |
6 * or visit http://www.gnu.org/licenses/ if it does not exist. | 6 * or visit http://www.gnu.org/licenses/ if it does not exist. |
7 */ | 7 */ |
8 package de.intevation.artifactdatabase; | 8 package de.intevation.artifactdatabase; |
9 | 9 |
10 import java.util.LinkedList; | |
11 | |
10 import org.apache.log4j.Logger; | 12 import org.apache.log4j.Logger; |
11 | 13 |
12 import de.intevation.artifacts.CallMeta; | 14 import de.intevation.artifacts.CallMeta; |
15 import de.intevation.artifacts.Message; | |
13 | 16 |
14 import de.intevation.artifactdatabase.Backend.PersistentArtifact; | 17 import de.intevation.artifactdatabase.Backend.PersistentArtifact; |
15 | 18 |
16 | 19 |
17 /** | 20 /** |
76 public boolean isInBackground() { | 79 public boolean isInBackground() { |
77 return database.getLockedIds().contains(artifact.getId()); | 80 return database.getLockedIds().contains(artifact.getId()); |
78 } | 81 } |
79 | 82 |
80 | 83 |
84 public void addBackgroundMessage(Message msg) { | |
85 database.addBackgroundMessage(artifact.getArtifact().identifier(), msg); | |
86 } | |
87 | |
88 | |
89 public LinkedList<Message> getBackgroundMessages() { | |
90 return database.getBackgroundMessages( | |
91 artifact.getArtifact().identifier()); | |
92 } | |
93 | |
94 | |
81 public Long getTimeToLive() { | 95 public Long getTimeToLive() { |
82 return artifact.getTTL(); | 96 return artifact.getTTL(); |
83 } | 97 } |
84 | 98 |
85 | 99 |