private void checkDecoratedMethods(EnhancedAnnotatedType<T> type, List<Decorator<?>> decorators) { if (type.isFinal()) { throw BeanLogger.LOG.finalBeanClassWithDecoratorsNotAllowed(this); } checkNoArgsConstructor(type); for (Decorator<?> decorator : decorators) { EnhancedAnnotatedType<?> decoratorClass; if (decorator instanceof DecoratorImpl<?>) { DecoratorImpl<?> decoratorBean = (DecoratorImpl<?>) decorator; decoratorClass = decoratorBean.getBeanManager().getServices().get(ClassTransformer.class) .getEnhancedAnnotatedType(decoratorBean.getAnnotated()); } else if (decorator instanceof CustomDecoratorWrapper<?>) { decoratorClass = ((CustomDecoratorWrapper<?>) decorator).getEnhancedAnnotated(); } else { throw BeanLogger.LOG.nonContainerDecorator(decorator); } for (EnhancedAnnotatedMethod<?, ?> decoratorMethod : decoratorClass.getEnhancedMethods()) { EnhancedAnnotatedMethod<?, ?> method = type.getEnhancedMethod(decoratorMethod.getSignature()); if (method != null && !method.isStatic() && !method.isPrivate() && method.isFinal()) { throw BeanLogger.LOG.finalBeanClassWithInterceptorsNotAllowed(this); } } } }
private void validateDecorators(BeanManagerImpl beanManager, DecorableBean<?> bean) { if (!(beanManager.isPassivatingScope(bean.getScope()) || bean instanceof AbstractDecorableBuiltInBean<?>)) { return; } List<Decorator<?>> decorators = bean.getDecorators(); if (decorators.isEmpty()) { return; } for (Decorator<?> decorator : decorators) { if (!Decorators.isPassivationCapable(decorator)) { if (bean instanceof AbstractDecorableBuiltInBean<?>) { throw ValidatorLogger.LOG.builtinBeanWithNonserializableDecorator(decorator, bean); } else { throw ValidatorLogger.LOG.passivatingBeanWithNonserializableDecorator(bean, decorator); } } if (decorator instanceof DecoratorImpl) { beanManager = ((DecoratorImpl<?>) decorator).getBeanManager(); } for (InjectionPoint ij : decorator.getInjectionPoints()) { if (!ij.isDelegate()) { Bean<?> resolvedBean = beanManager.resolve(beanManager.getBeans(ij)); validateInterceptorDecoratorInjectionPointPassivationCapable(ij, resolvedBean, beanManager, bean); } } } }
private void validateDecorators(BeanManagerImpl beanManager, DecorableBean<?> bean) { if (!(beanManager.isPassivatingScope(bean.getScope()) || bean instanceof AbstractDecorableBuiltInBean<?>)) { return; } List<Decorator<?>> decorators = bean.getDecorators(); if (decorators.isEmpty()) { return; } for (Decorator<?> decorator : decorators) { if (!Decorators.isPassivationCapable(decorator)) { if (bean instanceof AbstractDecorableBuiltInBean<?>) { throw ValidatorLogger.LOG.builtinBeanWithNonserializableDecorator(decorator, bean); } else { throw ValidatorLogger.LOG.passivatingBeanWithNonserializableDecorator(bean, decorator); } } if (decorator instanceof DecoratorImpl) { beanManager = ((DecoratorImpl<?>) decorator).getBeanManager(); } for (InjectionPoint ij : decorator.getInjectionPoints()) { if (!ij.isDelegate()) { Bean<?> resolvedBean = beanManager.resolve(beanManager.getBeans(ij)); validateInterceptorDecoratorInjectionPointPassivationCapable(ij, resolvedBean, beanManager, bean); } } } }
private void validateDecorators(BeanManagerImpl beanManager, DecorableBean<?> bean) { if (!(beanManager.isPassivatingScope(bean.getScope()) || bean instanceof AbstractDecorableBuiltInBean<?>)) { return; } List<Decorator<?>> decorators = bean.getDecorators(); if (decorators.isEmpty()) { return; } for (Decorator<?> decorator : decorators) { if (!Decorators.isPassivationCapable(decorator)) { if (bean instanceof AbstractDecorableBuiltInBean<?>) { throw ValidatorLogger.LOG.builtinBeanWithNonserializableDecorator(decorator, bean); } else { throw ValidatorLogger.LOG.passivatingBeanWithNonserializableDecorator(bean, decorator); } } if (decorator instanceof DecoratorImpl) { beanManager = ((DecoratorImpl<?>) decorator).getBeanManager(); } for (InjectionPoint ij : decorator.getInjectionPoints()) { if (!ij.isDelegate()) { Bean<?> resolvedBean = beanManager.resolve(beanManager.getBeans(ij)); validateInterceptorDecoratorInjectionPointPassivationCapable(ij, resolvedBean, beanManager, bean); } } } }
private void validateDecorators(BeanManagerImpl beanManager, DecorableBean<?> bean) { if (!(beanManager.isPassivatingScope(bean.getScope()) || bean instanceof AbstractDecorableBuiltInBean<?>)) { return; } List<Decorator<?>> decorators = bean.getDecorators(); if (decorators.isEmpty()) { return; } for (Decorator<?> decorator : decorators) { if (!Decorators.isPassivationCapable(decorator)) { if (bean instanceof AbstractDecorableBuiltInBean<?>) { throw ValidatorLogger.LOG.builtinBeanWithNonserializableDecorator(decorator, bean); } else { throw ValidatorLogger.LOG.passivatingBeanWithNonserializableDecorator(bean, decorator); } } if (decorator instanceof DecoratorImpl) { beanManager = ((DecoratorImpl<?>) decorator).getBeanManager(); } for (InjectionPoint ij : decorator.getInjectionPoints()) { if (!ij.isDelegate()) { Bean<?> resolvedBean = beanManager.resolve(beanManager.getBeans(ij)); validateInterceptorDecoratorInjectionPointPassivationCapable(ij, resolvedBean, beanManager, bean); } } } }
private void validateDecorators(BeanManagerImpl beanManager, DecorableBean<?> bean) { if (!(beanManager.isPassivatingScope(bean.getScope()) || bean instanceof AbstractDecorableBuiltInBean<?>)) { return; } List<Decorator<?>> decorators = bean.getDecorators(); if (decorators.isEmpty()) { return; } for (Decorator<?> decorator : decorators) { if (!Decorators.isPassivationCapable(decorator)) { if (bean instanceof AbstractDecorableBuiltInBean<?>) { throw ValidatorLogger.LOG.builtinBeanWithNonserializableDecorator(decorator, bean); } else { throw ValidatorLogger.LOG.passivatingBeanWithNonserializableDecorator(bean, decorator); } } if (decorator instanceof DecoratorImpl) { beanManager = ((DecoratorImpl<?>) decorator).getBeanManager(); } for (InjectionPoint ij : decorator.getInjectionPoints()) { if (!ij.isDelegate()) { Bean<?> resolvedBean = beanManager.resolve(beanManager.getBeans(ij)); validateInterceptorDecoratorInjectionPointPassivationCapable(ij, resolvedBean, beanManager, bean); } } } }
private void validateDecorators(BeanManagerImpl beanManager, DecorableBean<?> bean) { if (!(beanManager.isPassivatingScope(bean.getScope()) || bean instanceof AbstractDecorableBuiltInBean<?>)) { return; } List<Decorator<?>> decorators = bean.getDecorators(); if (decorators.isEmpty()) { return; } for (Decorator<?> decorator : decorators) { if (!Decorators.isPassivationCapable(decorator)) { if (bean instanceof AbstractDecorableBuiltInBean<?>) { throw ValidatorLogger.LOG.builtinBeanWithNonserializableDecorator(decorator, bean); } else { throw ValidatorLogger.LOG.passivatingBeanWithNonserializableDecorator(bean, decorator); } } if (decorator instanceof DecoratorImpl) { beanManager = ((DecoratorImpl<?>) decorator).getBeanManager(); } for (InjectionPoint ij : decorator.getInjectionPoints()) { if (!ij.isDelegate()) { Bean<?> resolvedBean = beanManager.resolve(beanManager.getBeans(ij)); validateInterceptorDecoratorInjectionPointPassivationCapable(ij, resolvedBean, beanManager, bean); } } } }
protected void checkDecoratedMethods(EnhancedAnnotatedType<T> type, List<Decorator<?>> decorators) { if (type.isFinal()) { throw BeanLogger.LOG.finalBeanClassWithDecoratorsNotAllowed(this); } checkNoArgsConstructor(type); for (Decorator<?> decorator : decorators) { EnhancedAnnotatedType<?> decoratorClass; if (decorator instanceof DecoratorImpl<?>) { DecoratorImpl<?> decoratorBean = (DecoratorImpl<?>) decorator; decoratorClass = decoratorBean.getBeanManager().getServices().get(ClassTransformer.class).getEnhancedAnnotatedType(decoratorBean.getAnnotated()); } else if (decorator instanceof CustomDecoratorWrapper<?>) { decoratorClass = ((CustomDecoratorWrapper<?>) decorator).getEnhancedAnnotated(); } else { throw BeanLogger.LOG.nonContainerDecorator(decorator); } for (EnhancedAnnotatedMethod<?, ?> decoratorMethod : decoratorClass.getEnhancedMethods()) { EnhancedAnnotatedMethod<?, ?> method = type.getEnhancedMethod(decoratorMethod.getSignature()); if (method != null && !method.isStatic() && !method.isPrivate() && method.isFinal()) { throw BeanLogger.LOG.finalBeanClassWithInterceptorsNotAllowed(this); } } } }
protected void checkDecoratedMethods(EnhancedAnnotatedType<T> type, List<Decorator<?>> decorators) { if (type.isFinal()) { throw BeanLogger.LOG.finalBeanClassWithDecoratorsNotAllowed(this); } checkNoArgsConstructor(type); for (Decorator<?> decorator : decorators) { EnhancedAnnotatedType<?> decoratorClass; if (decorator instanceof DecoratorImpl<?>) { DecoratorImpl<?> decoratorBean = (DecoratorImpl<?>) decorator; decoratorClass = decoratorBean.getBeanManager().getServices().get(ClassTransformer.class).getEnhancedAnnotatedType(decoratorBean.getAnnotated()); } else if (decorator instanceof CustomDecoratorWrapper<?>) { decoratorClass = ((CustomDecoratorWrapper<?>) decorator).getEnhancedAnnotated(); } else { throw BeanLogger.LOG.nonContainerDecorator(decorator); } for (EnhancedAnnotatedMethod<?, ?> decoratorMethod : decoratorClass.getEnhancedMethods()) { EnhancedAnnotatedMethod<?, ?> method = type.getEnhancedMethod(decoratorMethod.getSignature()); if (method != null && !method.isStatic() && !method.isPrivate() && method.isFinal()) { throw BeanLogger.LOG.finalBeanClassWithInterceptorsNotAllowed(this); } } } }
protected void checkDecoratedMethods(EnhancedAnnotatedType<T> type, List<Decorator<?>> decorators) { if (type.isFinal()) { throw BeanLogger.LOG.finalBeanClassWithDecoratorsNotAllowed(this); } checkNoArgsConstructor(type); for (Decorator<?> decorator : decorators) { EnhancedAnnotatedType<?> decoratorClass; if (decorator instanceof DecoratorImpl<?>) { DecoratorImpl<?> decoratorBean = (DecoratorImpl<?>) decorator; decoratorClass = decoratorBean.getBeanManager().getServices().get(ClassTransformer.class).getEnhancedAnnotatedType(decoratorBean.getAnnotated()); } else if (decorator instanceof CustomDecoratorWrapper<?>) { decoratorClass = ((CustomDecoratorWrapper<?>) decorator).getEnhancedAnnotated(); } else { throw BeanLogger.LOG.nonContainerDecorator(decorator); } for (EnhancedAnnotatedMethod<?, ?> decoratorMethod : decoratorClass.getEnhancedMethods()) { EnhancedAnnotatedMethod<?, ?> method = type.getEnhancedMethod(decoratorMethod.getSignature()); if (method != null && !method.isStatic() && !method.isPrivate() && method.isFinal()) { throw BeanLogger.LOG.finalBeanClassWithInterceptorsNotAllowed(this); } } } }
protected void checkDecoratedMethods(EnhancedAnnotatedType<T> type, List<Decorator<?>> decorators) { if (type.isFinal()) { throw BeanLogger.LOG.finalBeanClassWithDecoratorsNotAllowed(this); } checkNoArgsConstructor(type); for (Decorator<?> decorator : decorators) { EnhancedAnnotatedType<?> decoratorClass; if (decorator instanceof DecoratorImpl<?>) { DecoratorImpl<?> decoratorBean = (DecoratorImpl<?>) decorator; decoratorClass = decoratorBean.getBeanManager().getServices().get(ClassTransformer.class).getEnhancedAnnotatedType(decoratorBean.getAnnotated()); } else if (decorator instanceof CustomDecoratorWrapper<?>) { decoratorClass = ((CustomDecoratorWrapper<?>) decorator).getEnhancedAnnotated(); } else { throw BeanLogger.LOG.nonContainerDecorator(decorator); } for (EnhancedAnnotatedMethod<?, ?> decoratorMethod : decoratorClass.getEnhancedMethods()) { EnhancedAnnotatedMethod<?, ?> method = type.getEnhancedMethod(decoratorMethod.getSignature()); if (method != null && !method.isStatic() && !method.isPrivate() && method.isFinal()) { throw BeanLogger.LOG.finalBeanClassWithInterceptorsNotAllowed(this); } } } }
protected void checkDecoratedMethods(EnhancedAnnotatedType<T> type, List<Decorator<?>> decorators) { if (type.isFinal()) { throw BeanLogger.LOG.finalBeanClassWithDecoratorsNotAllowed(this); } checkNoArgsConstructor(type); for (Decorator<?> decorator : decorators) { EnhancedAnnotatedType<?> decoratorClass; if (decorator instanceof DecoratorImpl<?>) { DecoratorImpl<?> decoratorBean = (DecoratorImpl<?>) decorator; decoratorClass = decoratorBean.getBeanManager().getServices().get(ClassTransformer.class).getEnhancedAnnotatedType(decoratorBean.getAnnotated()); } else if (decorator instanceof CustomDecoratorWrapper<?>) { decoratorClass = ((CustomDecoratorWrapper<?>) decorator).getEnhancedAnnotated(); } else { throw BeanLogger.LOG.nonContainerDecorator(decorator); } for (EnhancedAnnotatedMethod<?, ?> decoratorMethod : decoratorClass.getEnhancedMethods()) { EnhancedAnnotatedMethod<?, ?> method = type.getEnhancedMethod(decoratorMethod.getSignature()); if (method != null && !method.isStatic() && !method.isPrivate() && method.isFinal()) { throw BeanLogger.LOG.finalBeanClassWithInterceptorsNotAllowed(this); } } } }
protected void checkDecoratedMethods(EnhancedAnnotatedType<T> type, List<Decorator<?>> decorators) { if (type.isFinal()) { throw BeanLogger.LOG.finalBeanClassWithDecoratorsNotAllowed(this); } checkNoArgsConstructor(type); for (Decorator<?> decorator : decorators) { EnhancedAnnotatedType<?> decoratorClass; if (decorator instanceof DecoratorImpl<?>) { DecoratorImpl<?> decoratorBean = (DecoratorImpl<?>) decorator; decoratorClass = decoratorBean.getBeanManager().getServices().get(ClassTransformer.class).getEnhancedAnnotatedType(decoratorBean.getAnnotated()); } else if (decorator instanceof CustomDecoratorWrapper<?>) { decoratorClass = ((CustomDecoratorWrapper<?>) decorator).getEnhancedAnnotated(); } else { throw BeanLogger.LOG.nonContainerDecorator(decorator); } for (EnhancedAnnotatedMethod<?, ?> decoratorMethod : decoratorClass.getEnhancedMethods()) { EnhancedAnnotatedMethod<?, ?> method = type.getEnhancedMethod(decoratorMethod.getSignature()); if (method != null && !method.isStatic() && !method.isPrivate() && method.isFinal()) { throw BeanLogger.LOG.finalBeanClassWithInterceptorsNotAllowed(this); } } } }