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