Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[swordfish-dev] Chat transcript 25/11/2008

Title: Chat transcript 25/11/2008
[START Transcript 25/11/2008]

Andrey Kopachevsky
I've implemented generic EventFilter based events filtering
by the way, using EVENT_FILTER-based technique don't solves problem Olivers described yesterday. We still have problem when  "system tries to deliver every event and then the handler rejects it"
here is simplified code snipped from generic osgi org.eclipse.equinox.internal.event.EventHandlerWrapper, the place where osgi proceed with event filtering:
   public void handleEvent(Event event, Permission perm) {
       Bundle bundle = reference.getBundle();

       // filter match
       Filter eventFilter = getFilter();
       if ((eventFilter != null) && !event.matches(eventFilter)) {
           return;
       }
      
      
       // get handler service
       EventHandler handlerService = getHandler();
   
       handlerService.handleEvent(event);
   }
so as you see filtering invocking each time new event arrived for current osgi event handler, right before EventHandler.handleEvent() method execution
@dietmar did you receive my private messages about eclipse svn?

Dietmar Wolz
will check the private message now, sorry
with EVENT_FILTER-based technique I meant not the filtering in handleEvent, but setting the EVENT_FILTER property while registering the handler
see
http://www.osgi.org/javadoc/r4v41/org/osgi/service/event/EventHandler.html
For example:
String[] topics = new String[] {EventConstants.EVENT_TOPIC, "com/isv/*"};
Hashtable ht = new Hashtable();
ht.put(EVENT_TOPIC, topics);
context.registerService(EventHandler.class.getName(), this, ht);
Event Handler services can also be registered with an EventConstants.EVENT_FILTER service propery to further filter the events. If the syntax of this filter is invalid, then the Event Handler must be ignored by the Event Admin service. The Event Admin service should log a warning.

Andrey Kopachevsky
yes Dietmar, I understand your right yesterday
I've been using EventConstant.EVENT_FILTER to filter events
but after I finished, I've downloaded equinox source codes and review actural realization behind equinox EventAdmin realization
so the org.eclipse.equinox.internal.event.EventHandlerWrapper class is  responsible for filtering and it behaviour completelly the same, it try to filter only when new message arrived

Dietmar Wolz
ok, this is an interesting observation, its not obvious from the api description, and maybe other osgi frameworks behave different. But you are right, for us equinox is relevant

Andrey Kopachevsky
I came to conclusion that osgi event behaviour is something the same as jms with message selectors

[END]

Want to join the chat?
http://www.skype.com/go/joinpublicchat?skypename=ranyart99&topic=Swordfish%20Developers&blob=Gu7tZh64gTuo551Icz6_iwhXVeXxQ0K4yEzI5XFwGdWIQ_-miteLtgSBILodJ8koN6Uwy9PiotEU5ewRYFqEJeUtl1Yhfc1ipuVwOFz0SWN9HwMZAeikprh0R_8


--

Oliver Wolf
SOPERA GmbH

Back to the top