我想在apacheds下加入一个自己定义的拦截器,请问大家有招吗?
这是在github上的一个范例代码:https://github.com/kwart/ldap...
//add interceptor
List<Interceptor> interceptors = directoryService.getInterceptors();
// Find Normalization interceptor in chain
int insertionPosition = -1;
for (int pos = 0; pos < interceptors.size(); ++pos) {
Interceptor interceptor = interceptors.get(pos);
if (interceptor instanceof NormalizationInterceptor) {
insertionPosition = pos;
}
}
// insert our new interceptor just behind
System.out.println(interceptors.size()+"==============="+insertionPosition);
interceptors.add(insertionPosition+1, new SearchIntercepter());
directoryService.setInterceptors(interceptors);
上面是添加自定义拦截器部分代码,new SearchIntercepter()是自己定义的。如何实现一个基本的额拦截器了?就卡在这了。