ObjectWeb Consortium
Search ObjectWeb Mail Archive: 

Advanced Search - Powered by Google


Mail Archive Home | oscar List | December 2006 Index

<--  Date Index  --> <--  Thread Index  -->

Re: [oscar] asynchronous event notification services


eguzkiastiz@xxxxxx wrote:
Hello,

I have performed a search on the archive looking for a thread about this 
issue, but found nothing, so I hope nobody has already asked about it.

I am developing using Oscar framework.
In my system I need an asynchronous event notification system and I found Notification Service bundle in the official reporsitory. The problem is that the event notification is performed synchronously and it is very important to be Asynchronous (different thread handling). In the documentation it literally says that "This service allows bundles to access asynchronous event notification services when the security manager is enabled". Therefore I enabled the security manager launching the framework with
java -Djava.security.manager
         -Djava.security.policy=example.policy
         -Dlib.dir=lib
         -jar lib/oscar.jar

When I check it with

if (System.getSecurityManager() != null){
}

in one of my bundles I get positive answer regarding security manager activation, however, sadly, the event notification is still synchronous.
What can I do to enable asynchronous feature?

I don't think Siena (the notification system underneath the notification service) works like you want by default. The asynchronous behavior described by the notification service is from the perspective of the receiver, not the sender. This "asynchronous receiver" approach is implemented through the callback interface, where the receiver can subscribe for events and receive them asynchronously.

You do not need security enabled to use the notification service, the documentation was merely referring to the fact that the notification services provides controlled access to the event notification system without requiring that each client bundle have access to sockets, etc.

If you want the sender to return immediately from the publish() method, then the notification service as it is will not work. However, it should be fairly easy to make it work the way you want. Just add a method to the callback interface called something like publishAsynchronously() and then modify the implementation to use a thread to invoke the original publish() method instead of use the calling thread.

-> richard



<--  Date Index  --> <--  Thread Index  -->

Reply via email to:

Powered by MHonArc.

Copyright © 1999-2005, ObjectWeb Consortium | contact | webmaster.