[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[equinox-dev] EventAdmin and topic legality

Good morning.


Forgive my posting if this is not the right forum to be asking these questions.  If so, redirection would be appreciated.


I’m having a spot of trouble with the Equinox EventAdmin.  It seems like the Equinox EventAdmin will not accept a topic that contains certain tokens, producing:


Exception in thread "Thread-0" java.lang.IllegalArgumentException: invalid topic

        at org.osgi.service.event.Event.validateToken(Event.java:187)

        at org.osgi.service.event.Event.validateTopicName(Event.java:161)

        at org.osgi.service.event.Event.<init>(Event.java:46)



The core OSGi spec defines a token as one or more alphanumerics, underscores, or dashes (1.4.2 - General Syntax Definitions).  Based on my investigation, the Equinox implementation seems to have a more strict interpretation of what is a valid token.  Dashes seem to be completely disallowed.  Numbers and underscores can be present, but cannot be the first character in a token.  Overall this seems similar to Java variable naming rules, but I was curious whether my interpretation of the spec is incorrect or if there was a reason for the discrepancy.


Many thanks,

-Mike Furtak