You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by cz...@apache.org on 2012/09/11 22:37:41 UTC
svn commit: r1383606 -
/felix/trunk/eventadmin/impl/src/main/java/org/apache/felix/eventadmin/impl/handler/EventHandlerProxy.java
Author: cziegeler
Date: Tue Sep 11 20:37:41 2012
New Revision: 1383606
URL: http://svn.apache.org/viewvc?rev=1383606&view=rev
Log:
FELIX-3518 - Update to EventAdmin Spec 1.3
Modified:
felix/trunk/eventadmin/impl/src/main/java/org/apache/felix/eventadmin/impl/handler/EventHandlerProxy.java
Modified: felix/trunk/eventadmin/impl/src/main/java/org/apache/felix/eventadmin/impl/handler/EventHandlerProxy.java
URL: http://svn.apache.org/viewvc/felix/trunk/eventadmin/impl/src/main/java/org/apache/felix/eventadmin/impl/handler/EventHandlerProxy.java?rev=1383606&r1=1383605&r2=1383606&view=diff
==============================================================================
--- felix/trunk/eventadmin/impl/src/main/java/org/apache/felix/eventadmin/impl/handler/EventHandlerProxy.java (original)
+++ felix/trunk/eventadmin/impl/src/main/java/org/apache/felix/eventadmin/impl/handler/EventHandlerProxy.java Tue Sep 11 20:37:41 2012
@@ -19,6 +19,7 @@
package org.apache.felix.eventadmin.impl.handler;
import java.util.Collection;
+import java.util.Iterator;
import org.apache.felix.eventadmin.impl.security.PermissionsUtil;
import org.apache.felix.eventadmin.impl.util.LogWrapper;
@@ -120,6 +121,33 @@ public class EventHandlerProxy {
this.topics = values;
}
}
+ else if (topicObj instanceof Collection)
+ {
+ final Collection col = (Collection)topicObj;
+ final String[] values = new String[col.size()];
+ int index = 0;
+ // check if one value matches '*'
+ final Iterator i = col.iterator();
+ boolean matchAll = false;
+ while ( i.hasNext() )
+ {
+ final String v = i.next().toString();
+ values[index] = v;
+ index++;
+ if ( "*".equals(v) )
+ {
+ matchAll = true;
+ }
+ }
+ if ( matchAll )
+ {
+ this.topics = null;
+ }
+ else
+ {
+ this.topics = values;
+ }
+ }
else if ( topicObj == null && !this.handlerContext.requireTopic )
{
this.topics = null;