1 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.ResetEventCoordinator; 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 37 public class DisableCachingFilter implements WebRequestServicerFilter 38 { 39 private ErrorLog _errorLog; 40 41 private ResetEventCoordinator _resetEventCoordinator; 42 43 public void service(WebRequest request, WebResponse response, WebRequestServicer servicer) 44 throws IOException 45 { 46 try 47 { 48 servicer.service(request, response); 49 } 50 finally 51 { 52 fireResetEvent(); 53 } 54 55 } 56 57 private void fireResetEvent() 58 { 59 try 60 { 61 _resetEventCoordinator.fireResetEvent(); 62 } 63 catch (Exception ex) 64 { 65 _errorLog.error(ImplMessages.errorResetting(ex), HiveMind.getLocation(ex), ex); 66 } 67 } 68 69 public void setResetEventCoordinator(ResetEventCoordinator resetEventCoordinator) 70 { 71 _resetEventCoordinator = resetEventCoordinator; 72 } 73 74 public void setErrorLog(ErrorLog errorLog) 75 { 76 _errorLog = errorLog; 77 } 78 } | Popular Tags |