1) Good catch and just in time! We are just finalizing a refresh of the R4 specs to collect up the errata and have added this to the list of fixes.
The token production will be changed to: token ::= ( alphanum | ’_’ | ’-’ )+ The Event.validateToken method will be fixed to accept this grammar. The method was originally written to the R3 token grammar. Late in the R4 cycle we updated the token grammar in the spec but missed the + and also the code in Event. 2) foo/bar/* will match foo/bar/xyz but will not match foo/bar or foo/barbar. It will match any topic that startsWith("foo/bar/"). If you want your handler to match foo/bar and foo/bar/*, then set both topics in the event.topics property: new String[] {"foo/bar", "foo/bar/*"} BJ Hargrave Senior Technical Staff Member, IBM OSGi Fellow and CTO of the OSGi Alliance [EMAIL PROTECTED] Office: +1 407 849 9117 Mobile: +1 386 848 3788 Michaël OULLION <[EMAIL PROTECTED]> Sent by: [EMAIL PROTECTED] 07/11/2006 04:11 AM Please respond to [EMAIL PROTECTED]; Please respond to OSGi Developer Mail List <osgi-dev@bundles.osgi.org> To osgi-dev@bundles.osgi.org cc Subject [osgi-dev] Questions about Event and topics Hi, I already try to send the first question but my subscribtion on the mailling list failed so i can't if they are somes responses. Sorry for the spam. First Question : I'm working on Event in OSGi and i found some differences between OSGi R4 specification and org.osgi.compendium. In OSGI R4 , a topic is defined by : topic ::= token ( ' / ' token ) * (see Topics 113.3.1 OSGi Compendium) and a token is : token ::= ( alphanum | ’_’ | ’-’ )* and alphanum ::= alpha | digit and digit ::= [0..9] and alpha ::= [a..zA..Z] (see General Syntax Definitions 1.4.2 OSGi Core) So, we can have a topic with an empty name (due to the * operator in token's definition ) or a topic begins with '-' or '_' or a digit. But, in the org.osgi.event.Event code, the validateToken() method is used to validate a topic. This method invalidate all topics beginning with '_' or '-' or a digit and also invalidate topics with empty name. Is it an error ? What "definition" must i respect??? OSGi R4 spec or org.osgi.event.Event ??? Second question : in Topics handler, when you configure your handler with "foo/bar/* ", will you receive the event propagate on foo/bar??? Regards, Oullion Michael, Student in Adele Team, LSR laboratory, France _______________________________________________ osgi-dev mailing list osgi-dev@bundles.osgi.org http://bundles.osgi.org/mailman/listinfo/osgi-dev _______________________________________________ osgi-dev mailing list osgi-dev@bundles.osgi.org http://bundles.osgi.org/mailman/listinfo/osgi-dev