ServiceLocatorImpl impl,
ActiveDescriptor<?> descriptor,
Class<?> clazz,
Constructor<?> c) {
if (descriptor == null || clazz == null || isFinal(clazz)) return EMTPY_INTERCEPTORS;
ClassReflectionHelper crh = impl.getClassReflectionHelper();
List<InterceptionService> interceptionServices = impl.getInterceptionServices();
if (interceptionServices == null || interceptionServices.isEmpty()) return EMTPY_INTERCEPTORS;
// Make sure it is not one of the special services
for (String contract : descriptor.getAdvertisedContracts()) {
if (NOT_INTERCEPTED.contains(contract)) return EMTPY_INTERCEPTORS;
}
final LinkedHashMap<Method, List<MethodInterceptor>> retVal =
new LinkedHashMap<Method, List<MethodInterceptor>>();
final ArrayList<ConstructorInterceptor> cRetVal = new ArrayList<ConstructorInterceptor>();
for (InterceptionService interceptionService : interceptionServices) {
Filter filter = interceptionService.getDescriptorFilter();
if (filter instanceof IndexedFilter) {
IndexedFilter indexedFilter = (IndexedFilter) filter;
String indexedContract = indexedFilter.getAdvertisedContract();
if (indexedContract != null) {
if (!descriptor.getAdvertisedContracts().contains(indexedContract)) continue;
}
String name = indexedFilter.getName();
if (name != null) {
if (descriptor.getName() == null) continue;
if (!descriptor.getName().equals(name)) continue;
}
}
if (filter.matches(descriptor)) {
for (MethodWrapper methodWrapper : crh.getAllMethods(clazz)) {
Method method = methodWrapper.getMethod();
if (isFinal(method)) continue;
List<MethodInterceptor> interceptors = interceptionService.getMethodInterceptors(method);