Mercurial > dive4elements > framework
annotate artifacts/src/main/java/de/intevation/artifacts/CallContext.java @ 234:23d642319a0b
Added a boolean flag to XML byte serialisation to compress/decompress, too.
artifacts/trunk@1641 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Sun, 03 Apr 2011 12:10:54 +0000 |
parents | 933bbc9fc11f |
children | def3daabc5b5 |
rev | line source |
---|---|
100
933bbc9fc11f
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
86
diff
changeset
|
1 /* |
933bbc9fc11f
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
86
diff
changeset
|
2 * Copyright (c) 2010 by Intevation GmbH |
933bbc9fc11f
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
86
diff
changeset
|
3 * |
933bbc9fc11f
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
86
diff
changeset
|
4 * This program is free software under the LGPL (>=v2.1) |
933bbc9fc11f
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
86
diff
changeset
|
5 * Read the file LGPL.txt coming with the software for details |
933bbc9fc11f
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
86
diff
changeset
|
6 * or visit http://www.gnu.org/licenses/ if it does not exist. |
933bbc9fc11f
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
86
diff
changeset
|
7 */ |
933bbc9fc11f
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
86
diff
changeset
|
8 |
32
c2d53bd30ab8
Re-factored artifact API for better integration of background processing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
9 package de.intevation.artifacts; |
c2d53bd30ab8
Re-factored artifact API for better integration of background processing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
10 |
78
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
11 /** |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
12 * Instances of this interface are given to feed(), advance(), describe() |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
13 * and out() to enable the artifact to communicate with the runtime system. |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
14 * @author <a href="mailto:sascha.teichmann@intevation.de">Sascha L. Teichmann</a> |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
15 */ |
32
c2d53bd30ab8
Re-factored artifact API for better integration of background processing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
16 public interface CallContext |
c2d53bd30ab8
Re-factored artifact API for better integration of background processing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
17 { |
78
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
18 /** |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
19 * Constant to signal that nothing should be done |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
20 * with the artifact after method return. |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
21 */ |
32
c2d53bd30ab8
Re-factored artifact API for better integration of background processing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
22 int NOTHING = 0; |
78
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
23 /** |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
24 * Constant to signal that the database timestamp |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
25 * should be updated after method return. |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
26 */ |
32
c2d53bd30ab8
Re-factored artifact API for better integration of background processing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
27 int TOUCH = 1; |
78
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
28 /** |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
29 * Constant to signal that the artifact should be stored |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
30 * after method return. |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
31 */ |
32
c2d53bd30ab8
Re-factored artifact API for better integration of background processing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
32 int STORE = 2; |
78
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
33 /** |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
34 * Constant to signal that the artifact fork a backgroud thread |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
35 * and should be hold in memory till it signals that it has |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
36 * finished its operation. |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
37 */ |
32
c2d53bd30ab8
Re-factored artifact API for better integration of background processing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
38 int BACKGROUND = 3; |
c2d53bd30ab8
Re-factored artifact API for better integration of background processing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
39 // int DELETE = 4; |
c2d53bd30ab8
Re-factored artifact API for better integration of background processing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
40 // int FOREVER = 5; |
c2d53bd30ab8
Re-factored artifact API for better integration of background processing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
41 |
78
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
42 /** |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
43 * This method may be called from feed(), describe(), advance() |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
44 * and out to signal what should happend with artefact after |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
45 * the current method call returns. |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
46 * @param action Valid values are NOTHING, TOUCH, STORE, BACKGROUND. |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
47 */ |
32
c2d53bd30ab8
Re-factored artifact API for better integration of background processing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
48 void afterCall(int action); |
c2d53bd30ab8
Re-factored artifact API for better integration of background processing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
49 |
78
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
50 /** |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
51 * When send to background with a afterCall(BACKGROUND) this |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
52 * method is to be called from the background thread to signal |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
53 * that the background operation has ended. |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
54 * @param action Same semantics as in afterCall. |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
55 */ |
32
c2d53bd30ab8
Re-factored artifact API for better integration of background processing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
56 void afterBackground(int action); |
c2d53bd30ab8
Re-factored artifact API for better integration of background processing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
57 |
78
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
58 /** |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
59 * Access to the global context of the runtime system. |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
60 * @return The global context. |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
61 */ |
32
c2d53bd30ab8
Re-factored artifact API for better integration of background processing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
62 Object globalContext(); |
48
41c225c8bd41
Add i18n support via "Accept-Language" HTTP headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
32
diff
changeset
|
63 |
78
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
64 /** |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
65 * Access to the artifact database itself. |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
66 * @return The database. |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
67 */ |
66
89e3de0ee05f
Implemented some methods to get access to ArtifactFactories which are stored in the ArtifactDatabase.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
68 ArtifactDatabase getDatabase(); |
89e3de0ee05f
Implemented some methods to get access to ArtifactFactories which are stored in the ArtifactDatabase.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
58
diff
changeset
|
69 |
78
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
70 /** |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
71 * The meta data of the current call. Used to transport |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
72 * language preferences of the callee e.g. |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
73 * @return The meta information of this call. |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
74 */ |
48
41c225c8bd41
Add i18n support via "Accept-Language" HTTP headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
32
diff
changeset
|
75 CallMeta getMeta(); |
86
b2e0cb83631c
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
85
diff
changeset
|
76 |
78
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
77 /** |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
78 * Each call context has a clipboard. |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
79 * getContextValue is used to fetch data from this board. |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
80 * @param key Key of the requested item. |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
81 * @return The value stored for the secified value, null if |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
82 * no item with this key exists. |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
83 */ |
58
39fec7d714dc
Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
48
diff
changeset
|
84 Object getContextValue(Object key); |
39fec7d714dc
Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
48
diff
changeset
|
85 |
78
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
86 /** |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
87 * Each call context has a clipboard. |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
88 * putContextValue is used to store a key/value pair onto this board. |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
89 * @param key The key of the pair |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
90 * @param value The value of the pair. |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
91 * @return The formerly stored value under the given key. |
55eefe63a777
Repaired the javadoc stuff for almost all artifact interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
66
diff
changeset
|
92 */ |
58
39fec7d714dc
Added a real artifact proxy class to be more flexible with artifact replacements
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
48
diff
changeset
|
93 Object putContextValue(Object key, Object value); |
84
72e2dd4feb31
Added the time to live of an artifact to the CallContext.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
78
diff
changeset
|
94 |
72e2dd4feb31
Added the time to live of an artifact to the CallContext.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
78
diff
changeset
|
95 /** |
72e2dd4feb31
Added the time to live of an artifact to the CallContext.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
78
diff
changeset
|
96 * Returns the time to live of the current artifact. |
72e2dd4feb31
Added the time to live of an artifact to the CallContext.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
78
diff
changeset
|
97 * @return The time to live of the current artifact. |
72e2dd4feb31
Added the time to live of an artifact to the CallContext.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
78
diff
changeset
|
98 */ |
72e2dd4feb31
Added the time to live of an artifact to the CallContext.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
78
diff
changeset
|
99 Long getTimeToLive(); |
32
c2d53bd30ab8
Re-factored artifact API for better integration of background processing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
100 } |
85
78263e910675
Completed Javadoc of sub module 'artifacts'.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
84
diff
changeset
|
101 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |