diff options
author | Chris Cleeland <chris.cleeland@gmail.com> | 1998-01-15 23:39:31 +0000 |
---|---|---|
committer | Chris Cleeland <chris.cleeland@gmail.com> | 1998-01-15 23:39:31 +0000 |
commit | 804126dca76f99948dbe7a8e7a99d34b5b29b122 (patch) | |
tree | 118b01f2a00533992621e7bc7efe03fa15a35089 | |
parent | 1ec09a1880b96153b42fa6dd4f2f90124a7c5771 (diff) | |
download | ATCD-804126dca76f99948dbe7a8e7a99d34b5b29b122.tar.gz |
Committed POACurrent stuff.
-rw-r--r-- | TAO/ChangeLog-98c | 12 | ||||
-rw-r--r-- | TAO/tao/orbobj.cpp | 25 | ||||
-rw-r--r-- | TAO/tao/orbobj.h | 11 |
3 files changed, 42 insertions, 6 deletions
diff --git a/TAO/ChangeLog-98c b/TAO/ChangeLog-98c index e9606c5caa4..5ac9ea404b8 100644 --- a/TAO/ChangeLog-98c +++ b/TAO/ChangeLog-98c @@ -1,3 +1,15 @@ +Thu Jan 15 17:27:26 1998 Chris Cleeland <cleeland@cs.wustl.edu> + + * tao/orb_core.{h,i}: Added the poa_current() method and internal + structure so that state is available to the POA and to the upcall. + + * tao/orbobj.{h,cpp}: Added resolve_poa_current() in order to + return the POACurrent state context. Added the "POACurrent" to + one of the things for which resolve_initial_references() works. + Changed resolve_poa() so that things can compile; the impl isn't + correct but when the POA stuff gets committed, this will be + changed accordingly. + Tue Jan 13 12:15:54 1998 Carlos O'Ryan <coryan@cs.wustl.edu> * TAO_IDL/be_include/be_operation.h: diff --git a/TAO/tao/orbobj.cpp b/TAO/tao/orbobj.cpp index 37657d0da9d..a102e07fd6e 100644 --- a/TAO/tao/orbobj.cpp +++ b/TAO/tao/orbobj.cpp @@ -293,21 +293,32 @@ CORBA_ORB::run (ACE_Time_Value *tv) } CORBA_Object_ptr +CORBA_ORB::resolve_poa_current (void) +{ + // Return the pointer to this thread's POACurrent. + // + // Somehow we have to morph the TAO_POA_Current* into a + // CORBA_Object_ptr! + return TAO_ORB_Core_instance ()->poa_current ()->_this (); +} + +CORBA_Object_ptr CORBA_ORB::resolve_poa (void) { // Need to do double-checked locking here to cover the case of // multiple threads using a global resource policy. - if (TAO_ORB_Core_instance->root_poa() == 0) + if (TAO_ORB_Core_instance ()->root_poa() == 0) { // Construct a new POA // Irfan fill this in properly - POA* newpoa = new POA (); + POA* newpoa = 0; // set the poa in the orbcore instance - TAO_ORB_Core_instance->root_poa (newpoa); + TAO_ORB_Core_instance ()->root_poa (newpoa); } - return TAO_ORB_Core_instance()->root_poa(); + //return TAO_ORB_Core_instance ()->root_poa(); + return 0; } CORBA_Object_ptr @@ -447,10 +458,12 @@ CORBA_ORB::resolve_name_service (void) CORBA_Object_ptr CORBA_ORB::resolve_initial_references (CORBA::String name) { - if (ACE_OS::strcmp (name, "NameService") == 0) + if (ACE_OS::strcmp (name, TAO_OBJID_NAMESERVICE) == 0) return this->resolve_name_service (); - else if (ACE_OS::strcmp (name, "RootPOA") == 0) + else if (ACE_OS::strcmp (name, TAO_OBJID_ROOTPOA) == 0) return this->resolve_poa (); + else if (ACE_OS::strcmp (name, TAO_OBJID_POACURRENT) == 0) + return this->resolve_poa_current (); else return CORBA_Object::_nil (); } diff --git a/TAO/tao/orbobj.h b/TAO/tao/orbobj.h index 570d8db47dc..3ba59d8ea70 100644 --- a/TAO/tao/orbobj.h +++ b/TAO/tao/orbobj.h @@ -25,6 +25,14 @@ #include "tao/corba.h" +// ObjectIds recognized by CORBA_ORB::resolve_initial_references ()... +// of course, no guarantees are made that the call will return something +// useful. +#define TAO_OBJID_NAMESERVICE "NameService" +#define TAO_OBJID_ROOTPOA "RootPOA" +#define TAO_OBJID_POACURRENT "POACurrent" +#define TAO_OBJID_INTERFACEREP "InterfaceRepository" + class TAO_Export CORBA_ORB : public TAO_IUnknown // = TITLE // ORB pseudo-objref. @@ -165,6 +173,9 @@ private: CORBA_Object_ptr resolve_poa (void); // Resolve the POA. + CORBA_Object_ptr resolve_poa_current (void); + // Resolve the POA current. + ACE_SYNCH_MUTEX lock_; u_int refcount_; ACE_Atomic_Op<ACE_SYNCH_MUTEX, CORBA::Boolean> open_called_; |