[weld-commits] Weld SVN: r4403 - in api/trunk/cdi/src/main/java/javax/enterprise: inject/spi and 1 other directory.
weld-commits at lists.jboss.org
weld-commits at lists.jboss.org
Thu Oct 29 12:11:42 EDT 2009
Author: gavin.king at jboss.com
Date: 2009-10-29 12:11:40 -0400 (Thu, 29 Oct 2009)
New Revision: 4403
Modified:
api/trunk/cdi/src/main/java/javax/enterprise/event/Observes.java
api/trunk/cdi/src/main/java/javax/enterprise/event/package-info.java
api/trunk/cdi/src/main/java/javax/enterprise/inject/spi/Extension.java
Log:
container lifecycle events
Modified: api/trunk/cdi/src/main/java/javax/enterprise/event/Observes.java
===================================================================
--- api/trunk/cdi/src/main/java/javax/enterprise/event/Observes.java 2009-10-29 13:15:45 UTC (rev 4402)
+++ api/trunk/cdi/src/main/java/javax/enterprise/event/Observes.java 2009-10-29 16:11:40 UTC (rev 4403)
@@ -26,16 +26,18 @@
/**
* <p>Identifies the event parameter of an observer method. May be applied to
- * a parameter of a method of a bean class.</p>
+ * a parameter of a method of a bean class or
+ * {@linkplain javax.enterprise.inject.spi.Extension extension}.</p>
*
* <pre>
* public void afterLogin(@Observes LoggedInEvent event) { ... }
* </pre>
*
* <p>An observer method is a non-abstract method of a managed bean class or
- * session bean class. An observer method may be either static or non-static.
- * If the bean is a session bean, the observer method must be either a business
- * method of the EJB or a static method of the bean class.</p>
+ * session bean class (or of an extension). An observer method may be either
+ * static or non-static. If the bean is a session bean, the observer method
+ * must be either a business method of the EJB or a static method of the bean
+ * class.</p>
*
* <p>Each observer method must have exactly one event parameter, of the same
* type as the event type it observes. Event qualifiers may be declared
@@ -48,7 +50,7 @@
*
* <p>The event parameter type may contain a type variable or wildcard.</p>
*
- * <p>A bean may declare multiple observer methods.</p>
+ * <p>A bean (or extension) may declare multiple observer methods.</p>
*
* <p>Observer methods are inherited by bean subclasses.</p>
*
Modified: api/trunk/cdi/src/main/java/javax/enterprise/event/package-info.java
===================================================================
--- api/trunk/cdi/src/main/java/javax/enterprise/event/package-info.java 2009-10-29 13:15:45 UTC (rev 4402)
+++ api/trunk/cdi/src/main/java/javax/enterprise/event/package-info.java 2009-10-29 16:11:40 UTC (rev 4403)
@@ -44,15 +44,19 @@
* specific set of qualifiers. Any Java type may be observed by an
* observer method.</p>
*
- * <p>An observer method is a method of a bean class with a parameter
- * annotated {@link javax.enterprise.event.Observes @Observes}.</p>
+ * <p>An observer method is a method of a bean class or
+ * {@linkplain javax.enterprise.inject.spi.Extension extension} with a
+ * parameter annotated {@link javax.enterprise.event.Observes @Observes}.</p>
*
* <p>An observer method will be notified of an event if:</p>
*
* <ul>
- * <li>the type observed by the observer method is one of the event types
- * of the event, and</li>
- * <li>the observer method has all the event qualifiers of the event.</li>
+ * <li>the event object is assignable to the type observed by the observer
+ * method,</li>
+ * <li>the observer method has all the event qualifiers of the event, and</li>
+ * <li>either the event is not a container lifecycle event, or the observer
+ * method belongs to an
+ * {@linkplain javax.enterprise.inject.spi.Extension extension}.
* </ul>
*
* <p>If the observer method is a
Modified: api/trunk/cdi/src/main/java/javax/enterprise/inject/spi/Extension.java
===================================================================
--- api/trunk/cdi/src/main/java/javax/enterprise/inject/spi/Extension.java 2009-10-29 13:15:45 UTC (rev 4402)
+++ api/trunk/cdi/src/main/java/javax/enterprise/inject/spi/Extension.java 2009-10-29 16:11:40 UTC (rev 4403)
@@ -28,7 +28,8 @@
* the application shuts down.</p>
*
* <p>Service providers may have observer methods, which may
- * observe container initialization events and obtain an injected
+ * observe any event, including any container lifecycle event,
+ * and obtain an injected
* {@link javax.enterprise.inject.spi.BeanManager}.<p>
*
* <p>Service providers are made available for injection as beans
More information about the weld-commits
mailing list