Mercurial > dive4elements > framework
comparison artifact-database/src/main/java/de/intevation/artifactdatabase/ArtifactCallContext.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 | 3168af23aec5 |
comparison
equal
deleted
inserted
replaced
245:def3daabc5b5 | 246:a8a06bbe306c |
---|---|
47 | 47 |
48 public ArtifactCallContext( | 48 public ArtifactCallContext( |
49 ArtifactDatabaseImpl artifactDatabase, | 49 ArtifactDatabaseImpl artifactDatabase, |
50 int action, | 50 int action, |
51 CallMeta callMeta, | 51 CallMeta callMeta, |
52 Object context, | |
53 PersistentArtifact artifact) | 52 PersistentArtifact artifact) |
54 { | 53 { |
55 super(artifactDatabase, action, callMeta, context); | 54 super(artifactDatabase, action, callMeta); |
56 | 55 |
57 this.artifact = artifact; | 56 this.artifact = artifact; |
58 } | 57 } |
59 | 58 |
60 | 59 |
82 /** | 81 /** |
83 * Dispatches and executes the persistence action after | 82 * Dispatches and executes the persistence action after |
84 * the return of the concrete artifact call. | 83 * the return of the concrete artifact call. |
85 */ | 84 */ |
86 public void postCall() { | 85 public void postCall() { |
87 switch (action) { | 86 try { |
88 case NOTHING: | 87 switch (action) { |
89 break; | 88 case NOTHING: |
90 case TOUCH: | 89 break; |
91 artifact.touch(); | 90 case TOUCH: |
92 break; | 91 artifact.touch(); |
93 case STORE: | 92 break; |
94 artifact.store(); | 93 case STORE: |
95 break; | 94 artifact.store(); |
96 case BACKGROUND: | 95 break; |
97 logger.warn( | 96 case BACKGROUND: |
98 "BACKGROUND processing is not fully implemented, yet!"); | 97 logger.warn( |
99 artifact.store(); | 98 "BACKGROUND processing is not fully implemented, yet!"); |
100 break; | 99 artifact.store(); |
101 default: | 100 break; |
102 logger.error(INVALID_CALL_STATE + ": " + action); | 101 default: |
103 throw new IllegalStateException(INVALID_CALL_STATE); | 102 logger.error(INVALID_CALL_STATE + ": " + action); |
103 throw new IllegalStateException(INVALID_CALL_STATE); | |
104 } | |
105 } | |
106 finally { | |
107 super.postCall(); | |
104 } | 108 } |
105 } | 109 } |
106 } | 110 } |
107 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 111 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |