Hi Harun,

I came in need of a participant for some initialization work for my web application. So i implemented a java class and registered it to the rep/ participants.xml file as shown below

<rep>
<participant blocking="true">ri.server.participant.ParticipantMySiteInitializer</ participant> <participant param="rep/config-base.xml" blocking="true">ParticipantConfig</participant> <participant param="rep/datasources.xml" blocking="true">ParticipantDatasources</participant> <participant param="sites/mysite.xml" blocking="true">ParticipantSite</participant>
</rep>

My requirement is that if my initializer participant fails rest of the participants will not work. The first problem i faced is about telling rife that the participant failed. I tried to throw a RuntimeException from the initialize() method of the participant since it does not declare any thrown exceptions. This way the failure is ok but when i check the logs, is see a huge [MultiException] stacktrace since the exception is not meant to be handled by rife (i think?).

This exception is actually just being re-thrown by RIFE's Blocking Repository as-is, after it has caught it from the participant. The MultiException sounds like an exception that's specific to your servlet-container.

Is there another way to show rife that a participant failed so that it will not run other participants?

Throwing an exception is the best way, and RuntimeException makes sense since it does happen at runtime and it's that close to the life- cycle handling phase that nothing besides the Repository is able to catch it, and thus nothing is able to do something worthwhile with it.

Also i cannot make a System.exit() call cause i have other applications deployed on the container.

Just throwing the RuntimeException should stop the initialization of the entire repository, doesn't it?

Best regards,

Geert

--
Geert Bevin             Uwyn bvba               GTalk: [EMAIL PROTECTED]
"Use what you need"     Avenue de Scailmont 34  Skype: gbevin
http://www.uwyn.com     7170 Manage, Belgium      AIM: geertbevin
gbevin at uwyn dot com  Tel: +32 64 84 80 03   Mobile: +32 477 302 599

PGP Fingerprint : 4E21 6399 CD9E A384 6619  719A C8F4 D40D 309F D6A9
Public PGP key  : available at servers pgp.mit.edu, wwwkeys.pgp.net


_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users

Reply via email to