Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 91CA7200C80 for ; Thu, 25 May 2017 18:54:25 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 9037B160BCA; Thu, 25 May 2017 16:54:25 +0000 (UTC) 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 D6659160BB4 for ; Thu, 25 May 2017 18:54:24 +0200 (CEST) Received: (qmail 13533 invoked by uid 500); 25 May 2017 16:54:24 -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 13524 invoked by uid 99); 25 May 2017 16:54:24 -0000 Received: from Unknown (HELO svn01-us-west.apache.org) (209.188.14.144) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 May 2017 16:54:24 +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 2558C3A0069 for ; Thu, 25 May 2017 16:54:23 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1796175 - in /geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject: Instance.java spi/AfterTypeDiscovery.java spi/AnnotatedType.java Date: Thu, 25 May 2017 16:54:22 -0000 To: scm@geronimo.apache.org From: struberg@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20170525165423.2558C3A0069@svn01-us-west.apache.org> archived-at: Thu, 25 May 2017 16:54:25 -0000 Author: struberg Date: Thu May 25 16:54:22 2017 New Revision: 1796175 URL: http://svn.apache.org/viewvc?rev=1796175&view=rev Log: GERONIMO-6553 more cdi 2.0 fixes Modified: geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/Instance.java geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/AfterTypeDiscovery.java geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/AnnotatedType.java Modified: geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/Instance.java URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/Instance.java?rev=1796175&r1=1796174&r2=1796175&view=diff ============================================================================== --- geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/Instance.java (original) +++ geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/Instance.java Thu May 25 16:54:22 2017 @@ -19,6 +19,8 @@ package javax.enterprise.inject; import java.lang.annotation.Annotation; +import java.util.stream.Stream; +import java.util.stream.StreamSupport; import javax.enterprise.util.TypeLiteral; import javax.inject.Provider; @@ -77,6 +79,27 @@ public interface Instance extends Ite boolean isAmbiguous(); /** + * @return {@code true} if there is exactly one {@link javax.enterprise.inject.spi.Bean} + * which resolves according to the currently selected type and qualifiers. + * In other words: whether the Instance can serve an actual Contextual Reference. + * + * @since 2.0 + */ + default boolean isResolvable() + { + return !isAmbiguous() && !isUnsatisfied(); + } + + /** + * @return a Stream of all the beans available for the currently selected type and qualifiers, + * or an empty Stream if {@link #isUnsatisfied()} + */ + default Stream stream() + { + return StreamSupport.stream(spliterator(), false); + } + + /** * Destroy the given Contextual Instance. * This is especially intended for {@link javax.enterprise.context.Dependent} scoped beans * which might otherwise create mem leaks. @@ -84,4 +107,5 @@ public interface Instance extends Ite */ void destroy(T instance); + } Modified: geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/AfterTypeDiscovery.java URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/AfterTypeDiscovery.java?rev=1796175&r1=1796174&r2=1796175&view=diff ============================================================================== --- geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/AfterTypeDiscovery.java (original) +++ geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/AfterTypeDiscovery.java Thu May 25 16:54:22 2017 @@ -78,10 +78,10 @@ public interface AfterTypeDiscovery /** * Returns a new annotated type configurator based on a new bean id and bean class. * + * @param clazz to add * @param id of the annotated type - * @param clazz * @param * @return */ - AnnotatedTypeConfigurator addAnnotatedType(String id, Class clazz); + AnnotatedTypeConfigurator addAnnotatedType(Class clazz, String id); } Modified: geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/AnnotatedType.java URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/AnnotatedType.java?rev=1796175&r1=1796174&r2=1796175&view=diff ============================================================================== --- geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/AnnotatedType.java (original) +++ geronimo/specs/trunk/geronimo-jcdi_2.0_spec/src/main/java/javax/enterprise/inject/spi/AnnotatedType.java Thu May 25 16:54:22 2017 @@ -18,7 +18,6 @@ */ package javax.enterprise.inject.spi; -import javax.enterprise.inject.spi.configurator.AnnotatedTypeConfigurator; import java.lang.annotation.Annotation; import java.util.Arrays; import java.util.LinkedHashSet; @@ -59,12 +58,6 @@ public interface AnnotatedType extend */ Set> getFields(); - /** - * Creates a configurator to configure this annotated type. - * @return - */ - AnnotatedTypeConfigurator configureAnnotatedType(); - @Override default Set getAnnotations(Class annotationType) {