[omniORB] Does omniORB support smart proxies?

Tuyen Chau tchau at verano.com
Wed Sep 27 14:18:27 BST 2006


I only found two threads discussing smart proxies in the last 10 years:

http://www.omniorb-support.com/pipermail/omniorb-list/2001-September/019210.html

http://www.omniorb-support.com/pipermail/omniorb-list/2000-December/016822.html

In the first thread, the author said he had implemented smart proxies, 
but then quickly dived into details about how the POF works without 
mentioning how the smart proxies were implemented in the first place.

In the second thread, Stefan Seefeld said:

------------------------------------------------
 > you should use some form of distributed ref counting, i.e. derive 
your servants
 > from an
 >
 > interface RefCountBase
 > {
 >   void increment();
 >   void decrement();
 > };
 >
 > Of course, you need to call these methods explicitely. There is no 
portable
 > way to add that to proxy classes. However, what I did to get a 
similar effect,
 > is to write a smart pointer template, something like this:
 >
 > template <typename Interface>
 > class RefCount_var
 > {
 > public:
 >   RefCount_var(typename Interface::_type_ptr i) : _i(i) {}
 >  ~RefCount_var()
 >     {
 >       if (!CORBA::is_nil(_i))
 >         try { _i->decrement();}
 >         catch (...) {}
 >     }
 > //...
 > }
 >
 > which you can use like smart proxies:
 >
 > RefCount_var<SomeObject> object = ...; // assumes ownership like 
'normal' vars...
------------------------------------------------

I still don't understand what Stefan said in the above.  Does anyone 
understand it, or know how to generate smart proxies in omniORB?  In my 
understanding, the process must involve creating a smart proxy factory 
class and somehow have it registered so omniORB will use it to create 
instances of proxy classes instead of the default CLASS_ptr objects.

Best regards,

Tuyen,



More information about the omniORB-list mailing list