public BeanDeploymentModule(String moduleId, DeploymentUnit deploymentUnit, Collection<BeanDeploymentArchiveImpl> beanDeploymentArchives) { this.beanDeploymentArchives = ImmutableSet.copyOf(beanDeploymentArchives); for (BeanDeploymentArchiveImpl bda : beanDeploymentArchives) { bda.addBeanDeploymentArchives(beanDeploymentArchives); } this.moduleDescriptor = WeldEEModuleDescriptor.of(moduleId, deploymentUnit); if (moduleDescriptor != null) { addService(EEModuleDescriptor.class, moduleDescriptor); } }
@Override public Set<?> apply(Set<?> from) { return ImmutableSet.copyOf(from); } });
@Override public Set<?> apply(Set<?> from) { return ImmutableSet.copyOf(from); } });
private BuilderInterceptorBean(Set<Annotation> interceptorBindings, InterceptionType type, int priority, BeanManagerImpl beanManager, Function<InvocationContext, Object> interceptorFunction, BiFunction<InvocationContext, Bean<?>, Object> interceptorMetadataFunction) { this.interceptorFunction = interceptorFunction; this.interceptorMetadataFunction = interceptorMetadataFunction; this.priority = priority; this.interceptionType = type; this.bindings = ImmutableSet.copyOf(interceptorBindings); this.beanManager = beanManager; }
private BuilderInterceptorBean(Set<Annotation> interceptorBindings, InterceptionType type, int priority, BeanManagerImpl beanManager, Function<InvocationContext, Object> interceptorFunction, BiFunction<InvocationContext, Bean<?>, Object> interceptorMetadataFunction) { this.interceptorFunction = interceptorFunction; this.interceptorMetadataFunction = interceptorMetadataFunction; this.priority = priority; this.interceptionType = type; this.bindings = ImmutableSet.copyOf(interceptorBindings); this.beanManager = beanManager; }
public Annotations(Annotation[] annotations) { if (annotations.length == 0) { this.annotations = Arrays2.EMPTY_ANNOTATION_ARRAY; this.annotationSet = Collections.emptySet(); } else { this.annotations = annotations; this.annotationSet = ImmutableSet.copyOf(Arrays.asList(annotations)); } } }
private static Set<Class<?>> transformToClasses(Collection<BusinessInterfaceDescriptor<?>> interfaceDescriptors) { if (interfaceDescriptors == null) { return Collections.emptySet(); } return ImmutableSet.copyOf(Iterables.transform(interfaceDescriptors, BusinessInterfaceDescriptorToClassFunction.INSTANCE)); }
public Set<Annotation> applyScopeInheritanceRules(Set<Annotation> annotations, Class<?> javaClass) { Set<Annotation> result = new HashSet<Annotation>(); for (Annotation annotation : annotations) { if (!isScopeAnnotation.getValue(annotation.annotationType())) { result.add(annotation); } } result.addAll(findTopLevelScopeDefinitions(javaClass)); return ImmutableSet.copyOf(result); }
public HierarchyDiscovery(Type type, TypeResolver resolver) { this.types = new HashMap<Class<?>, Type>(); this.resolver = resolver; this.resolvedTypeVariables = resolver.getResolvedTypeVariables(); discoverTypes(type, false); this.typeClosure = ImmutableSet.copyOf(types.values()); }
@Override public Set<Annotation> getDeclaredMetaAnnotations(Class<? extends Annotation> metaAnnotationType) { return declaredMetaAnnotationMap.containsKey(metaAnnotationType) ? ImmutableSet.copyOf(declaredMetaAnnotationMap.get(metaAnnotationType)) : Collections.<Annotation> emptySet(); }
@Override public Set<Annotation> getDeclaredMetaAnnotations(Class<? extends Annotation> metaAnnotationType) { return declaredMetaAnnotationMap.containsKey(metaAnnotationType) ? ImmutableSet.copyOf(declaredMetaAnnotationMap.get(metaAnnotationType)) : Collections.emptySet(); }
private Set<Annotation> getMemberBindingAnnotations(Map<Class<? extends Annotation>, Annotation> classBindingAnnotations, Set<Annotation> memberAnnotations) { Set<Annotation> methodBindingAnnotations = flattenInterceptorBindings(manager, filterInterceptorBindings(manager, memberAnnotations), true, true); return ImmutableSet.copyOf(mergeMethodInterceptorBindings(classBindingAnnotations, methodBindingAnnotations).values()); }
protected F makeResultImmutable(C result) { if (result instanceof List<?>) { return cast(ImmutableList.copyOf(((List<?>) result))); } if (result instanceof Set<?>) { return cast(ImmutableSet.copyOf((Set<?>) result)); } throw new IllegalArgumentException("Unable to make result immutable"); }
protected F makeResultImmutable(C result) { if (result instanceof List<?>) { return cast(ImmutableList.copyOf(((List<?>) result))); } if (result instanceof Set<?>) { return cast(ImmutableSet.copyOf((Set<?>) result)); } throw new IllegalArgumentException("Unable to make result immutable"); }
private void initCdiLifecycleInterceptors(Map<Class<? extends Annotation>, Annotation> classBindingAnnotations) { if (classBindingAnnotations.size() == 0) { return; } final Set<Annotation> qualifiers = ImmutableSet.copyOf(classBindingAnnotations.values()); initLifeCycleInterceptor(InterceptionType.POST_CONSTRUCT, null, qualifiers); initLifeCycleInterceptor(InterceptionType.PRE_DESTROY, null, qualifiers); initLifeCycleInterceptor(InterceptionType.PRE_PASSIVATE, null, qualifiers); initLifeCycleInterceptor(InterceptionType.POST_ACTIVATE, null, qualifiers); }
private void initCdiInterceptors() { Map<Class<? extends Annotation>, Annotation> classBindingAnnotations = getClassInterceptorBindings(); builder.setClassInterceptorBindings(ImmutableSet.copyOf(classBindingAnnotations.values())); initCdiLifecycleInterceptors(classBindingAnnotations); initCdiConstructorInterceptors(classBindingAnnotations); initCdiBusinessMethodInterceptors(classBindingAnnotations); }
public SyntheticDecorator(BeanAttributes<T> attributes, Class<T> beanClass, InjectionTargetFactory<T> factory, BeanManagerImpl manager) { super(attributes, beanClass, factory, manager); this.delegate = identifyDelegateInjectionPoint(getInjectionPoints()); this.decoratedTypes = ImmutableSet.copyOf(getDecoratedTypes(attributes.getTypes())); }
InterceptionModelImpl(InterceptionModelBuilder builder) { this.hasExternalNonConstructorInterceptors = builder.isHasExternalNonConstructorInterceptors(); this.globalInterceptors = builder.getGlobalInterceptors(); this.methodBoundInterceptors = builder.getMethodBoundInterceptors(); this.methodsIgnoringGlobalInterceptors = builder.getMethodsIgnoringGlobalInterceptors(); this.allInterceptors = builder.getAllInterceptors(); this.targetClassInterceptorMetadata = builder.getTargetClassInterceptorMetadata(); this.memberInterceptorBindings = builder.getMemberInterceptorBindings(); this.classInterceptorBindings = ImmutableSet.copyOf(builder.getClassInterceptorBindings()); }