Skip to content

Commit

Permalink
Some comments
Browse files Browse the repository at this point in the history
git-svn-id: http://anonsvn.jboss.org/repos/weld/ri/trunk@177 1c488680-804c-0410-94cd-c6b725194a0e
  • Loading branch information
pmuir committed Oct 27, 2008
1 parent 4fd19e8 commit 099167c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -43,6 +42,7 @@ public class EventImpl<T> implements Event<T>
*/
public void setEventBindings(Annotation... eventBindings)
{
// TODO Use constructor injection
Set<Annotation> newEventBindings = new HashSet<Annotation>();
addAnnotationBindings(newEventBindings, eventBindings);
this.eventBindings = newEventBindings;
Expand Down
Expand Up @@ -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;
Expand Down Expand Up @@ -75,6 +78,7 @@ public final Observer<T> getObserver()
*/
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)
Expand All @@ -87,6 +91,7 @@ public boolean isObserverInterested(Annotation... bindings)
int eventBindingIndex = bindingsArray.indexOf(annotation);
if (eventBindingIndex >= 0)
{
// TODO Use annotation equality
result = annotationsMatch(annotation, bindingsArray.get(eventBindingIndex));
} else
{
Expand All @@ -105,6 +110,7 @@ public boolean isObserverInterested(Annotation... bindings)
* @param annotation The first annotation to compare
* @param annotation2 The second annotation to compare
* @return
*
*/
private boolean annotationsMatch(Annotation annotation,
Annotation annotation2)
Expand All @@ -131,4 +137,6 @@ private boolean annotationsMatch(Annotation annotation,
return result;
}

// TODO Implement equals and hashCode

}

0 comments on commit 099167c

Please sign in to comment.