Mercurial > dive4elements > framework
comparison artifact-database/src/main/java/de/intevation/artifactdatabase/AbstractCallContext.java @ 246:a8a06bbe306c
Added calls to call init/close for call contextes.
artifacts/trunk@1686 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Thu, 14 Apr 2011 11:18:10 +0000 |
parents | cabe4c02ab64 |
children | 33d7a6da1a05 |
comparison
equal
deleted
inserted
replaced
245:def3daabc5b5 | 246:a8a06bbe306c |
---|---|
36 * The meta information of the concrete call (preferred languages et. al.) | 36 * The meta information of the concrete call (preferred languages et. al.) |
37 */ | 37 */ |
38 protected CallMeta callMeta; | 38 protected CallMeta callMeta; |
39 | 39 |
40 /** | 40 /** |
41 * The global context. | |
42 */ | |
43 protected Object context; | |
44 | |
45 /** | |
46 * Map to act like a clipboard when nesting calls like a proxy artifact. | 41 * Map to act like a clipboard when nesting calls like a proxy artifact. |
47 */ | 42 */ |
48 protected HashMap customValues; | 43 protected HashMap customValues; |
49 | 44 |
50 | 45 |
56 * @param context The global context. | 51 * @param context The global context. |
57 */ | 52 */ |
58 public AbstractCallContext( | 53 public AbstractCallContext( |
59 ArtifactDatabaseImpl artifactDatabase, | 54 ArtifactDatabaseImpl artifactDatabase, |
60 int action, | 55 int action, |
61 CallMeta callMeta, | 56 CallMeta callMeta |
62 Object context) | 57 ) { |
63 { | |
64 this.database = artifactDatabase; | 58 this.database = artifactDatabase; |
65 this.action = action; | 59 this.action = action; |
66 this.callMeta = callMeta; | 60 this.callMeta = callMeta; |
67 this.context = context; | 61 |
62 database.initCallContext(this); | |
68 } | 63 } |
69 | 64 |
70 | 65 |
71 public abstract void postCall(); | 66 public void postCall() { |
67 database.closeCallContext(this); | |
68 } | |
72 | 69 |
73 public abstract void afterCall(int action); | 70 public abstract void afterCall(int action); |
74 | 71 |
75 public abstract Long getTimeToLive(); | 72 public abstract Long getTimeToLive(); |
76 | 73 |
77 public abstract void afterBackground(int action); | 74 public abstract void afterBackground(int action); |
78 | 75 |
79 | 76 |
80 public Object globalContext() { | 77 public Object globalContext() { |
81 return context; | 78 return database.context; |
82 } | 79 } |
83 | 80 |
84 | 81 |
85 public ArtifactDatabase getDatabase() { | 82 public ArtifactDatabase getDatabase() { |
86 return database; | 83 return database; |