instances.put(interceptor.getBeanClass().getName(), serializableContextualInstance);
}
@Override
public Object processInvocation(InterceptorContext interceptorContext) throws Exception {
BeanManagerImpl beanManager = this.weldContainer.getValue().getBeanManager(beanArchiveId);
//this is not always called with the deployments TCCL set
//which causes weld to blow up
SessionBean<Object> bean = null;
if (ejbName != null) {
EjbDescriptor<Object> descriptor = beanManager.getEjbDescriptor(this.ejbName);
if (descriptor != null) {
bean = beanManager.getBean(descriptor);
}
}
InterceptorBindings interceptorBindings = this.interceptorBindings.getValue();
final ComponentInstance componentInstance = interceptorContext.getPrivateData(ComponentInstance.class);
WeldInterceptorInstances existing = (WeldInterceptorInstances) componentInstance.getInstanceData(SerializedCdiInterceptorsKey.class);
if (existing == null) {
CreationalContext<Object> creationalContext = beanManager.createCreationalContext(bean);
HashMap<String, SerializableContextualInstance<Interceptor<Object>, Object>> interceptorInstances = new HashMap<String, SerializableContextualInstance<Interceptor<Object>, Object>>();
if (interceptorBindings != null) {
for (Interceptor<?> interceptor : interceptorBindings.getAllInterceptors()) {
addInterceptorInstance((Interceptor<Object>) interceptor, beanManager, interceptorInstances, creationalContext);