1 package test.crispy.example; 2 3 import net.sf.crispy.InterceptorHandler; 4 import net.sf.crispy.impl.http.HttpServlet; 5 import net.sf.crispy.interceptor.StopWatchInterceptor; 6 import net.sf.crispy.server.InterceptorHandlerCreator; 7 import test.crispy.example.interceptor.RemoveSecurityTokenModifier; 8 import test.crispy.example.interceptor.WaitInterceptor; 9 10 public class SubHttpServiceEndpoint extends HttpServlet { 11 12 private static final long serialVersionUID = -6993854585751475277L; 13 14 public SubHttpServiceEndpoint() { 15 setInterceptorHandlerCreator(createInterceptorHandlerCreator()); 16 } 17 18 private InterceptorHandlerCreator createInterceptorHandlerCreator() { 19 return new InterceptorHandlerCreator() { 20 21 public InterceptorHandler createNewInterceptorHandlerInstance() { 22 InterceptorHandler lvHandler = new InterceptorHandler(); 23 lvHandler.addInterceptor(new WaitInterceptor()); 24 lvHandler.addInterceptor(new StopWatchInterceptor()); 25 lvHandler.setModifier(new RemoveSecurityTokenModifier()); 26 27 return lvHandler; 28 } 29 }; 30 } 31 32 33 }