1 |
| |
2 |
| |
3 |
| |
4 |
| |
5 |
| |
6 |
| |
7 |
| |
8 |
| |
9 |
| |
10 |
| |
11 |
| |
12 |
| |
13 |
| |
14 |
| |
15 |
| package org.apache.tapestry.services.impl; |
16 |
| |
17 |
| import java.io.IOException; |
18 |
| |
19 |
| import org.apache.hivemind.ErrorLog; |
20 |
| import org.apache.hivemind.HiveMind; |
21 |
| import org.apache.tapestry.services.ResetEventHub; |
22 |
| import org.apache.tapestry.services.WebRequestServicer; |
23 |
| import org.apache.tapestry.services.WebRequestServicerFilter; |
24 |
| import org.apache.tapestry.web.WebRequest; |
25 |
| import org.apache.tapestry.web.WebResponse; |
26 |
| |
27 |
| |
28 |
| |
29 |
| |
30 |
| |
31 |
| |
32 |
| |
33 |
| |
34 |
| |
35 |
| |
36 |
| |
37 |
| public class DisableCachingFilter implements WebRequestServicerFilter |
38 |
| { |
39 |
| private ErrorLog _errorLog; |
40 |
| |
41 |
| private ResetEventHub _resetEventHub; |
42 |
| |
43 |
2
| public void service(WebRequest request, WebResponse response, WebRequestServicer servicer)
|
44 |
| throws IOException |
45 |
| { |
46 |
2
| try
|
47 |
| { |
48 |
2
| servicer.service(request, response);
|
49 |
| } |
50 |
| finally |
51 |
| { |
52 |
2
| fireResetEvent();
|
53 |
| } |
54 |
| |
55 |
| } |
56 |
| |
57 |
2
| private void fireResetEvent()
|
58 |
| { |
59 |
2
| try
|
60 |
| { |
61 |
2
| _resetEventHub.fireResetEvent();
|
62 |
| } |
63 |
| catch (Exception ex) |
64 |
| { |
65 |
1
| _errorLog.error(ImplMessages.errorResetting(ex), HiveMind.getLocation(ex), ex);
|
66 |
| } |
67 |
| } |
68 |
| |
69 |
2
| public void setResetEventHub(ResetEventHub resetEventCoordinator)
|
70 |
| { |
71 |
2
| _resetEventHub = resetEventCoordinator;
|
72 |
| } |
73 |
| |
74 |
1
| public void setErrorLog(ErrorLog errorLog)
|
75 |
| { |
76 |
1
| _errorLog = errorLog;
|
77 |
| } |
78 |
| } |