[webbeans-commits] Webbeans SVN: r177 - ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Mon Oct 27 06:41:27 EDT 2008


Author: pete.muir at jboss.org
Date: 2008-10-27 06:41:26 -0400 (Mon, 27 Oct 2008)
New Revision: 177

Modified:
   ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventImpl.java
   ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventObserver.java
Log:
Some comments

Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventImpl.java	2008-10-27 10:30:38 UTC (rev 176)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventImpl.java	2008-10-27 10:41:26 UTC (rev 177)
@@ -14,7 +14,6 @@
 import javax.webbeans.DuplicateBindingTypeException;
 import javax.webbeans.Event;
 import javax.webbeans.Observer;
-import javax.webbeans.TypeLiteral;
 import javax.webbeans.manager.Manager;
 
 /**
@@ -43,6 +42,7 @@
     */
    public void setEventBindings(Annotation... eventBindings)
    {
+      // TODO Use constructor injection
       Set<Annotation> newEventBindings = new HashSet<Annotation>();
       addAnnotationBindings(newEventBindings, eventBindings);
       this.eventBindings = newEventBindings;

Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventObserver.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventObserver.java	2008-10-27 10:30:38 UTC (rev 176)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/event/EventObserver.java	2008-10-27 10:41:26 UTC (rev 177)
@@ -20,6 +20,9 @@
  */
 public class EventObserver<T>
 {
+   
+   // TODO This probably should be an injectable or annotated item
+   
    private final Class<T> eventType;
    private final Annotation[] eventBindings;
    private final Observer<T> observer;
@@ -75,6 +78,7 @@
     */
    public boolean isObserverInterested(Annotation... bindings)
    {
+      // TODO This logic needs to be in injectable
       boolean result = true;
       // Check each binding specified by this observer against those provided
       if (this.eventBindings != null)
@@ -87,6 +91,7 @@
                int eventBindingIndex = bindingsArray.indexOf(annotation);
                if (eventBindingIndex >= 0)
                {
+                  // TODO Use annotation equality
                   result = annotationsMatch(annotation, bindingsArray.get(eventBindingIndex));
                } else
                {
@@ -105,6 +110,7 @@
     * @param annotation The first annotation to compare
     * @param annotation2 The second annotation to compare
     * @return
+    * 
     */
    private boolean annotationsMatch(Annotation annotation,
          Annotation annotation2)
@@ -131,4 +137,6 @@
       return result;
    }
 
+   // TODO Implement equals and hashCode
+   
 }




More information about the weld-commits mailing list