Refine search
public ExplicitBeanArchiveMetadataContainer(Map<ResourceRoot, ExplicitBeanArchiveMetadata> beanArchiveMetadata) { this.beanArchiveMetadata = ImmutableMap.copyOf(beanArchiveMetadata); }
@Override protected Method getMethod(Object receiver) throws NoSuchMethodException { final Map<Class<?>, Method> methods = this.methods; Method method = this.methods.get(receiver.getClass()); if (method == null) { // the same method may be written to the map twice, but that is ok // lookupMethod is very slow Method delegate = getAnnotated().getJavaMember(); if ((hasDecorators() || MethodInjectionPointType.INITIALIZER.equals(type)) && (isPrivate(delegate) || isPackagePrivate(delegate.getModifiers()) && !Objects.equals(delegate.getDeclaringClass().getPackage(), receiver.getClass().getPackage()))) { // Initializer methods and decorated beans - overriding does not apply to private methods and package-private methods where the subclass is in a different package method = accessibleMethod; } else { method = SecurityActions.lookupMethod(receiver.getClass(), delegate.getName(), delegate.getParameterTypes()); SecurityActions.ensureAccessible(method); } final Map<Class<?>, Method> newMethods = ImmutableMap.<Class<?>, Method>builder().putAll(methods).put(receiver.getClass(), method).build(); this.methods = newMethods; } return method; }
public InterceptionModelBuilder() { this.methodsIgnoringGlobalInterceptors = ImmutableSet.builder(); this.allInterceptors = ImmutableSet.builder(); this.globalInterceptors = new EnumMap<>(InterceptionType.class); this.methodBoundInterceptors = new EnumMap<>(InterceptionType.class); this.memberInterceptorBindings = ImmutableMap.builder(); }
readObsoleteFileProperties( findPropertiesFiles(deployment, BOOTSTRAP_CONFIGURATION_FILE), ImmutableMap.<String, ConfigurationKey> builder().put("concurrentDeployment", ConfigurationKey.CONCURRENT_DEPLOYMENT) .put("preloaderThreadPoolSize", ConfigurationKey.PRELOADER_THREAD_POOL_SIZE).build()), BOOTSTRAP_CONFIGURATION_FILE); ImmutableMap.<String, ConfigurationKey> builder().put("threadPoolSize", ConfigurationKey.EXECUTOR_THREAD_POOL_SIZE) .put("threadPoolDebug", ConfigurationKey.EXECUTOR_THREAD_POOL_DEBUG) .put("threadPoolType", ConfigurationKey.EXECUTOR_THREAD_POOL_TYPE) merge(properties, ImmutableMap.<ConfigurationKey, Object>of(ConfigurationKey.RELAXED_CONSTRUCTION, true), UNSAFE_PROXIES_MARKER);
/** * @param annotation * @param store * @return a new qualifier instance for the given annotation */ public static QualifierInstance of(Annotation annotation, MetaAnnotationStore store) { Class<? extends Annotation> annotationType = annotation.annotationType(); if (Any.class == annotationType) { return ANY; } else if (Default.class == annotationType) { return DEFAULT; } else if (Named.class == annotationType) { Named named = (Named) annotation; return new QualifierInstance(annotationType, ImmutableMap.of("value", named.value())); } else { return new QualifierInstance(annotationType, createValues(annotation, store)); } }
private Annotations(AnnotatedConfigurator<?, ?, ?> configurator) { this.annotations = ImmutableSet.copyOf(configurator.getAnnotations()); this.annotationsMap = this.annotations.stream().collect(ImmutableMap.collector((a) -> a.annotationType(), Function.identity())); }
@Override protected Method getMethod(Object receiver) throws NoSuchMethodException { final Map<Class<?>, Method> methods = this.methods; Method method = this.methods.get(receiver.getClass()); if (method == null) { // the same method may be written to the map twice, but that is ok // lookupMethod is very slow Method delegate = getAnnotated().getJavaMember(); if ((hasDecorators() || MethodInjectionPointType.INITIALIZER.equals(type)) && (isPrivate(delegate) || isPackagePrivate(delegate.getModifiers()) && !Objects.equals(delegate.getDeclaringClass().getPackage(), receiver.getClass().getPackage()))) { // Initializer methods and decorated beans - overriding does not apply to private methods and package-private methods where the subclass is in a different package method = accessibleMethod; } else { method = SecurityActions.lookupMethod(receiver.getClass(), delegate.getName(), delegate.getParameterTypes()); SecurityActions.ensureAccessible(method); } final Map<Class<?>, Method> newMethods = ImmutableMap.<Class<?>, Method>builder().putAll(methods).put(receiver.getClass(), method).build(); this.methods = newMethods; } return method; }
public InterceptionModelBuilder() { this.methodsIgnoringGlobalInterceptors = ImmutableSet.builder(); this.allInterceptors = ImmutableSet.builder(); this.globalInterceptors = new EnumMap<>(InterceptionType.class); this.methodBoundInterceptors = new EnumMap<>(InterceptionType.class); this.memberInterceptorBindings = ImmutableMap.builder(); }
private Map<ConfigurationKey, Object> init(ServiceRegistry services, Deployment deployment) { // 1. Properties files // weld.properties Map<ConfigurationKey, Object> properties = readFileProperties(findPropertiesFiles(deployment, CONFIGURATION_FILE)); // org.jboss.weld.bootstrap.properties merge(properties, readObsoleteFileProperties( findPropertiesFiles(deployment, BOOTSTRAP_CONFIGURATION_FILE), ImmutableMap.<String, ConfigurationKey> builder().put("concurrentDeployment", ConfigurationKey.CONCURRENT_DEPLOYMENT) .put("preloaderThreadPoolSize", ConfigurationKey.PRELOADER_THREAD_POOL_SIZE).build()), BOOTSTRAP_CONFIGURATION_FILE); // org.jboss.weld.executor.properties merge(properties, readObsoleteFileProperties( findPropertiesFiles(deployment, EXECUTOR_CONFIGURATION_FILE), ImmutableMap.<String, ConfigurationKey> builder().put("threadPoolSize", ConfigurationKey.EXECUTOR_THREAD_POOL_SIZE) .put("threadPoolDebug", ConfigurationKey.EXECUTOR_THREAD_POOL_DEBUG) .put("threadPoolType", ConfigurationKey.EXECUTOR_THREAD_POOL_TYPE) .put("threadPoolKeepAliveTime", ConfigurationKey.EXECUTOR_THREAD_POOL_KEEP_ALIVE_TIME).build()), EXECUTOR_CONFIGURATION_FILE); // META-INF/org.jboss.weld.enableUnsafeProxies if (!findPropertiesFiles(deployment, UNSAFE_PROXIES_MARKER).isEmpty()) { merge(properties, ImmutableMap.of(ConfigurationKey.RELAXED_CONSTRUCTION, true), UNSAFE_PROXIES_MARKER); } // 2. System properties merge(properties, getSystemProperties(), SYSTEM_PROPETIES); merge(properties, getObsoleteSystemProperties(), OBSOLETE_SYSTEM_PROPETIES); // 3. Integrator SPI // ExternalConfiguration.getConfigurationProperties() map has precedence merge(properties, processExternalConfiguration(getExternalConfigurationOptions(services)), "ExternalConfiguration"); return properties; }
/** * @param annotation * @param store * @return a new qualifier instance for the given annotation */ public static QualifierInstance of(Annotation annotation, MetaAnnotationStore store) { Class<? extends Annotation> annotationType = annotation.annotationType(); if (Any.class == annotationType) { return ANY; } else if (Default.class == annotationType) { return DEFAULT; } else if (Named.class == annotationType) { Named named = (Named) annotation; return new QualifierInstance(annotationType, ImmutableMap.<String, Object>of("value", named.value())); } else { return new QualifierInstance(annotationType, createValues(annotation, store)); } }
private Annotations(AnnotatedConfigurator<?, ?, ?> configurator) { this.annotations = ImmutableSet.copyOf(configurator.getAnnotations()); this.annotationsMap = this.annotations.stream().collect(ImmutableMap.collector((a) -> a.annotationType(), Function.identity())); }
@Override protected Method getMethod(Object receiver) throws NoSuchMethodException { final Map<Class<?>, Method> methods = this.methods; Method method = this.methods.get(receiver.getClass()); if (method == null) { // the same method may be written to the map twice, but that is ok // lookupMethod is very slow Method delegate = getAnnotated().getJavaMember(); if ((hasDecorators() || MethodInjectionPointType.INITIALIZER.equals(type)) && (isPrivate(delegate) || isPackagePrivate(delegate.getModifiers()) && !Objects.equals(delegate.getDeclaringClass().getPackage(), receiver.getClass().getPackage()))) { // Initializer methods and decorated beans - overriding does not apply to private methods and package-private methods where the subclass is in a different package method = accessibleMethod; } else { method = SecurityActions.lookupMethod(receiver.getClass(), delegate.getName(), delegate.getParameterTypes()); SecurityActions.ensureAccessible(method); } final Map<Class<?>, Method> newMethods = ImmutableMap.<Class<?>, Method>builder().putAll(methods).put(receiver.getClass(), method).build(); this.methods = newMethods; } return method; }
@Override public Map<?, ?> apply(Map<?, ?> from) { return ImmutableMap.copyOf(from); } });
public InterceptionModelBuilder() { this.methodsIgnoringGlobalInterceptors = ImmutableSet.builder(); this.allInterceptors = ImmutableSet.builder(); this.globalInterceptors = new EnumMap<>(InterceptionType.class); this.methodBoundInterceptors = new EnumMap<>(InterceptionType.class); this.memberInterceptorBindings = ImmutableMap.builder(); }
private Map<ConfigurationKey, Object> init(ServiceRegistry services, Deployment deployment) { // 1. Properties files // weld.properties Map<ConfigurationKey, Object> properties = readFileProperties(findPropertiesFiles(deployment, CONFIGURATION_FILE)); // org.jboss.weld.bootstrap.properties merge(properties, readObsoleteFileProperties( findPropertiesFiles(deployment, BOOTSTRAP_CONFIGURATION_FILE), ImmutableMap.<String, ConfigurationKey> builder().put("concurrentDeployment", ConfigurationKey.CONCURRENT_DEPLOYMENT) .put("preloaderThreadPoolSize", ConfigurationKey.PRELOADER_THREAD_POOL_SIZE).build()), BOOTSTRAP_CONFIGURATION_FILE); // org.jboss.weld.executor.properties merge(properties, readObsoleteFileProperties( findPropertiesFiles(deployment, EXECUTOR_CONFIGURATION_FILE), ImmutableMap.<String, ConfigurationKey> builder().put("threadPoolSize", ConfigurationKey.EXECUTOR_THREAD_POOL_SIZE) .put("threadPoolDebug", ConfigurationKey.EXECUTOR_THREAD_POOL_DEBUG) .put("threadPoolType", ConfigurationKey.EXECUTOR_THREAD_POOL_TYPE) .put("threadPoolKeepAliveTime", ConfigurationKey.EXECUTOR_THREAD_POOL_KEEP_ALIVE_TIME).build()), EXECUTOR_CONFIGURATION_FILE); // META-INF/org.jboss.weld.enableUnsafeProxies if (!findPropertiesFiles(deployment, UNSAFE_PROXIES_MARKER).isEmpty()) { merge(properties, ImmutableMap.of(ConfigurationKey.RELAXED_CONSTRUCTION, true), UNSAFE_PROXIES_MARKER); } // 2. System properties merge(properties, getSystemProperties(), SYSTEM_PROPETIES); merge(properties, getObsoleteSystemProperties(), OBSOLETE_SYSTEM_PROPETIES); // 3. Integrator SPI // ExternalConfiguration.getConfigurationProperties() map has precedence merge(properties, processExternalConfiguration(getExternalConfigurationOptions(services)), "ExternalConfiguration"); return properties; }
/** * @param annotation * @param store * @return a new qualifier instance for the given annotation */ public static QualifierInstance of(Annotation annotation, MetaAnnotationStore store) { Class<? extends Annotation> annotationType = annotation.annotationType(); if (Any.class == annotationType) { return ANY; } else if (Default.class == annotationType) { return DEFAULT; } else if (Named.class == annotationType) { Named named = (Named) annotation; return new QualifierInstance(annotationType, ImmutableMap.of("value", named.value())); } else { return new QualifierInstance(annotationType, createValues(annotation, store)); } }
private Annotations(AnnotatedConfigurator<?, ?, ?> configurator) { this.annotations = ImmutableSet.copyOf(configurator.getAnnotations()); this.annotationsMap = this.annotations.stream().collect(ImmutableMap.collector((a) -> a.annotationType(), Function.identity())); }
@Override protected Method getMethod(Object receiver) throws NoSuchMethodException { final Map<Class<?>, Method> methods = this.methods; Method method = this.methods.get(receiver.getClass()); if (method == null) { // the same method may be written to the map twice, but that is ok // lookupMethod is very slow Method delegate = getAnnotated().getJavaMember(); if ((hasDecorators() || MethodInjectionPointType.INITIALIZER.equals(type)) && (isPrivate(delegate) || isPackagePrivate(delegate.getModifiers()) && !Objects.equals(delegate.getDeclaringClass().getPackage(), receiver.getClass().getPackage()))) { // Initializer methods and decorated beans - overriding does not apply to private methods and package-private methods where the subclass is in a different package method = accessibleMethod; } else { method = SecurityActions.lookupMethod(receiver.getClass(), delegate.getName(), delegate.getParameterTypes()); SecurityActions.ensureAccessible(method); } final Map<Class<?>, Method> newMethods = ImmutableMap.<Class<?>, Method>builder().putAll(methods).put(receiver.getClass(), method).build(); this.methods = newMethods; } return method; }
@Override public Map<?, ?> apply(Map<?, ?> from) { return ImmutableMap.copyOf(from); } });
public InterceptionModelBuilder() { this.methodsIgnoringGlobalInterceptors = ImmutableSet.builder(); this.allInterceptors = ImmutableSet.builder(); this.globalInterceptors = new EnumMap<>(InterceptionType.class); this.methodBoundInterceptors = new EnumMap<>(InterceptionType.class); this.memberInterceptorBindings = ImmutableMap.builder(); }