I would really appreciate a bit of help with this... Please?<br><br><br><div class="gmail_quote">On Wed, Jan 6, 2010 at 7:51 PM, Michael Kilburn <span dir="ltr"><<a href="mailto:crusader.mike@gmail.com">crusader.mike@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi,<br><br>I wonder if it is possible to do these two things in CORBA server that uses omniORB:<br>
<br>1. wrap every incoming call with smth like:<br>try {<br>... // process call<br>} catch(std::exception const& x) {<br>
throw MyCorbaException(x.what());<br>}<br clear="all"><br>the idea is to replace CORBA_Unknown exceptions generated by escaped C++ exception with something more useful... Obviously this code should be executed in context of a thread that actually processes the request.<br>
I have checked interceptors in the documentation but it is very brief and does not give any guarantees on thread context given interceptor will be called in.<br><br>2. this one is very similar to (1) but not required to happen on request processing thread -- essentially I need to set a flag before processing a request and reset it when it returns. This is going to be used in conjunction with MAIN_THREAD_MODEL and it is important that flag for given request is not set before previous request finish processing... and once flag is set next request to be processed should be "ours". Ideally I would like this to work like in (1), but alternatively I can use global mutex:<br>
- in receive request interceptor -- lock mutex, set flag, proceed<br>- in reply interceptor (assuming that it is guaranteed to be called, even if "proceed" step fails before actually reaching user code) -- reset flag, unlock mutex<br>
But I am not sure if it is ok to lock mutexes in interceptors (and if it is ok with MAIN_THREAD_MODEL).<br><br>That's it... I am looking for a solution that will work regardless of current threading model and other configuration options and would be nice to have this at the POA granularity level (i.e. to be able to do it for requests server by specific POA -- but it is optional).<br>
<br>If someone could point me into proper direction -- it would be great. Thank you.<br>-- <br>Sincerely yours,<br><font color="#888888">Michael.<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Sincerely yours,<br>Michael.<br>