Set<String> interceptorClasses = next.getAllInterceptorClasses();
Class targetClass = bundle.getClassLoader().loadClass(next.getBeanClassName());
InterceptorInfo interceptorInfo = new InterceptorInfo();
interceptorInfo.setTargetClass(targetClass);
interceptorInfo.setInterceptorClassNames(interceptorClasses);
interceptorInfo.setAroundConstructInterceptors
(next.getAroundConstructCallbackInterceptors(targetClass,
getConstructor(targetClass, isCDIBundle)));
interceptorInfo.setPostConstructInterceptors
(next.getCallbackInterceptors(LifecycleCallbackDescriptor.CallbackType.POST_CONSTRUCT));
interceptorInfo.setPreDestroyInterceptors
(next.getCallbackInterceptors(LifecycleCallbackDescriptor.CallbackType.PRE_DESTROY));
if( next.hasAroundInvokeMethod() ) {
interceptorInfo.setHasTargetClassAroundInvoke(true);
}
Map<Method, List> interceptorChains = new HashMap<Method, List>();
for(Method m : targetClass.getMethods()) {
interceptorChains.put(m, next.getAroundInvokeInterceptors(m) );
}
interceptorInfo.setAroundInvokeInterceptorChains(interceptorChains);
// TODO can optimize this out for the non-JAXRS, non-application specified interceptor case
interceptorInfo.setSupportRuntimeDelegate(true);
JavaEEInterceptorBuilderFactory interceptorBuilderFactory =
habitat.getService(JavaEEInterceptorBuilderFactory.class);
JavaEEInterceptorBuilder builder = interceptorBuilderFactory.createBuilder(interceptorInfo);