@Override public Map<?, ?> apply(Map<?, ?> from) { return WeldCollections.immutableMapView(from); } });
@Override protected Map<Type, ArrayList<T>> computeValue() { Map<Type, ArrayList<T>> map = new HashMap<Type, ArrayList<T>>(); for (T bean : beans) { mapBean(map, bean); } trimArrayListsToSize(map); return WeldCollections.immutableMapView(map); }
@Override protected Map<Type, ArrayList<T>> computeValue() { Map<Type, ArrayList<T>> map = new HashMap<Type, ArrayList<T>>(); for (T bean : beans) { mapBean(map, bean); } trimArrayListsToSize(map); return WeldCollections.immutableMapView(map); }
@Override protected Map<Type, ArrayList<T>> computeValue() { Map<Type, ArrayList<T>> map = new HashMap<Type, ArrayList<T>>(); for (T bean : beans) { mapBean(map, bean); } trimArrayListsToSize(map); return WeldCollections.immutableMapView(map); }
@Override protected Map<Type, ArrayList<T>> computeValue() { Map<Type, ArrayList<T>> map = new HashMap<Type, ArrayList<T>>(); for (T bean : beans) { mapBean(map, bean); } trimArrayListsToSize(map); return WeldCollections.immutableMapView(map); }
@Override protected Map<Type, ArrayList<T>> computeValue() { Map<Type, ArrayList<T>> map = new HashMap<Type, ArrayList<T>>(); for (T bean : beans) { mapBean(map, bean); } trimArrayListsToSize(map); return WeldCollections.immutableMapView(map); }
/** * Invokes the method on the class of the passed instance, not the declaring * class. Useful with proxies * * @param instance The instance to invoke * @param manager The Bean manager * @return A reference to the instance */ public <X> X invokeOnInstance(Object instance, Object... parameters) throws IllegalArgumentException, SecurityException, IllegalAccessException, InvocationTargetException, NoSuchMethodException { final Map<Class<?>, Method> methods = this.methods; Method method = methods.get(instance.getClass()); if (method == null) { // the same method may be written to the map twice, but that is ok // lookupMethod is very slow Method delegate = annotatedMethod.getJavaMember(); method = SecurityActions.lookupMethod(instance.getClass(), delegate.getName(), delegate.getParameterTypes()); SecurityActions.ensureAccessible(method); synchronized (this) { final Map<Class<?>, Method> newMethods = new HashMap<Class<?>, Method>(methods); newMethods.put(instance.getClass(), method); this.methods = WeldCollections.immutableMapView(newMethods); } } return cast(method.invoke(instance, parameters)); }
/** * Invokes the method on the class of the passed instance, not the declaring * class. Useful with proxies * * @param instance The instance to invoke * @param manager The Bean manager * @return A reference to the instance */ public <X> X invokeOnInstance(Object instance, Object... parameters) throws IllegalArgumentException, SecurityException, IllegalAccessException, InvocationTargetException, NoSuchMethodException { final Map<Class<?>, Method> methods = this.methods; Method method = methods.get(instance.getClass()); if (method == null) { // the same method may be written to the map twice, but that is ok // lookupMethod is very slow Method delegate = annotatedMethod.getJavaMember(); method = SecurityActions.lookupMethod(instance.getClass(), delegate.getName(), delegate.getParameterTypes()); SecurityActions.ensureAccessible(method); synchronized (this) { final Map<Class<?>, Method> newMethods = new HashMap<Class<?>, Method>(methods); newMethods.put(instance.getClass(), method); this.methods = WeldCollections.immutableMapView(newMethods); } } return cast(method.invoke(instance, parameters)); }
/** * Invokes the method on the class of the passed instance, not the declaring * class. Useful with proxies * * @param instance The instance to invoke * @param manager The Bean manager * @return A reference to the instance */ public <X> X invokeOnInstance(Object instance, Object... parameters) throws IllegalArgumentException, SecurityException, IllegalAccessException, InvocationTargetException, NoSuchMethodException { final Map<Class<?>, Method> methods = this.methods; Method method = methods.get(instance.getClass()); if (method == null) { // the same method may be written to the map twice, but that is ok // lookupMethod is very slow Method delegate = annotatedMethod.getJavaMember(); method = SecurityActions.lookupMethod(instance.getClass(), delegate.getName(), delegate.getParameterTypes()); SecurityActions.ensureAccessible(method); synchronized (this) { final Map<Class<?>, Method> newMethods = new HashMap<Class<?>, Method>(methods); newMethods.put(instance.getClass(), method); this.methods = WeldCollections.immutableMapView(newMethods); } } return cast(method.invoke(instance, parameters)); }
/** * Invokes the method on the class of the passed instance, not the declaring * class. Useful with proxies * * @param instance The instance to invoke * @param manager The Bean manager * @return A reference to the instance */ public <X> X invokeOnInstance(Object instance, Object... parameters) throws IllegalArgumentException, SecurityException, IllegalAccessException, InvocationTargetException, NoSuchMethodException { final Map<Class<?>, Method> methods = this.methods; Method method = methods.get(instance.getClass()); if (method == null) { // the same method may be written to the map twice, but that is ok // lookupMethod is very slow Method delegate = annotatedMethod.getJavaMember(); method = SecurityActions.lookupMethod(instance.getClass(), delegate.getName(), delegate.getParameterTypes()); SecurityActions.ensureAccessible(method); synchronized (this) { final Map<Class<?>, Method> newMethods = new HashMap<Class<?>, Method>(methods); newMethods.put(instance.getClass(), method); this.methods = WeldCollections.immutableMapView(newMethods); } } return cast(method.invoke(instance, parameters)); }
/** * Invokes the method on the class of the passed instance, not the declaring * class. Useful with proxies * * @param instance The instance to invoke * @param manager The Bean manager * @return A reference to the instance */ public <X> X invokeOnInstance(Object instance, Object... parameters) throws IllegalArgumentException, SecurityException, IllegalAccessException, InvocationTargetException, NoSuchMethodException { final Map<Class<?>, Method> methods = this.methods; Method method = methods.get(instance.getClass()); if (method == null) { // the same method may be written to the map twice, but that is ok // lookupMethod is very slow Method delegate = annotatedMethod.getJavaMember(); method = SecurityActions.lookupMethod(instance.getClass(), delegate.getName(), delegate.getParameterTypes()); SecurityActions.ensureAccessible(method); synchronized (this) { final Map<Class<?>, Method> newMethods = new HashMap<Class<?>, Method>(methods); newMethods.put(instance.getClass(), method); this.methods = WeldCollections.immutableMapView(newMethods); } } return cast(method.invoke(instance, parameters)); }
private static Map<Serializable, Object> initInterceptorInstanceMap(InterceptionModel model, CreationalContext ctx, BeanManagerImpl manager, Set<InterceptionType> interceptionTypes) { Map<Serializable, Object> interceptorInstances = new HashMap<>(); for (InterceptorClassMetadata<?> interceptor : model.getAllInterceptors()) { if (interceptionTypes != null) { for (InterceptionType interceptionType : interceptionTypes) { if (interceptor.isEligible(interceptionType) && !interceptorInstances.containsKey(interceptor.getKey())) { interceptorInstances.put(interceptor.getKey(), interceptor.getInterceptorFactory().create(ctx, manager)); } } } else { interceptorInstances.put(interceptor.getKey(), interceptor.getInterceptorFactory().create(ctx, manager)); } } return WeldCollections.immutableMapView(interceptorInstances); }
private static Map<Serializable, Object> initInterceptorInstanceMap(InterceptionModel model, CreationalContext ctx, BeanManagerImpl manager, Set<InterceptionType> interceptionTypes) { Map<Serializable, Object> interceptorInstances = new HashMap<>(); for (InterceptorClassMetadata<?> interceptor : model.getAllInterceptors()) { if (interceptionTypes != null) { for (InterceptionType interceptionType : interceptionTypes) { if (interceptor.isEligible(interceptionType) && !interceptorInstances.containsKey(interceptor.getKey())) { interceptorInstances.put(interceptor.getKey(), interceptor.getInterceptorFactory().create(ctx, manager)); } } } else { interceptorInstances.put(interceptor.getKey(), interceptor.getInterceptorFactory().create(ctx, manager)); } } return WeldCollections.immutableMapView(interceptorInstances); }
private static Map<Serializable, Object> initInterceptorInstanceMap(InterceptionModel model, CreationalContext ctx, BeanManagerImpl manager, Set<InterceptionType> interceptionTypes) { Map<Serializable, Object> interceptorInstances = new HashMap<>(); for (InterceptorClassMetadata<?> interceptor : model.getAllInterceptors()) { if (interceptionTypes != null) { for (InterceptionType interceptionType : interceptionTypes) { if (interceptor.isEligible(interceptionType) && !interceptorInstances.containsKey(interceptor.getKey())) { interceptorInstances.put(interceptor.getKey(), interceptor.getInterceptorFactory().create(ctx, manager)); } } } else { interceptorInstances.put(interceptor.getKey(), interceptor.getInterceptorFactory().create(ctx, manager)); } } return WeldCollections.immutableMapView(interceptorInstances); }
private static Map<Serializable, Object> initInterceptorInstanceMap(InterceptionModel model, CreationalContext ctx, BeanManagerImpl manager, Set<InterceptionType> interceptionTypes) { Map<Serializable, Object> interceptorInstances = new HashMap<>(); for (InterceptorClassMetadata<?> interceptor : model.getAllInterceptors()) { if (interceptionTypes != null) { for (InterceptionType interceptionType : interceptionTypes) { if (interceptor.isEligible(interceptionType) && !interceptorInstances.containsKey(interceptor.getKey())) { interceptorInstances.put(interceptor.getKey(), interceptor.getInterceptorFactory().create(ctx, manager)); } } } else { interceptorInstances.put(interceptor.getKey(), interceptor.getInterceptorFactory().create(ctx, manager)); } } return WeldCollections.immutableMapView(interceptorInstances); }
@SuppressWarnings({ "unchecked", "rawtypes" }) private static Map<Class<?>, Object> initInterceptorInstanceMap(InterceptionModel model, CreationalContext ctx, BeanManagerImpl manager, Set<InterceptionType> interceptionTypes) { Map<Class<?>, Object> interceptorInstances = new HashMap<Class<?>, Object>(); for (InterceptorClassMetadata<?> interceptor : model.getAllInterceptors()) { if(interceptionTypes != null) { for (InterceptionType interceptionType : interceptionTypes) { if (interceptor.isEligible(interceptionType)) { interceptorInstances.put(interceptor.getJavaClass(), interceptor.getInterceptorFactory().create(ctx, manager)); } } } else { interceptorInstances.put(interceptor.getJavaClass(), interceptor.getInterceptorFactory().create(ctx, manager)); } } return immutableMapView(interceptorInstances); }
private static Map<Serializable, Object> initInterceptorInstanceMap(InterceptionModel model, CreationalContext ctx, BeanManagerImpl manager, Set<InterceptionType> interceptionTypes) { Map<Serializable, Object> interceptorInstances = new HashMap<>(); for (InterceptorClassMetadata<?> interceptor : model.getAllInterceptors()) { if (interceptionTypes != null) { for (InterceptionType interceptionType : interceptionTypes) { if (interceptor.isEligible(interceptionType) && !interceptorInstances.containsKey(interceptor.getKey())) { interceptorInstances.put(interceptor.getKey(), interceptor.getInterceptorFactory().create(ctx, manager)); } } } else { interceptorInstances.put(interceptor.getKey(), interceptor.getInterceptorFactory().create(ctx, manager)); } } return WeldCollections.immutableMapView(interceptorInstances); }
throw ReflectionLogger.LOG.annotationMapNull(); this.annotationMap = immutableMapView(annotationMap); SetMultimap<Class<? extends Annotation>, Annotation> metaAnnotationMap = SetMultimap.newSetMultimap(); processMetaAnnotations(metaAnnotationMap, annotationMap.values(), classTransformer, false);
throw ReflectionLogger.LOG.annotationMapNull(); this.annotationMap = immutableMapView(annotationMap); SetMultimap<Class<? extends Annotation>, Annotation> metaAnnotationMap = SetMultimap.newSetMultimap(); processMetaAnnotations(metaAnnotationMap, annotationMap.values(), classTransformer, false);
throw ReflectionLogger.LOG.annotationMapNull(); this.annotationMap = immutableMapView(annotationMap); SetMultimap<Class<? extends Annotation>, Annotation> metaAnnotationMap = SetMultimap.newSetMultimap(); processMetaAnnotations(metaAnnotationMap, annotationMap.values(), classTransformer, false);