use of org.jboss.weld.annotated.slim.SlimAnnotatedTypeStore in project core by weld.
the class SubclassedComponentInstantiator method getInterceptionModelsForType.
private Set<InterceptionModel> getInterceptionModelsForType(EnhancedAnnotatedType<T> type, BeanManagerImpl manager, Bean<?> bean) {
// if the bean has decorators consider all methods as intercepted
if (bean != null && !manager.resolveDecorators(bean.getTypes(), bean.getQualifiers()).isEmpty()) {
return null;
}
SlimAnnotatedTypeStore store = manager.getServices().get(SlimAnnotatedTypeStore.class);
Set<InterceptionModel> models = new HashSet<InterceptionModel>();
WeldCollections.addIfNotNull(models, manager.getInterceptorModelRegistry().get(type.slim()));
for (SlimAnnotatedType<?> slimType : store.get(type.getJavaClass())) {
WeldCollections.addIfNotNull(models, manager.getInterceptorModelRegistry().get(slimType));
}
for (InterceptionModel model : models) {
if (model.hasTargetClassInterceptors() && model.getTargetClassInterceptorMetadata().isEligible(InterceptionType.AROUND_INVOKE)) {
// returning null here means that all methods will be overridden and will delegate to MethodHandler
return null;
}
}
return models;
}
use of org.jboss.weld.annotated.slim.SlimAnnotatedTypeStore in project core by weld.
the class EjbSupportImpl method createNewSessionBeans.
@Override
public void createNewSessionBeans(BeanDeployerEnvironment environment, BeanManagerImpl manager) {
final SlimAnnotatedTypeStore store = manager.getServices().get(SlimAnnotatedTypeStore.class);
final ClassTransformer classTransformer = manager.getServices().get(ClassTransformer.class);
for (Type type : environment.getNewBeanTypes()) {
Class<?> clazz = Reflections.getRawType(type);
if (isEjb(clazz)) {
EnhancedAnnotatedType<?> enhancedType = classTransformer.getEnhancedAnnotatedType(clazz, type, manager.getId());
InternalEjbDescriptor<?> descriptor = ejbDescriptors.getUnique(clazz);
environment.addSessionBean(createNewSessionBean(enhancedType, descriptor, manager, store));
}
}
}
Aggregations