annotate artifact-database/src/main/java/org/dive4elements/artifactdatabase/CollectionCallContext.java @ 559:06257387b98f

Moved chart metadata line to top of chart. Minor cleanup.
author gernotbelger
date Thu, 26 Jul 2018 14:36:32 +0200
parents 415df0fc4fa1
children
rev   line source
219
cabe4c02ab64 Refactored the CallContextImpl - there are two concrete classes for Artifacts and ArtifactCollections now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1 /*
cabe4c02ab64 Refactored the CallContextImpl - there are two concrete classes for Artifacts and ArtifactCollections now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
2 * Copyright (c) 2011 by Intevation GmbH
cabe4c02ab64 Refactored the CallContextImpl - there are two concrete classes for Artifacts and ArtifactCollections now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
3 *
cabe4c02ab64 Refactored the CallContextImpl - there are two concrete classes for Artifacts and ArtifactCollections now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
4 * This program is free software under the LGPL (>=v2.1)
cabe4c02ab64 Refactored the CallContextImpl - there are two concrete classes for Artifacts and ArtifactCollections now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
5 * Read the file LGPL.txt coming with the software for details
cabe4c02ab64 Refactored the CallContextImpl - there are two concrete classes for Artifacts and ArtifactCollections now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
6 * or visit http://www.gnu.org/licenses/ if it does not exist.
cabe4c02ab64 Refactored the CallContextImpl - there are two concrete classes for Artifacts and ArtifactCollections now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
7 */
475
415df0fc4fa1 Fixed maven group ids
Sascha L. Teichmann <teichmann@intevation.de>
parents: 473
diff changeset
8 package org.dive4elements.artifactdatabase;
219
cabe4c02ab64 Refactored the CallContextImpl - there are two concrete classes for Artifacts and ArtifactCollections now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
9
331
089c6f7794b5 Integrated a messaging system for Artifacts and Collections that started background threads.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 330
diff changeset
10 import java.util.LinkedList;
089c6f7794b5 Integrated a messaging system for Artifacts and Collections that started background threads.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 330
diff changeset
11
219
cabe4c02ab64 Refactored the CallContextImpl - there are two concrete classes for Artifacts and ArtifactCollections now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
12 import org.apache.log4j.Logger;
475
415df0fc4fa1 Fixed maven group ids
Sascha L. Teichmann <teichmann@intevation.de>
parents: 473
diff changeset
13 import org.dive4elements.artifacts.ArtifactCollection;
415df0fc4fa1 Fixed maven group ids
Sascha L. Teichmann <teichmann@intevation.de>
parents: 473
diff changeset
14 import org.dive4elements.artifacts.CallMeta;
415df0fc4fa1 Fixed maven group ids
Sascha L. Teichmann <teichmann@intevation.de>
parents: 473
diff changeset
15 import org.dive4elements.artifacts.Message;
219
cabe4c02ab64 Refactored the CallContextImpl - there are two concrete classes for Artifacts and ArtifactCollections now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
16
cabe4c02ab64 Refactored the CallContextImpl - there are two concrete classes for Artifacts and ArtifactCollections now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
17 /**
cabe4c02ab64 Refactored the CallContextImpl - there are two concrete classes for Artifacts and ArtifactCollections now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
18 * Class that implements the call context handed to ArtifactCollection specific
cabe4c02ab64 Refactored the CallContextImpl - there are two concrete classes for Artifacts and ArtifactCollections now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
19 * operations.
cabe4c02ab64 Refactored the CallContextImpl - there are two concrete classes for Artifacts and ArtifactCollections now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
20 *
cabe4c02ab64 Refactored the CallContextImpl - there are two concrete classes for Artifacts and ArtifactCollections now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
21 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
cabe4c02ab64 Refactored the CallContextImpl - there are two concrete classes for Artifacts and ArtifactCollections now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
22 */
cabe4c02ab64 Refactored the CallContextImpl - there are two concrete classes for Artifacts and ArtifactCollections now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
23 public class CollectionCallContext extends AbstractCallContext {
cabe4c02ab64 Refactored the CallContextImpl - there are two concrete classes for Artifacts and ArtifactCollections now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
24
cabe4c02ab64 Refactored the CallContextImpl - there are two concrete classes for Artifacts and ArtifactCollections now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
25 private static Logger log = Logger.getLogger(CollectionCallContext.class);
cabe4c02ab64 Refactored the CallContextImpl - there are two concrete classes for Artifacts and ArtifactCollections now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
26
cabe4c02ab64 Refactored the CallContextImpl - there are two concrete classes for Artifacts and ArtifactCollections now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
27 /**
cabe4c02ab64 Refactored the CallContextImpl - there are two concrete classes for Artifacts and ArtifactCollections now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
28 * The ArtifactCollection.
cabe4c02ab64 Refactored the CallContextImpl - there are two concrete classes for Artifacts and ArtifactCollections now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
29 */
559
06257387b98f Moved chart metadata line to top of chart. Minor cleanup.
gernotbelger
parents: 475
diff changeset
30 private final ArtifactCollection collection;
219
cabe4c02ab64 Refactored the CallContextImpl - there are two concrete classes for Artifacts and ArtifactCollections now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
31
559
06257387b98f Moved chart metadata line to top of chart. Minor cleanup.
gernotbelger
parents: 475
diff changeset
32 public CollectionCallContext(final ArtifactDatabaseImpl artifactDatabase, final int action, final CallMeta callMeta, final ArtifactCollection collection) {
246
a8a06bbe306c Added calls to call init/close for call contextes.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 219
diff changeset
33 super(artifactDatabase, action, callMeta);
219
cabe4c02ab64 Refactored the CallContextImpl - there are two concrete classes for Artifacts and ArtifactCollections now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
34
cabe4c02ab64 Refactored the CallContextImpl - there are two concrete classes for Artifacts and ArtifactCollections now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
35 this.collection = collection;
cabe4c02ab64 Refactored the CallContextImpl - there are two concrete classes for Artifacts and ArtifactCollections now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
36 }
cabe4c02ab64 Refactored the CallContextImpl - there are two concrete classes for Artifacts and ArtifactCollections now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
37
559
06257387b98f Moved chart metadata line to top of chart. Minor cleanup.
gernotbelger
parents: 475
diff changeset
38 public ArtifactCollection getCollection() {
06257387b98f Moved chart metadata line to top of chart. Minor cleanup.
gernotbelger
parents: 475
diff changeset
39 return this.collection;
06257387b98f Moved chart metadata line to top of chart. Minor cleanup.
gernotbelger
parents: 475
diff changeset
40 }
219
cabe4c02ab64 Refactored the CallContextImpl - there are two concrete classes for Artifacts and ArtifactCollections now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
41
559
06257387b98f Moved chart metadata line to top of chart. Minor cleanup.
gernotbelger
parents: 475
diff changeset
42 @Override
06257387b98f Moved chart metadata line to top of chart. Minor cleanup.
gernotbelger
parents: 475
diff changeset
43 public void afterCall(final int action) {
219
cabe4c02ab64 Refactored the CallContextImpl - there are two concrete classes for Artifacts and ArtifactCollections now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
44 log.debug("CollectionCallContext.afterCall - NOT IMPLEMENTED");
cabe4c02ab64 Refactored the CallContextImpl - there are two concrete classes for Artifacts and ArtifactCollections now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
45 }
cabe4c02ab64 Refactored the CallContextImpl - there are two concrete classes for Artifacts and ArtifactCollections now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
46
559
06257387b98f Moved chart metadata line to top of chart. Minor cleanup.
gernotbelger
parents: 475
diff changeset
47 @Override
06257387b98f Moved chart metadata line to top of chart. Minor cleanup.
gernotbelger
parents: 475
diff changeset
48 public void afterBackground(final int action) {
219
cabe4c02ab64 Refactored the CallContextImpl - there are two concrete classes for Artifacts and ArtifactCollections now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
49 log.debug("CollectionCallContext.afterBackground - NOT IMPLEMENTED");
cabe4c02ab64 Refactored the CallContextImpl - there are two concrete classes for Artifacts and ArtifactCollections now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
50 }
cabe4c02ab64 Refactored the CallContextImpl - there are two concrete classes for Artifacts and ArtifactCollections now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
51
559
06257387b98f Moved chart metadata line to top of chart. Minor cleanup.
gernotbelger
parents: 475
diff changeset
52 @Override
330
3168af23aec5 Added a CallContext.isInBackground() method to determine if an Artifact or a Collection has started a background thread and is currently locked.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 246
diff changeset
53 public boolean isInBackground() {
3168af23aec5 Added a CallContext.isInBackground() method to determine if an Artifact or a Collection has started a background thread and is currently locked.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 246
diff changeset
54 log.debug("CollectionCallContext.isInBackground - NOT IMPLEMENTED");
3168af23aec5 Added a CallContext.isInBackground() method to determine if an Artifact or a Collection has started a background thread and is currently locked.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 246
diff changeset
55 return false;
3168af23aec5 Added a CallContext.isInBackground() method to determine if an Artifact or a Collection has started a background thread and is currently locked.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 246
diff changeset
56 }
3168af23aec5 Added a CallContext.isInBackground() method to determine if an Artifact or a Collection has started a background thread and is currently locked.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 246
diff changeset
57
559
06257387b98f Moved chart metadata line to top of chart. Minor cleanup.
gernotbelger
parents: 475
diff changeset
58 @Override
06257387b98f Moved chart metadata line to top of chart. Minor cleanup.
gernotbelger
parents: 475
diff changeset
59 public void addBackgroundMessage(final Message msg) {
331
089c6f7794b5 Integrated a messaging system for Artifacts and Collections that started background threads.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 330
diff changeset
60 log.debug("CollectionCallContext.addBackgroundMessage NOT IMPLEMENTED");
089c6f7794b5 Integrated a messaging system for Artifacts and Collections that started background threads.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 330
diff changeset
61 }
089c6f7794b5 Integrated a messaging system for Artifacts and Collections that started background threads.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 330
diff changeset
62
559
06257387b98f Moved chart metadata line to top of chart. Minor cleanup.
gernotbelger
parents: 475
diff changeset
63 @Override
331
089c6f7794b5 Integrated a messaging system for Artifacts and Collections that started background threads.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 330
diff changeset
64 public LinkedList<Message> getBackgroundMessages() {
089c6f7794b5 Integrated a messaging system for Artifacts and Collections that started background threads.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 330
diff changeset
65 log.debug("CollectionCallContext.addBackgroundMessage NOT IMPLEMENTED");
089c6f7794b5 Integrated a messaging system for Artifacts and Collections that started background threads.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 330
diff changeset
66 return null;
089c6f7794b5 Integrated a messaging system for Artifacts and Collections that started background threads.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 330
diff changeset
67 }
089c6f7794b5 Integrated a messaging system for Artifacts and Collections that started background threads.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 330
diff changeset
68
559
06257387b98f Moved chart metadata line to top of chart. Minor cleanup.
gernotbelger
parents: 475
diff changeset
69 @Override
219
cabe4c02ab64 Refactored the CallContextImpl - there are two concrete classes for Artifacts and ArtifactCollections now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
70 public Long getTimeToLive() {
cabe4c02ab64 Refactored the CallContextImpl - there are two concrete classes for Artifacts and ArtifactCollections now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
71 log.debug("CollectionCallContext.getTimeToLive - NOT IMPLEMENTED");
cabe4c02ab64 Refactored the CallContextImpl - there are two concrete classes for Artifacts and ArtifactCollections now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
72 return null;
cabe4c02ab64 Refactored the CallContextImpl - there are two concrete classes for Artifacts and ArtifactCollections now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
73 }
559
06257387b98f Moved chart metadata line to top of chart. Minor cleanup.
gernotbelger
parents: 475
diff changeset
74 }

http://dive4elements.wald.intevation.org