[weld-commits] Weld SVN: r4348 - cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer and 1 other directories.

weld-commits at lists.jboss.org weld-commits at lists.jboss.org
Tue Oct 27 13:31:00 EDT 2009


Author: dallen6
Date: 2009-10-27 13:30:59 -0400 (Tue, 27 Oct 2009)
New Revision: 4348

Modified:
   api/trunk/cdi/src/main/java/javax/enterprise/inject/spi/AnnotatedType.java
   api/trunk/cdi/src/main/java/javax/enterprise/inject/spi/Bean.java
   api/trunk/cdi/src/main/java/javax/enterprise/inject/spi/Decorator.java
   api/trunk/cdi/src/main/java/javax/enterprise/inject/spi/Interceptor.java
   api/trunk/cdi/src/main/java/javax/enterprise/inject/spi/ObserverMethod.java
   cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/ObserverTest.java
   cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/ResolveEventObserversTest.java
Log:
Updated JavaDocs and the ObserverMethod API to latest spec.

Modified: api/trunk/cdi/src/main/java/javax/enterprise/inject/spi/AnnotatedType.java
===================================================================
--- api/trunk/cdi/src/main/java/javax/enterprise/inject/spi/AnnotatedType.java	2009-10-27 11:57:40 UTC (rev 4347)
+++ api/trunk/cdi/src/main/java/javax/enterprise/inject/spi/AnnotatedType.java	2009-10-27 17:30:59 UTC (rev 4348)
@@ -32,7 +32,7 @@
    /**
     * Get the underlying {@linkplain java.lang.Class class} instance.
     * 
-    * @return
+    * @return the {@link java.lang.Class} of the instance
     */
    public Class<X> getJavaClass();
 

Modified: api/trunk/cdi/src/main/java/javax/enterprise/inject/spi/Bean.java
===================================================================
--- api/trunk/cdi/src/main/java/javax/enterprise/inject/spi/Bean.java	2009-10-27 11:57:40 UTC (rev 4347)
+++ api/trunk/cdi/src/main/java/javax/enterprise/inject/spi/Bean.java	2009-10-27 17:30:59 UTC (rev 4348)
@@ -23,70 +23,84 @@
 
 import javax.enterprise.context.spi.Contextual;
 
+/**
+ * <p>
+ * This interface defines everything the container needs to manage instances of
+ * a certain bean.
+ * </p>
+ * 
+ * @author David Allen
+ * @param <T> the class of the bean instance
+ */
 public interface Bean<T> extends Contextual<T>
 {
 
    /**
-    * The client-visible types of a bean
+    * Returns the client-visible {@linkplain Type types} of a bean.
     * 
-    * @return the bean types
+    * @return the bean {@linkplain Type types}
     */
    public Set<Type> getTypes();
 
    /**
-    * The bindings of a bean
+    * Returns the {@linkplain javax.inject.Qualifier qualifiers} of a bean.
     * 
-    * @return the bindings
+    * @return the {@linkplain javax.inject.Qualifier qualifiers}
     */
    public Set<Annotation> getQualifiers();
 
    /**
-    * The scope of a bean
+    * Returns the {@linkplain javax.enterprise.context scope} of a bean.
     * 
-    * @return the scope
+    * @return the {@linkplain javax.enterprise.context scope}
     */
    public Class<? extends Annotation> getScope();
 
    /**
-    * The name of a bean
+    * Returns the name of a bean, if it has one.
     * 
     * @return the name
     */
    public String getName();
 
    /**
-    * The stereotypes applied to this bean
+    * The {@linkplain javax.enterprise.inject.Stereotype stereotypes} applied to
+    * this bean
     * 
-    * @return stereotypes if any
+    * @return {@linkplain javax.enterprise.inject.Stereotype stereotypes} if any
     */
    public Set<Class<? extends Annotation>> getStereotypes();
 
    /**
-    * The bean class of the managed bean or session bean or of the bean that
-    * declares the producer method or field
+    * The bean {@linkplain Class class} of the managed bean or session bean or
+    * of the bean that declares the producer method or field
     * 
-    * @return the class of the managed bean
+    * @return the {@linkplain Class class} of the managed bean
     */
    public Class<?> getBeanClass();
 
    /**
-    * Test to see if the bean is a policy
+    * Test to see if the bean is an
+    * {@linkplain javax.enterprise.inject.Alternative alternative}.
     * 
-    * @return true if the bean is a policy
+    * @return true if the bean is an
+    *         {@linkplain javax.enterprise.inject.Alternative alternative}
     */
    public boolean isAlternative();
 
    /**
-    * The nullability of a bean
+    * Determines if the {@code create()} method may sometimes return a null
+    * value.
     * 
-    * @return true if the bean is nullable
+    * @return true if the {@code create()} method may return a null
     */
    public boolean isNullable();
 
    /**
-    * The injection points of a bean
+    * A set of {@link InjectionPoint} objects representing injection points of
+    * the bean, that will be validated by the container at initialization time.
     * 
-    * @return the injection points of a bean
+    * @return the {@linkplain InjectionPoint injection points} of a bean
     */
    public Set<InjectionPoint> getInjectionPoints();
 

Modified: api/trunk/cdi/src/main/java/javax/enterprise/inject/spi/Decorator.java
===================================================================
--- api/trunk/cdi/src/main/java/javax/enterprise/inject/spi/Decorator.java	2009-10-27 11:57:40 UTC (rev 4347)
+++ api/trunk/cdi/src/main/java/javax/enterprise/inject/spi/Decorator.java	2009-10-27 17:30:59 UTC (rev 4348)
@@ -22,7 +22,7 @@
 import java.util.Set;
 
 /**
- * The bean object for a decorator
+ * The bean object for a decorator must implement this interface.
  * 
  * @author Pete Muir
  *
@@ -32,23 +32,23 @@
 {
 
    /**
-    * Obtains the delegate type
+    * Obtains the delegate {@linkplain Type type}.
     * 
-    * @return
+    * @return the delegate {@linkplain Type type}
     */
    public Type getDelegateType();
 
    /**
-    * Obtains the delegate bindings
+    * Obtains the {@linkplain javax.inject.Qualifier qualifiers} of the delegate.
     * 
-    * @return
+    * @return the {@linkplain javax.inject.Qualifier qualifiers} of the delegate
     */
    public Set<Annotation> getDelegateQualifiers();
    
    /**
-    * Obtains the decorated types
+    * Obtains the decorated {@linkplain Type types} of the decorator
     * 
-    * @return
+    * @return the set of decorated {@linkplain Type types} of the decorator
     */
    public Set<Type> getDecoratedTypes();
 

Modified: api/trunk/cdi/src/main/java/javax/enterprise/inject/spi/Interceptor.java
===================================================================
--- api/trunk/cdi/src/main/java/javax/enterprise/inject/spi/Interceptor.java	2009-10-27 11:57:40 UTC (rev 4347)
+++ api/trunk/cdi/src/main/java/javax/enterprise/inject/spi/Interceptor.java	2009-10-27 17:30:59 UTC (rev 4348)
@@ -29,20 +29,20 @@
  * @author Pete Muir
  * @author David Allen
  *
- * @param <T>
+ * @param <T> the {@link java.lang.Class} of bean intercepted
  */
 public interface Interceptor<T> extends Bean<T>
 {
 
    /**
-    * The interceptor bindings used to bind an interceptor to a bean
+    * Returns the set of interceptor bindings used to bind an interceptor to a bean.
     * 
     * @return the interceptor bindings
     */
    public Set<Annotation> getInterceptorBindingTypes();
    
    /**
-    * Tests if this intercepts callbacks or business methods of the given type
+    * Tests if this intercepts callbacks or business methods of the given type.
     * 
     * @param type The type of interception
     * @return true if this intercepts the given type of methods
@@ -51,7 +51,7 @@
    
    /**
     * Invokes the specified kind of lifecycle callback or business method upon the 
-    * given instance
+    * given instance.
     * 
     * @param type the interception type
     * @param instance the instance to invoke

Modified: api/trunk/cdi/src/main/java/javax/enterprise/inject/spi/ObserverMethod.java
===================================================================
--- api/trunk/cdi/src/main/java/javax/enterprise/inject/spi/ObserverMethod.java	2009-10-27 11:57:40 UTC (rev 4347)
+++ api/trunk/cdi/src/main/java/javax/enterprise/inject/spi/ObserverMethod.java	2009-10-27 17:30:59 UTC (rev 4348)
@@ -7,17 +7,59 @@
 import javax.enterprise.event.Reception;
 import javax.enterprise.event.TransactionPhase;
 
+/**
+ * <p>
+ * This interface defines everything the container needs to know about an
+ * observer method.
+ * </p>
+ * 
+ * @author David Allen
+ * @param <X> the type of bean with the observer method
+ * @param <T> the type of event
+ */
 public interface ObserverMethod<X, T>
 {
-   public Bean<X> getBean();
+   /**
+    * Obtains the {@linkplain Class class} of bean defining the observer method.
+    * 
+    * @return the defining {@linkplain Class class}
+    */
+   public Class<X> getBeanClass();
 
+   /**
+    * Obtains the {@linkplain Type type} of event being observed.
+    * 
+    * @return the event {@linkplain Type type}
+    */
    public Type getObservedType();
 
+   /**
+    * Obtains the set of {@linkplain javax.inject.Qualifier qualifiers} for the
+    * event being observed.
+    * 
+    * @return the {@linkplain javax.inject.Qualifier qualifiers} for the event
+    */
    public Set<Annotation> getObservedQualifiers();
 
+   /**
+    * Obtains the specified {@link Reception} for the observer method. This
+    * indicates if the observer is conditional or not.
+    * 
+    * @return the {@link Reception}
+    */
    public Reception getReception();
 
+   /**
+    * Obtains the specified {@link TransactionPhase} for the observer method.
+    * 
+    * @return the {@link TransactionPhase}
+    */
    public TransactionPhase getTransactionPhase();
 
+   /**
+    * Calls the observer method passing the given event object.
+    * 
+    * @param event The event object
+    */
    public void notify(T event);
 }

Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/ObserverTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/ObserverTest.java	2009-10-27 11:57:40 UTC (rev 4347)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/ObserverTest.java	2009-10-27 17:30:59 UTC (rev 4348)
@@ -55,7 +55,7 @@
       Set<ObserverMethod<?, StockPrice>> observers = getCurrentManager().resolveObserverMethods(new StockPrice());
       assert observers.size() == 1;
       ObserverMethod<?, StockPrice> observerMethod = observers.iterator().next();
-      assert observerMethod.getBean().getBeanClass().equals(StockWatcher.class);
+      assert observerMethod.getBeanClass().equals(StockWatcher.class);
    }
 
    @Test(groups = { "events" })

Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/ResolveEventObserversTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/ResolveEventObserversTest.java	2009-10-27 11:57:40 UTC (rev 4347)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/observer/resolve/ResolveEventObserversTest.java	2009-10-27 17:30:59 UTC (rev 4348)
@@ -43,7 +43,7 @@
       Set<ObserverMethod<?, Temperature>> temperatureObservers = getCurrentManager().resolveObserverMethods(new Temperature(0d));
       assert temperatureObservers.size() == 1;
       ObserverMethod<?, Temperature> temperatureObserver = temperatureObservers.iterator().next();
-      assert temperatureObserver.getBean() == getUniqueBean(AirConditioner.class);
+      assert temperatureObserver.getBeanClass().equals(AirConditioner.class);
       assert temperatureObserver.getObservedType().equals(Temperature.class);
       
       Method method = AirConditioner.class.getMethod("temperatureChanged", Temperature.class);



More information about the weld-commits mailing list