diff options
author | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-03-24 01:55:38 +0000 |
---|---|---|
committer | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-03-24 01:55:38 +0000 |
commit | 044da5a2646ca44134e25b304b04c9ca53408d93 (patch) | |
tree | 0290b314e2361bfd4f28bf6cfc85a2629a35b548 | |
parent | 9e9c420f2d57432fb80f410c8dd0c4c84d9aeaa4 (diff) | |
download | ATCD-044da5a2646ca44134e25b304b04c9ca53408d93.tar.gz |
*** empty log message ***
-rw-r--r-- | TAO/ChangeLog-98c | 10 | ||||
-rw-r--r-- | TAO/tao/GIOP.cpp | 2 | ||||
-rw-r--r-- | TAO/tao/IIOP_ORB.cpp | 26 | ||||
-rw-r--r-- | TAO/tao/IIOP_ORB.h | 5 | ||||
-rw-r--r-- | TAO/tao/IIOP_Object.cpp | 16 | ||||
-rw-r--r-- | TAO/tao/IIOP_Object.h | 8 | ||||
-rw-r--r-- | TAO/tao/ORB.cpp | 16 | ||||
-rw-r--r-- | TAO/tao/ORB.h | 16 | ||||
-rw-r--r-- | TAO/tao/Object_Table.h | 16 | ||||
-rw-r--r-- | TAO/tao/POAC.cpp | 1 | ||||
-rw-r--r-- | TAO/tao/POAC.h | 3 | ||||
-rw-r--r-- | TAO/tao/POAS.cpp | 1 | ||||
-rw-r--r-- | TAO/tao/Servant_Base.cpp | 6 | ||||
-rw-r--r-- | TAO/tao/TAO.cpp | 4 | ||||
-rw-r--r-- | TAO/tao/decode.cpp | 14 | ||||
-rw-r--r-- | TAO/tao/tao_util.cpp | 236 |
16 files changed, 38 insertions, 342 deletions
diff --git a/TAO/ChangeLog-98c b/TAO/ChangeLog-98c index acb3f0eb2b4..f6eb324c619 100644 --- a/TAO/ChangeLog-98c +++ b/TAO/ChangeLog-98c @@ -1,3 +1,13 @@ +Mon Mar 23 19:44:11 1998 Irfan Pyarali <irfan@cs.wustl.edu> + + * tao/ORB: CORBA_ORB no longer inherits from IUnknown. + + * tao/IIOP_Object.cpp (set): A valid key must be provided, else + the function will fail. Also removed all cases where the key + was given a default value (of "0"). + + * tao/IIOP_ORB.cpp (QueryInterface): Removed this method. + Mon Mar 23 13:20:12 1998 Michael Kircher <mk1@cs.wustl.edu> * orbsvcs/tests/Simulator/DOVEBrowser/WeaponsVisComp.java: diff --git a/TAO/tao/GIOP.cpp b/TAO/tao/GIOP.cpp index bde044bf630..013c19fb6d2 100644 --- a/TAO/tao/GIOP.cpp +++ b/TAO/tao/GIOP.cpp @@ -1133,7 +1133,7 @@ TAO_GIOP_Invocation::invoke (CORBA::ExceptionList &exceptions, // Make sure a new connection is used next time. this->handler_->close (); - this->handler_ = 0; // @@ not sure this is correct! + this->handler_ = 0; // We may not need to do this since TAO_GIOP_Invocations // get created on a per-call basis. For now we'll play it safe. } diff --git a/TAO/tao/IIOP_ORB.cpp b/TAO/tao/IIOP_ORB.cpp index 667c8dbc679..86da462c255 100644 --- a/TAO/tao/IIOP_ORB.cpp +++ b/TAO/tao/IIOP_ORB.cpp @@ -301,32 +301,6 @@ IIOP_ORB::string_to_object (CORBA::String str, return obj; } -// COM IUnknown support - -// {A201E4C4-F258-11ce-9598-0000C07CA898} -DEFINE_GUID (IID_IIOP_ORB, -0xa201e4c4, 0xf258, 0x11ce, 0x95, 0x98, 0x0, 0x0, 0xc0, 0x7c, 0xa8, 0x98); - -TAO_HRESULT -IIOP_ORB::QueryInterface (REFIID riid, - void **ppv) -{ - *ppv = 0; - - if (IID_CORBA_ORB == riid - || IID_IIOP_ORB == riid - || IID_TAO_IUnknown == riid) - *ppv = this; - - // XXX gotta aggregate ... - - if (*ppv == 0) - return ResultFromScode (TAO_E_NOINTERFACE); - - (void) AddRef (); - return TAO_NOERROR; -} - #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) template class ACE_Singleton<IIOP_ORB, ACE_SYNCH_RECURSIVE_MUTEX>; #elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) diff --git a/TAO/tao/IIOP_ORB.h b/TAO/tao/IIOP_ORB.h index 20706834b83..16f07a67445 100644 --- a/TAO/tao/IIOP_ORB.h +++ b/TAO/tao/IIOP_ORB.h @@ -43,11 +43,6 @@ public: CORBA::Environment &env); // Convert an object reference to an IOR stringified form. - TAO_HRESULT QueryInterface (REFIID riid, - void **ppv); - // COM stuff - get the underlying IUnknown object based on the riid. - // @@ (IRFAN) Can we remove this COM stuff?! - // = ACCESSORS void use_omg_ior_format (CORBA::Boolean ior); // Set the IOR flag. diff --git a/TAO/tao/IIOP_Object.cpp b/TAO/tao/IIOP_Object.cpp index 64a2f27f9a5..e1921a99d64 100644 --- a/TAO/tao/IIOP_Object.cpp +++ b/TAO/tao/IIOP_Object.cpp @@ -46,21 +46,11 @@ IIOP::Profile::set (const char *h, const char *key, const ACE_INET_Addr *addr) { - if (this->set (h, p, addr) == -1) + if (key == 0) return -1; - // Enough room as to print a <void *>. - // @@ The following "32" should not be a magic #... - const int bufs = 32; - char buffer[bufs]; - - if (key == 0) - { - // @@ (IRFAN) Object key generation - // Use <this> as the key... - ACE_OS::sprintf (buffer, "0x%024.24x", this); - key = buffer; - } + if (this->set (h, p, addr) == -1) + return -1; int l = ACE_OS::strlen (key); this->object_key.length (l); diff --git a/TAO/tao/IIOP_Object.h b/TAO/tao/IIOP_Object.h index 3eb6d98e8dd..8d750878798 100644 --- a/TAO/tao/IIOP_Object.h +++ b/TAO/tao/IIOP_Object.h @@ -205,16 +205,16 @@ public: const IIOP::Profile &profile); // Construct from a repository ID and a profile ID. - IIOP_Object (const char *host = ACE_DEFAULT_SERVER_HOST, - const CORBA::UShort p = TAO_DEFAULT_SERVER_PORT, - const char *objkey = "0", // @@ (IRFAN) We may need to remove this def arg + IIOP_Object (const char *host, + const CORBA::UShort p, + const char *objkey, char *repository_id = 0); // This constructor will usually be used by a <_bind> call on the // client side. IIOP_Object (char *repository_id, const ACE_INET_Addr &addr, - const char *objkey /*= "0"*/); // @@ (IRFAN) We may need to remove this def arg + const char *objkey); // Constructor used typically by the server side. // = Memory management. diff --git a/TAO/tao/ORB.cpp b/TAO/tao/ORB.cpp index 2aa6baaab3e..3f82c23782b 100644 --- a/TAO/tao/ORB.cpp +++ b/TAO/tao/ORB.cpp @@ -15,10 +15,6 @@ // COM's IUnknown support -// {A201E4C6-F258-11ce-9598-0000C07CA898} -DEFINE_GUID (IID_CORBA_ORB, - 0xa201e4c6, 0xf258, 0x11ce, 0x95, 0x98, 0x0, 0x0, 0xc0, 0x7c, 0xa8, 0x98); - // {A201E4C7-F258-11ce-9598-0000C07CA898} DEFINE_GUID (IID_STUB_Object, 0xa201e4c7, 0xf258, 0x11ce, 0x95, 0x98, 0x0, 0x0, 0xc0, 0x7c, 0xa8, 0x98); @@ -507,18 +503,6 @@ CORBA_ORB::key_to_object (const TAO_ObjectKey &key, else id = 0; - // @@ (IRFAN) This is the most likely chunk of code to break because - // of this evil cast. Unfortunately, the generated code for - // sequences doesn't give access to the underlying buffer, so I - // don't have a way to construct a new OctetSeq instance in the - // appropriate manner. Fortunately, in order for ObjectKey to be - // useable internally, we need the same capabilities, and so right - // around the time that this conversion could be done properly it - // won't have to be done at all. - // @@ I (coryan@cs) modified the ORB core to use - // PortableServer::ObjectId instead of CORBA::OctetSeq as object - // identifiers, if this prove to be wrong I'll take it back. - // CORBA::OctetSeq *internal_key = (CORBA::OctetSeq *)key; data = new IIOP_Object (id, IIOP::Profile (TAO_ORB_Core_instance ()->orb_params ()->addr (), key)); diff --git a/TAO/tao/ORB.h b/TAO/tao/ORB.h index df69c0666ed..2fdf69ef4cb 100644 --- a/TAO/tao/ORB.h +++ b/TAO/tao/ORB.h @@ -728,7 +728,7 @@ public: #include "tao/Sequence_T.h" #include "tao/Object_KeyC.h" -class TAO_Export CORBA_ORB : public TAO_IUnknown +class TAO_Export CORBA_ORB { // = TITLE // ORB pseudo-objref. @@ -840,15 +840,6 @@ public: // ORB will not normally return OBJECT_NOT_EXIST unless the POA // reports that fault. - // = <IUnknown> Support - // - // Stuff required for COM IUnknown support ... this class is - // intended to be inherited by others, which will provide some more - // of the CORBA/COM support. Implementations of this "CORBA::ORB" - // class must know how to create stringify/destringify their - // objrefs, as well as how to marshal and unmarshal them ... as well - // as provide their own QueryInterface. - int run (const ACE_Time_Value &tv); // This is the same as the more "standard" <run> method, except that // you don't need to put the & in front of <tv>. @@ -857,6 +848,10 @@ public: // Establish connectsion to each of the comma-separated // <{host}>:<{port}> combinations specified in <connections>. + // This class is intended to be inherited by others, which will + // provide some more of the CORBA support. Implementations of this + // "CORBA::ORB" class must know how to create stringify/destringify + // their objrefs, as well as how to marshal and unmarshal them. ULONG AddRef (void); ULONG Release (void); @@ -981,7 +976,6 @@ extern "C" TAO_Export const TAO_IID IID_CORBA_ServerRequest; extern "C" TAO_Export const TAO_IID IID_IIOP_ServerRequest; extern "C" TAO_Export const TAO_IID IID_STUB_Object; extern "C" TAO_Export const TAO_IID IID_IIOP_Object; -extern "C" TAO_Export const TAO_IID IID_IIOP_ORB; // NOTE: stub APIs are nonportable, and must be explicitly #included // by code emitted from an IDL compiler. diff --git a/TAO/tao/Object_Table.h b/TAO/tao/Object_Table.h index e1bd293d7ac..e99e404ee81 100644 --- a/TAO/tao/Object_Table.h +++ b/TAO/tao/Object_Table.h @@ -99,10 +99,10 @@ public: // Returns 0 if there is a servant for <id> in the table, <-1> // otherwise. - // @@ TODO check with Irfan the semantics of this method when more - // than one <id> is handled by the same servant. Also wonder if the - // "default" implementation (linear search on the iterator) makes - // sense, since the operation is (IMHO) not time critical. + // This method is only used with unique ids. Therefore, selecting + // the first match is ok. Also the "default" implementation (linear + // search on the iterator) makes sense, since the operation is not + // time critical. virtual int find (const PortableServer::Servant servant, PortableServer::ObjectId_out id); // Find the <id> for <servant>. @@ -182,10 +182,10 @@ public: // Returns 0 if there is a servant for <id> in the table, <-1> // otherwise. - // @@ TODO check with Irfan the semantics of this method when more - // than one <id> is handled by the same servant. Also wonder if the - // "default" implementation (linear search on the iterator) makes - // sense, since the operation is (IMHO) not time critical. + // This method is only used with unique ids. Therefore, selecting + // the first match is ok. Also the "default" implementation (linear + // search on the iterator) makes sense, since the operation is not + // time critical. int find (const PortableServer::Servant servant, PortableServer::ObjectId_out id); // Find the <id> for <servant>. diff --git a/TAO/tao/POAC.cpp b/TAO/tao/POAC.cpp index 7aeb207469a..e238c9fde54 100644 --- a/TAO/tao/POAC.cpp +++ b/TAO/tao/POAC.cpp @@ -11,7 +11,6 @@ #include "POAC.h" #include "POAS.h" -// @@ Irfan, should this be moved into the corba.h file? #if !defined (__ACE_INLINE__) #include "POAC.i" #endif // !defined INLINE diff --git a/TAO/tao/POAC.h b/TAO/tao/POAC.h index deaed2b9bbf..b93ce25bb58 100644 --- a/TAO/tao/POAC.h +++ b/TAO/tao/POAC.h @@ -7,9 +7,6 @@ // Information on TAO is available at // http://www.cs.wustl.edu/~schmidt/TAO.html -// @@ Irfan, please zap ALL of the "generated" stubs/skeletons from -// TAO since we don't want to increase the code size! - #if !defined (TAO_IDL_POAC_H) #define TAO_IDL_POAC_H diff --git a/TAO/tao/POAS.cpp b/TAO/tao/POAS.cpp index 0d04283f4aa..9d389a545df 100644 --- a/TAO/tao/POAS.cpp +++ b/TAO/tao/POAS.cpp @@ -8,7 +8,6 @@ #include "tao/corba.h" #include "POAS.h" -// @@ Irfan, should this be moved into the corba.h file? #if !defined (__ACE_INLINE__) #include "POAS.i" #endif // !defined INLINE diff --git a/TAO/tao/Servant_Base.cpp b/TAO/tao/Servant_Base.cpp index 1b2b865c7c7..5a5855d3586 100644 --- a/TAO/tao/Servant_Base.cpp +++ b/TAO/tao/Servant_Base.cpp @@ -83,7 +83,8 @@ TAO_ServantBase::_create_stub (CORBA_Environment &env) TAO_ORB_Core *orb_core = TAO_ORB_Core_instance (); TAO_POA_Current *poa_current = orb_core->poa_current (); - if (poa_current + + if (poa_current != 0 && poa_current->in_upcall () && this == poa_current->servant ()) { @@ -159,8 +160,7 @@ TAO_DynamicImplementation::_create_stub (CORBA::Environment &env) // exception. TAO_ORB_Core *orb_core = TAO_ORB_Core_instance (); TAO_POA_Current *poa_current = orb_core->poa_current (); - // @@ Irfan, I'm not sure that I did the right thing here...please - // double-check my logic! (cjc) + if (poa_current == 0 || !poa_current->in_upcall () || this != poa_current->servant ()) diff --git a/TAO/tao/TAO.cpp b/TAO/tao/TAO.cpp index b2dd66291ac..dd6f82e0538 100644 --- a/TAO/tao/TAO.cpp +++ b/TAO/tao/TAO.cpp @@ -101,14 +101,12 @@ TAO_ORB_Manager::init_child_poa (int argc, policies[0] = this->poa_->create_id_assignment_policy (PortableServer::USER_ID, env); - // @@ Must destroy the policies created to avoid memory leaks! TAO_CHECK_ENV_RETURN (env, -1); // Lifespan policy policies[1] = this->poa_->create_lifespan_policy (PortableServer::PERSISTENT, env); - // @@ Must destroy the policies created to avoid memory leaks! TAO_CHECK_ENV_RETURN (env, -1); // We use a different POA, otherwise the user would have to change @@ -119,7 +117,7 @@ TAO_ORB_Manager::init_child_poa (int argc, this->poa_manager_.in (), policies, env); - // @@ Warning! If create_POA fails, then the policies won't be + // Warning! If create_POA fails, then the policies won't be // destroyed and there will be hell to pay in memory leaks! TAO_CHECK_ENV_RETURN (env, -1); diff --git a/TAO/tao/decode.cpp b/TAO/tao/decode.cpp index 42d77a3c1cc..91be0d50391 100644 --- a/TAO/tao/decode.cpp +++ b/TAO/tao/decode.cpp @@ -607,18 +607,11 @@ TAO_Marshal_ObjRef::decode (CORBA::TypeCode_ptr, str.setup_encapsulation (ACE_reinterpret_cast(char*,buf), tmp); - // @@ Does IIOP_Object duplicate 'type_hint' below so - // that we can safely free it? It does now! + // Ownership of type_hint is given to IIOP_Object ACE_NEW_RETURN (objdata, IIOP_Object (type_hint), CORBA::TypeCode::TRAVERSE_STOP); - // @@ The IIOP_Object created here has a String_var - // member to keep the string, this member is constructed using - // type_hint, at that time a plain (char*). Hence the string - // is *not* copied and it cannot be released, so the following - // line is commented out: CORBA::string_free (type_hint); - IIOP::Profile *profile = &objdata->profile; // Read and verify major, minor versions, ignoring IIOP @@ -1091,9 +1084,8 @@ TAO_Marshal_Sequence::decode (CORBA::TypeCode_ptr tc, // Allocate the buffer using the virtual // _allocate_buffer method, hence the right // constructors are invoked and size for the array - // is OK. @@ Who will free this memory? (coryan): - // the sequence will release it, since its release_ - // field is 1. + // is OK. The sequence will release it, since its + // release_ field is 1. seq->_allocate_buffer (bounds); value = (char *) seq->buffer_; diff --git a/TAO/tao/tao_util.cpp b/TAO/tao/tao_util.cpp deleted file mode 100644 index 43b53588c88..00000000000 --- a/TAO/tao/tao_util.cpp +++ /dev/null @@ -1,236 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// tao -// -// = FILENAME -// tao_util.cpp -// -// = AUTHOR -// Sumedh Mungee <sumedh@cs.wustl.edu> -// -// ============================================================================ - -#include "tao_util.h" - -// constructor -TAO_ORB_Manager::TAO_ORB_Manager (CORBA::ORB_ptr orb, - PortableServer::POA_ptr poa, - PortableServer::POAManager_ptr poa_manager) - : orb_ (orb), - poa_ (poa), - poa_manager_ (poa_manager) -{ -} - -// Initialize the ORB, using the supplied command line arguments. the -// poa_name is a user-supplied string that is used to name the POA -// created. -int -TAO_ORB_Manager::init (int argc, - char **argv, - CORBA::Environment &env) -{ - if (CORBA::is_nil (this->orb_.in ())) - { - this->orb_ = CORBA::ORB_init (argc, - argv, - 0, - env); - TAO_CHECK_ENV_RETURN (env, -1); - } - - if (CORBA::is_nil (this->poa_.in ())) - { - // Get the POA from the ORB. - CORBA::Object_var poa_object = - this->orb_->resolve_initial_references ("RootPOA"); - - if (CORBA::is_nil (poa_object.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Unable to initialize the POA.\n"), - -1); - - // Get the POA object. - this->poa_ = - PortableServer::POA::_narrow (poa_object.in (), - env); - - TAO_CHECK_ENV_RETURN (env, -1); - } - - if (CORBA::is_nil (this->poa_manager_.in ())) - { - // Get the POA_Manager. - this->poa_manager_ = - this->poa_->the_POAManager (env); - - TAO_CHECK_ENV_RETURN (env, -1); - } - - return 0; -} - -// Initialize the child poa. - -int -TAO_ORB_Manager::init_child_poa (int argc, - char **argv, - char *poa_name, - CORBA_Environment &env) -{ - int init_result; - - // check to see if root poa has to be created. - init_result = this->init (argc, argv, env); - - if (init_result == -1) - ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Error in init.\n"), - -1); - - // Create the default policies - user-supplied ID, and persistent - // objects. - // CORBA::PolicyList policies (2); - PortableServer::PolicyList policies (2); - policies.length (2); - - // Id Assignment policy - policies[0] = - this->poa_->create_id_assignment_policy (PortableServer::USER_ID, - env); - // @@ Must destroy the policies created to avoid memory leaks! - TAO_CHECK_ENV_RETURN (env, -1); - - // Lifespan policy - policies[1] = - this->poa_->create_lifespan_policy (PortableServer::PERSISTENT, - env); - // @@ Must destroy the policies created to avoid memory leaks! - TAO_CHECK_ENV_RETURN (env, -1); - - // We use a different POA, otherwise the user would have to change - // the object key each time it invokes the server. - - this->child_poa_ = - this->poa_->create_POA (poa_name, - this->poa_manager_.in (), - policies, - env); - // @@ Warning! If create_POA fails, then the policies won't be - // destroyed and there will be hell to pay in memory leaks! - TAO_CHECK_ENV_RETURN (env, -1); - - // Creation of the new POAs over, so destroy the Policy_ptr's. - for (CORBA::ULong i = 0; - i < policies.length () && env.exception () == 0; - ++i) - { - // CORBA::Policy_ptr policy = policies[i]; - PortableServer::Policy_ptr policy = policies[i]; - policy->destroy (env); - } - TAO_CHECK_ENV_RETURN (env, -1); - - return 0; -} - -// Activate servant in the POA. - -CORBA::String -TAO_ORB_Manager::activate (PortableServer::Servant servant, - CORBA_Environment &env) -{ - PortableServer::ObjectId_var id = - this->poa_->activate_object (servant, - env); - TAO_CHECK_ENV_RETURN (env, 0); - - CORBA::Object_var obj = - this->poa_->id_to_reference (id.in (), - env); - TAO_CHECK_ENV_RETURN (env, 0); - - CORBA::String str = - this->orb_->object_to_string (obj.in (), - env); - TAO_CHECK_ENV_RETURN (env, 0); - - return str; -} - -// Activate the object with the object_name under the child POA. - -CORBA::String -TAO_ORB_Manager::activate_under_child_poa (const char* object_name, - PortableServer::Servant servant, - CORBA_Environment& env) -{ - if (object_name == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "\n(%P|%t) TAO_ORB_Manager::register: " - "object_name is null!"), - 0); - - PortableServer::ObjectId_var id = - PortableServer::string_to_ObjectId (object_name); - - this->child_poa_->activate_object_with_id (id.in (), - servant, - env); - TAO_CHECK_ENV_RETURN (env, 0); - - CORBA::Object_var obj = - this->child_poa_->id_to_reference (id.in (), - env); - TAO_CHECK_ENV_RETURN (env, 0); - - CORBA::String str = - this->orb_->object_to_string (obj.in (), - env); - - TAO_CHECK_ENV_RETURN (env, 0); - - return str; -} - -// Enter the ORB event loop. - -int -TAO_ORB_Manager::run (CORBA_Environment &env, - ACE_Time_Value *tv) -{ - this->poa_manager_->activate (env); - - TAO_CHECK_ENV_RETURN (env, -1); - - if (this->orb_->run (tv) == -1) - ACE_ERROR_RETURN ( (LM_ERROR, - "%p\n", - "run"), - -1); - - TAO_CHECK_ENV_RETURN (env, -1); - return 0; -} - -// Return the corba orb reference. - -CORBA::ORB_ptr -TAO_ORB_Manager::orb (void) -{ - return CORBA_ORB::_duplicate (this->orb_.in ()); -} - -// Destructor. - -TAO_ORB_Manager::~TAO_ORB_Manager (void) -{ - CORBA::Environment env; - if (CORBA::is_nil (this->poa_.in ()) == 0) - this->poa_->destroy (CORBA::B_TRUE, - CORBA::B_TRUE, - env); -} |