private boolean checkScopeInheritanceRules(SlimAnnotatedType<?> type, ContainerLifecycleEventObserverMethod<?> observer, BeanManagerImpl beanManager) { Collection<Class<? extends Annotation>> scopes; if (observer instanceof ExtensionObserverMethodImpl) { ExtensionObserverMethodImpl<?, ?> extensionObserver = (ExtensionObserverMethodImpl<?, ?>) observer; scopes = extensionObserver.getRequiredScopeAnnotations(); } else { scopes = observer.getRequiredAnnotations().stream().filter((a) -> beanManager.isScope(a)).collect(Collectors.toSet()); } if (!scopes.isEmpty() && scopes.size() == observer.getRequiredAnnotations().size()) { // this check only works if only scope annotations are listed within @WithAnnotations // performing a complete check would be way too expensive - eliminating the benefit of ClassFileServices for (Class<? extends Annotation> annotation : scopes) { if (type.isAnnotationPresent(annotation)) { return true; } } return false; } return true; }
private boolean checkScopeInheritanceRules(SlimAnnotatedType<?> type, ContainerLifecycleEventObserverMethod<?> observer, BeanManagerImpl beanManager) { Collection<Class<? extends Annotation>> scopes; if (observer instanceof ExtensionObserverMethodImpl) { ExtensionObserverMethodImpl<?, ?> extensionObserver = (ExtensionObserverMethodImpl<?, ?>) observer; scopes = extensionObserver.getRequiredScopeAnnotations(); } else { scopes = observer.getRequiredAnnotations().stream().filter((a) -> beanManager.isScope(a)).collect(Collectors.toSet()); } if (!scopes.isEmpty() && scopes.size() == observer.getRequiredAnnotations().size()) { // this check only works if only scope annotations are listed within @WithAnnotations // performing a complete check would be way too expensive - eliminating the benefit of ClassFileServices for (Class<? extends Annotation> annotation : scopes) { if (type.isAnnotationPresent(annotation)) { return true; } } return false; } return true; }
private boolean checkScopeInheritanceRules(SlimAnnotatedType<?> type, ContainerLifecycleEventObserverMethod<?> observer, BeanManagerImpl beanManager) { Collection<Class<? extends Annotation>> scopes; if (observer instanceof ExtensionObserverMethodImpl) { ExtensionObserverMethodImpl<?, ?> extensionObserver = (ExtensionObserverMethodImpl<?, ?>) observer; scopes = extensionObserver.getRequiredScopeAnnotations(); } else { scopes = observer.getRequiredAnnotations().stream().filter((a) -> beanManager.isScope(a)).collect(Collectors.toSet()); } if (!scopes.isEmpty() && scopes.size() == observer.getRequiredAnnotations().size()) { // this check only works if only scope annotations are listed within @WithAnnotations // performing a complete check would be way too expensive - eliminating the benefit of ClassFileServices for (Class<? extends Annotation> annotation : scopes) { if (type.isAnnotationPresent(annotation)) { return true; } } return false; } return true; }
private boolean checkScopeInheritanceRules(SlimAnnotatedType<?> type, ContainerLifecycleEventObserverMethod<?> observer, BeanManagerImpl beanManager) { Collection<Class<? extends Annotation>> scopes; if (observer instanceof ExtensionObserverMethodImpl) { ExtensionObserverMethodImpl<?, ?> extensionObserver = (ExtensionObserverMethodImpl<?, ?>) observer; scopes = extensionObserver.getRequiredScopeAnnotations(); } else { scopes = observer.getRequiredAnnotations().stream().filter((a) -> beanManager.isScope(a)).collect(Collectors.toSet()); } if (!scopes.isEmpty() && scopes.size() == observer.getRequiredAnnotations().size()) { // this check only works if only scope annotations are listed within @WithAnnotations // performing a complete check would be way too expensive - eliminating the benefit of ClassFileServices for (Class<? extends Annotation> annotation : scopes) { if (type.isAnnotationPresent(annotation)) { return true; } } return false; } return true; }
private boolean checkScopeInheritanceRules(SlimAnnotatedType<?> type, ContainerLifecycleEventObserverMethod<?> observer, BeanManagerImpl beanManager) { Collection<Class<? extends Annotation>> scopes; if (observer instanceof ExtensionObserverMethodImpl) { ExtensionObserverMethodImpl<?, ?> extensionObserver = (ExtensionObserverMethodImpl<?, ?>) observer; scopes = extensionObserver.getRequiredScopeAnnotations(); } else { scopes = observer.getRequiredAnnotations().stream().filter((a) -> beanManager.isScope(a)).collect(Collectors.toSet()); } if (!scopes.isEmpty() && scopes.size() == observer.getRequiredAnnotations().size()) { // this check only works if only scope annotations are listed within @WithAnnotations // performing a complete check would be way too expensive - eliminating the benefit of ClassFileServices for (Class<? extends Annotation> annotation : scopes) { if (type.isAnnotationPresent(annotation)) { return true; } } return false; } return true; }
public Collection<Class<? extends Annotation>> getRequiredScopeAnnotations() { if (requiredScopeTypeAnnotations == null) { // this init may be performed more than once - which is OK ImmutableSet.Builder<Class<? extends Annotation>> builder = ImmutableSet.builder(); for (Class<? extends Annotation> annotation : requiredTypeAnnotations) { if (beanManager.isScope(annotation)) { builder.add(annotation); } } this.requiredScopeTypeAnnotations = builder.build(); } return requiredScopeTypeAnnotations; }
public Collection<Class<? extends Annotation>> getRequiredScopeAnnotations() { if (requiredScopeTypeAnnotations == null) { // this init may be performed more than once - which is OK ImmutableSet.Builder<Class<? extends Annotation>> builder = ImmutableSet.builder(); for (Class<? extends Annotation> annotation : requiredTypeAnnotations) { if (beanManager.isScope(annotation)) { builder.add(annotation); } } this.requiredScopeTypeAnnotations = builder.build(); } return requiredScopeTypeAnnotations; }
public Collection<Class<? extends Annotation>> getRequiredScopeAnnotations() { if (requiredScopeTypeAnnotations == null) { // this init may be performed more than once - which is OK ImmutableSet.Builder<Class<? extends Annotation>> builder = ImmutableSet.builder(); for (Class<? extends Annotation> annotation : requiredTypeAnnotations) { if (beanManager.isScope(annotation)) { builder.add(annotation); } } this.requiredScopeTypeAnnotations = builder.build(); } return requiredScopeTypeAnnotations; }
public Collection<Class<? extends Annotation>> getRequiredScopeAnnotations() { if (requiredScopeTypeAnnotations == null) { // this init may be performed more than once - which is OK ImmutableSet.Builder<Class<? extends Annotation>> builder = ImmutableSet.builder(); for (Class<? extends Annotation> annotation : requiredTypeAnnotations) { if (beanManager.isScope(annotation)) { builder.add(annotation); } } this.requiredScopeTypeAnnotations = builder.build(); } return requiredScopeTypeAnnotations; }
public Collection<Class<? extends Annotation>> getRequiredScopeAnnotations() { if (requiredScopeTypeAnnotations == null) { // this init may be performed more than once - which is OK ImmutableSet.Builder<Class<? extends Annotation>> builder = ImmutableSet.builder(); for (Class<? extends Annotation> annotation : requiredTypeAnnotations) { if (beanManager.isScope(annotation)) { builder.add(annotation); } } this.requiredScopeTypeAnnotations = builder.build(); } return requiredScopeTypeAnnotations; }
public Collection<Class<? extends Annotation>> getRequiredScopeAnnotations() { if (requiredScopeTypeAnnotations == null) { // this init may be performed more than once - which is OK ImmutableSet.Builder<Class<? extends Annotation>> builder = ImmutableSet.builder(); for (Class<? extends Annotation> annotation : requiredTypeAnnotations) { if (beanManager.isScope(annotation)) { builder.add(annotation); } } this.requiredScopeTypeAnnotations = builder.build(); } return requiredScopeTypeAnnotations; }
@Override public void addContext(Context context) { checkWithinObserverNotification(); Preconditions.checkArgumentNotNull(context, "context"); Class<? extends Annotation> scope = context.getScope(); if (scope == null) { throw ContextLogger.LOG.contextHasNullScope(context); } if (!getBeanManager().isScope(scope)) { MetadataLogger.LOG.contextGetScopeIsNotAScope(scope, context); } if (scope == ApplicationScoped.class || scope == Dependent.class) { throw ContextLogger.LOG.cannotRegisterContext(scope, context); } getBeanManager().addContext(context); BootstrapLogger.LOG.addContext(getReceiver(), context); }
@Override public void addContext(Context context) { checkWithinObserverNotification(); Preconditions.checkArgumentNotNull(context, "context"); Class<? extends Annotation> scope = context.getScope(); if (scope == null) { throw ContextLogger.LOG.contextHasNullScope(context); } if (!getBeanManager().isScope(scope)) { MetadataLogger.LOG.contextGetScopeIsNotAScope(scope, context); } if (scope == ApplicationScoped.class || scope == Dependent.class) { throw ContextLogger.LOG.cannotRegisterContext(scope, context); } getBeanManager().addContext(context); BootstrapLogger.LOG.addContext(getReceiver(), context); }
@Override public void addContext(Context context) { checkWithinObserverNotification(); Preconditions.checkArgumentNotNull(context, "context"); Class<? extends Annotation> scope = context.getScope(); if (scope == null) { throw ContextLogger.LOG.contextHasNullScope(context); } if (!getBeanManager().isScope(scope)) { MetadataLogger.LOG.contextGetScopeIsNotAScope(scope, context); } if (scope == ApplicationScoped.class || scope == Dependent.class) { throw ContextLogger.LOG.cannotRegisterContext(scope, context); } getBeanManager().addContext(context); BootstrapLogger.LOG.addContext(getReceiver(), context); }
@Override public void addContext(Context context) { checkWithinObserverNotification(); Preconditions.checkArgumentNotNull(context, "context"); Class<? extends Annotation> scope = context.getScope(); if (scope == null) { throw ContextLogger.LOG.contextHasNullScope(context); } if (!getBeanManager().isScope(scope)) { MetadataLogger.LOG.contextGetScopeIsNotAScope(scope, context); } if (scope == ApplicationScoped.class || scope == Dependent.class) { throw ContextLogger.LOG.cannotRegisterContext(scope, context); } getBeanManager().addContext(context); BootstrapLogger.LOG.addContext(getReceiver(), context); }
@Override public void addContext(Context context) { checkWithinObserverNotification(); Preconditions.checkArgumentNotNull(context, "context"); Class<? extends Annotation> scope = context.getScope(); if (scope == null) { throw ContextLogger.LOG.contextHasNullScope(context); } if (!getBeanManager().isScope(scope)) { MetadataLogger.LOG.contextGetScopeIsNotAScope(scope, context); } if (scope == ApplicationScoped.class || scope == Dependent.class) { throw ContextLogger.LOG.cannotRegisterContext(scope, context); } getBeanManager().addContext(context); BootstrapLogger.LOG.addContext(getReceiver(), context); }
@Override public void addContext(Context context) { checkWithinObserverNotification(); Preconditions.checkArgumentNotNull(context, "context"); Class<? extends Annotation> scope = context.getScope(); if (scope == null) { throw ContextLogger.LOG.contextHasNullScope(context); } if (!getBeanManager().isScope(scope)) { MetadataLogger.LOG.contextGetScopeIsNotAScope(scope, context); } if (scope == ApplicationScoped.class || scope == Dependent.class) { throw ContextLogger.LOG.cannotRegisterContext(scope, context); } getBeanManager().addContext(context); BootstrapLogger.LOG.addContext(getReceiver(), context); }