how to know wheter an object is still "alive"



In my application I have have to determine, whether that an object is still "alive" (reachable? active?) but I only have that object's IOR.

I thought that the following code would do this for me, but it does not:


static CORBA_Object
getGovernor(const char *governorIOR, CORBA_Environment * ev){

  CORBA_Object cur_gov = CORBA_OBJECT_NIL;

  // CHECK: is the current governor still active?
  if (governorIOR){

   // translate IOR
   cur_gov = (CORBA_Object) CORBA_ORB_string_to_object(global_orb, governorIOR, ev);

   // that IOR is not translatable
   if (ev->_major != CORBA_NO_EXCEPTION){

     debug(DEFAULT_DEBUG_FLAGS, "Could not find registered governor.\n");
     CORBA_exception_free(ev);

     // FIXME: is this needed?
     cur_gov = CORBA_OBJECT_NIL;

   // DON'T DO ANYTHING; governor is still active
   } else {
     debug(DEFAULT_DEBUG_FLAGS, "Registered governor still active.\n");
   }
  }

  return cur_gov;
}


How else can I get to know whether the IOR's object can be reached?

Marcus


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]