Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id C68D716851E for ; Wed, 9 Aug 2017 03:58:45 +0200 (CEST) Received: (qmail 51073 invoked by uid 500); 9 Aug 2017 01:58:45 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 51064 invoked by uid 99); 9 Aug 2017 01:58:44 -0000 Received: from Unknown (HELO svn01-us-west.apache.org) (209.188.14.144) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Aug 2017 01:58:44 +0000 Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id EA6D23A002A for ; Wed, 9 Aug 2017 01:58:43 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1804481 - in /geronimo/components/config/trunk: ./ impl/ impl/src/main/java/org/apache/geronimo/config/cdi/ Date: Wed, 09 Aug 2017 01:58:41 -0000 To: scm@geronimo.apache.org From: johndament@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20170809015843.EA6D23A002A@svn01-us-west.apache.org> Author: johndament Date: Wed Aug 9 01:58:41 2017 New Revision: 1804481 URL: http://svn.apache.org/viewvc?rev=1804481&view=rev Log: Readding Weld3 profile. Added: geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/cdi/ConfigInjectionPoint.java geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/cdi/DefaultLiteral.java Modified: geronimo/components/config/trunk/impl/pom.xml geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/cdi/ConfigExtension.java geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/cdi/ConfigInjectionBean.java geronimo/components/config/trunk/pom.xml Modified: geronimo/components/config/trunk/impl/pom.xml URL: http://svn.apache.org/viewvc/geronimo/components/config/trunk/impl/pom.xml?rev=1804481&r1=1804480&r2=1804481&view=diff ============================================================================== --- geronimo/components/config/trunk/impl/pom.xml (original) +++ geronimo/components/config/trunk/impl/pom.xml Wed Aug 9 01:58:41 2017 @@ -222,19 +222,19 @@ org.jboss.weld.se weld-se-shaded - 3.0.0.Final + ${weld.version} test org.jboss.arquillian.container arquillian-weld-embedded - 2.0.0-SNAPSHOT + ${arquillian-weld-embedded.version} test javax.enterprise cdi-api - 2.0 + ${cdi2-api.version} Modified: geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/cdi/ConfigExtension.java URL: http://svn.apache.org/viewvc/geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/cdi/ConfigExtension.java?rev=1804481&r1=1804480&r2=1804481&view=diff ============================================================================== --- geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/cdi/ConfigExtension.java (original) +++ geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/cdi/ConfigExtension.java Wed Aug 9 01:58:41 2017 @@ -69,16 +69,18 @@ public class ConfigExtension implements } public void registerConfigProducer(@Observes AfterBeanDiscovery abd, BeanManager bm) { - Set types = injectionPoints.stream() + Set types = injectionPoints.stream() .filter(ip -> ip.getType() instanceof Class) - .map(ip -> (Class) REPLACED_TYPES.getOrDefault(ip.getType(), ip.getType())) + .map(ip -> REPLACED_TYPES.getOrDefault(ip.getType(), ip.getType())) .collect(Collectors.toSet()); // Provider and Optional are ParameterizedTypes and not a Class, so we need to add them manually types.add(Provider.class); types.add(Optional.class); - types.forEach(type -> abd.addBean(new ConfigInjectionBean(bm, type))); + types.stream() + .map(type -> new ConfigInjectionBean(bm, type)) + .forEach(abd::addBean); } public void validate(@Observes AfterDeploymentValidation add) { Modified: geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/cdi/ConfigInjectionBean.java URL: http://svn.apache.org/viewvc/geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/cdi/ConfigInjectionBean.java?rev=1804481&r1=1804480&r2=1804481&view=diff ============================================================================== --- geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/cdi/ConfigInjectionBean.java (original) +++ geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/cdi/ConfigInjectionBean.java Wed Aug 9 01:58:41 2017 @@ -86,7 +86,7 @@ public class ConfigInjectionBean impl @Override public Set getInjectionPoints() { - return Collections.EMPTY_SET; + return Collections.emptySet(); } @Override @@ -101,9 +101,7 @@ public class ConfigInjectionBean impl @Override public T create(CreationalContext context) { - Set> beans = bm.getBeans(InjectionPoint.class); - Bean bean = bm.resolve(beans); - InjectionPoint ip = (InjectionPoint) bm.getReference(bean, InjectionPoint.class, context); + InjectionPoint ip = (InjectionPoint)bm.getInjectableReference(new ConfigInjectionPoint(this),context); if (ip == null) { throw new IllegalStateException("Could not retrieve InjectionPoint"); } @@ -143,12 +141,11 @@ public class ConfigInjectionBean impl throw new IllegalStateException("unhandled ConfigProperty"); } - /** * Get the property key to use. * In case the {@link ConfigProperty#name()} is empty we will try to determine the key name from the InjectionPoint. */ - public static String getConfigKey(InjectionPoint ip, ConfigProperty configProperty) { + static String getConfigKey(InjectionPoint ip, ConfigProperty configProperty) { String key = configProperty.name(); if (key.length() > 0) { return key; @@ -208,7 +205,7 @@ public class ConfigInjectionBean impl @Override public Set> getStereotypes() { - return Collections.EMPTY_SET; + return Collections.emptySet(); } @Override Added: geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/cdi/ConfigInjectionPoint.java URL: http://svn.apache.org/viewvc/geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/cdi/ConfigInjectionPoint.java?rev=1804481&view=auto ============================================================================== --- geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/cdi/ConfigInjectionPoint.java (added) +++ geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/cdi/ConfigInjectionPoint.java Wed Aug 9 01:58:41 2017 @@ -0,0 +1,72 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.geronimo.config.cdi; + +import javax.enterprise.inject.spi.Annotated; +import javax.enterprise.inject.spi.Bean; +import javax.enterprise.inject.spi.InjectionPoint; +import java.lang.annotation.Annotation; +import java.lang.reflect.Member; +import java.lang.reflect.Type; +import java.util.Collections; +import java.util.Set; + +class ConfigInjectionPoint implements InjectionPoint{ + private final Bean bean; + + ConfigInjectionPoint(Bean bean) { + this.bean = bean; + } + + @Override + public boolean isTransient() { + return false; + } + + @Override + public boolean isDelegate() { + return false; + } + + @Override + public Type getType() { + return InjectionPoint.class; + } + + @Override + public Set getQualifiers() { + return Collections.singleton(DefaultLiteral.INSTANCE); + } + + @Override + public Member getMember() { + return null; + } + + @Override + public Bean getBean() { + return bean; + } + + @Override + public Annotated getAnnotated() { + return null; + } +} Added: geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/cdi/DefaultLiteral.java URL: http://svn.apache.org/viewvc/geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/cdi/DefaultLiteral.java?rev=1804481&view=auto ============================================================================== --- geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/cdi/DefaultLiteral.java (added) +++ geronimo/components/config/trunk/impl/src/main/java/org/apache/geronimo/config/cdi/DefaultLiteral.java Wed Aug 9 01:58:41 2017 @@ -0,0 +1,27 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.geronimo.config.cdi; + +import javax.enterprise.inject.Default; +import javax.enterprise.util.AnnotationLiteral; + +class DefaultLiteral extends AnnotationLiteral implements Default { + public static Default INSTANCE = new DefaultLiteral(); +} Modified: geronimo/components/config/trunk/pom.xml URL: http://svn.apache.org/viewvc/geronimo/components/config/trunk/pom.xml?rev=1804481&r1=1804480&r2=1804481&view=diff ============================================================================== --- geronimo/components/config/trunk/pom.xml (original) +++ geronimo/components/config/trunk/pom.xml Wed Aug 9 01:58:41 2017 @@ -54,6 +54,9 @@ 1.7.3 2.0.1-SNAPSHOT 1.1.13.Final + 2.0.0.Beta5 + 2.0 + 3.0.0.Final