View Javadoc

1   package test.crispy.example;
2   
3   import net.sf.crispy.InterceptorHandler;
4   import net.sf.crispy.filter.SimpleNameInterceptorFilter;
5   import net.sf.crispy.impl.xmlrpc.XmlRpcHttpServlet;
6   import net.sf.crispy.server.InterceptorHandlerCreator;
7   import test.crispy.example.interceptor.RemoveSecurityTokenModifier;
8   import test.crispy.example.service.EchoImpl;
9   
10  public class SubXmlRpcServiceEndpoint extends XmlRpcHttpServlet {
11  
12  	private static final long serialVersionUID = 167096795226621025L;
13  	
14  	public SubXmlRpcServiceEndpoint() {
15  		super();
16  		setInterceptorHandlerCreator(createInterceptorHandlerCreator());
17  	}
18  	
19  	private InterceptorHandlerCreator createInterceptorHandlerCreator() {
20  		return new InterceptorHandlerCreator() {
21  
22  			public InterceptorHandler createNewInterceptorHandlerInstance() {
23  				InterceptorHandler lvHandler =  new InterceptorHandler();
24  				lvHandler.setModifier(new RemoveSecurityTokenModifier());
25  
26  				// Example for integrate a Filter, all Filter and Modifier are enabled for EchoImpl, else disabled				
27  				lvHandler.addInterceptorFilter(new SimpleNameInterceptorFilter(EchoImpl.class));
28  				return lvHandler;
29  			}
30  			
31  		};
32  	}
33  
34  }