01: package test.crispy.example;
02:
03: import test.crispy.example.interceptor.WaitInterceptor;
04: import net.sf.crispy.InterceptorHandler;
05: import net.sf.crispy.interceptor.StopWatchInterceptor;
06: import net.sf.crispy.server.InterceptorHandlerCreator;
07: import net.sf.crispy.server.ServiceEndpointImpl;
08:
09: 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: }
|