Author: gavin.king(a)jboss.com
Date: 2009-10-24 11:46:55 -0400 (Sat, 24 Oct 2009)
New Revision: 4264
Modified:
api/trunk/cdi/src/main/java/javax/enterprise/inject/Specializes.java
api/trunk/cdi/src/main/java/javax/enterprise/inject/package-info.java
Log:
doc for specializes and enabled
Modified: api/trunk/cdi/src/main/java/javax/enterprise/inject/Specializes.java
===================================================================
--- api/trunk/cdi/src/main/java/javax/enterprise/inject/Specializes.java 2009-10-24
03:23:23 UTC (rev 4263)
+++ api/trunk/cdi/src/main/java/javax/enterprise/inject/Specializes.java 2009-10-24
15:46:55 UTC (rev 4264)
@@ -26,9 +26,37 @@
import java.lang.annotation.Target;
/**
- * Specifies that an implementation class directly specializes its superclass,
- * of that a producer method directly specializes the method it overrides.
+ * <p>Indicates that a bean directly specializes another bean.
+ * May be applied to a bean class or producer method.</p>
*
+ * <p>If a bean directly specializes a second bean, it
+ * inherits all qualifiers of the second bean, and has the
+ * same name as the second bean. If the second bean has
+ * a name, the bean may not declare a name using
+ * {@link javax.inject.Named @Named}. Furthermore,
+ * the bean must have all the bean types of the second
+ * bean.</p>
+ *
+ * <ul>
+ * <li>If a bean class of a managed bean is annotated
+ * <tt>@Specializes</tt>, then the bean class must
+ * directly extend the bean class of a second managed bean.
+ * Then the first managed bean directly specializes the
+ * second managed bean.</li>
+ *
+ * <li>If a bean class of a session bean is annotated
+ * <tt>@Specializes</tt>, then the bean class must
+ * directly extend the bean class of a second session bean.
+ * Then the first session bean directly specializes the
+ * second session bean.</li>
+ *
+ * <li>If a producer method is annotated
+ * <tt>@Specializes</tt>, then it must be non-static
+ * and directly override another producer method. Then the
+ * first producer method directly specializes the second
+ * producer method.</li>
+ * </ul>
+ *
* @author Gavin King
* @author Pete Muir
*/
Modified: api/trunk/cdi/src/main/java/javax/enterprise/inject/package-info.java
===================================================================
--- api/trunk/cdi/src/main/java/javax/enterprise/inject/package-info.java 2009-10-24
03:23:23 UTC (rev 4263)
+++ api/trunk/cdi/src/main/java/javax/enterprise/inject/package-info.java 2009-10-24
15:46:55 UTC (rev 4264)
@@ -252,6 +252,24 @@
*
* <p>A resource may not have an EL name.</p>
*
+ * <h3>Enabled and disabled beans</h3>
+ *
+ * <p>A bean is said to be enabled if:</p>
+ *
+ * <ul>
+ * <li>it is deployed in a bean deployment archive (a module with a
<tt>beans.xml</tt>
+ * file), and</li>
+ * <li>it is not a
+ * {@linkplain javax.enterprise.inject.Produces producer method or field}
+ * of a disabled bean, and</li>
+ * <li>it is not {@linkplain javax.enterprise.inject.Specializes specialized}
+ * by any other enabled bean, and either</li>
+ * <li>it is not an {@linkplain javax.enterprise.inject.Alternative alternative},
+ * or it is a selected alternative of at least one bean deployment archive.</li>
+ * </ul>
+ *
+ * <p>Otherwise, the bean is said to be disabled.</p>
+ *
* @see javax.enterprise.inject.Produces
* @see javax.inject.Scope
* @see javax.inject.Named
Show replies by date