diff options
-rw-r--r-- | TAO/ChangeLog-99c | 25 | ||||
-rw-r--r-- | TAO/performance-tests/Cubit/TAO/MT_Cubit/Cubit_Task.cpp | 36 | ||||
-rw-r--r-- | TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp | 3 | ||||
-rw-r--r-- | TAO/performance-tests/Cubit/TAO/MT_Cubit/cubit_i.cpp | 20 | ||||
-rw-r--r-- | TAO/performance-tests/Cubit/TAO/MT_Cubit/cubit_i.h | 10 | ||||
-rw-r--r-- | TAO/tao/Exception.cpp | 16 | ||||
-rw-r--r-- | TAO/tao/Exception.h | 6 | ||||
-rw-r--r-- | TAO/tao/IIOP_Acceptor.cpp | 39 | ||||
-rw-r--r-- | TAO/tao/IIOP_Connector.cpp | 1 | ||||
-rw-r--r-- | TAO/tao/Invocation.cpp | 42 |
10 files changed, 156 insertions, 42 deletions
diff --git a/TAO/ChangeLog-99c b/TAO/ChangeLog-99c index 8493754c4c7..4162d852fd5 100644 --- a/TAO/ChangeLog-99c +++ b/TAO/ChangeLog-99c @@ -1,3 +1,28 @@ +Mon Jun 7 16:13:31 1999 Carlos O'Ryan <coryan@cs.wustl.edu> + + * tao/Exception.h: + * tao/Exception.cpp: + * tao/Invocation.cpp: + The system exceptions were not beign demarshaled on the server + side. + Fixed the signature of TAO_Exceptions::create_system_exception, + it was returning a CORBA::Exception* but a + CORBA::SystemException* was better. + + * tao/IIOP_Acceptor.cpp: + * tao/IIOP_Connector.cpp: + Added a few debugging messages if there is an error. + + * performance-tests/Cubit/TAO/MT_Cubit/cubit_i.h: + * performance-tests/Cubit/TAO/MT_Cubit/cubit_i.cpp: + * performance-tests/Cubit/TAO/MT_Cubit/Cubit_Task.cpp: + * performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp: + The Cubit_i objects were activated with the _default_POA(), but + that was not overriden, hence they were using the + default/_default_POA which is the RootPOA of the default ORB. + There was also an activation under a child POA but that was not + exported through the IORs printed to the file. + Mon Jun 07 15:14:47 1999 David L. Levine <levine@cs.wustl.edu> * utils/catior/catior.cpp (cat_iiop_profile): added missing diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Cubit_Task.cpp b/TAO/performance-tests/Cubit/TAO/MT_Cubit/Cubit_Task.cpp index 3aa4eab173c..8c3e86a1c90 100644 --- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Cubit_Task.cpp +++ b/TAO/performance-tests/Cubit/TAO/MT_Cubit/Cubit_Task.cpp @@ -153,8 +153,17 @@ Cubit_Task::get_servant_ior (u_int index) int Cubit_Task::create_servants (void) { - TAO_TRY + ACE_TRY_NEW_ENV { + CORBA::Object_var obj = + this->orb_->resolve_initial_references ("RootPOA", + ACE_TRY_ENV); + ACE_TRY_CHECK; + + PortableServer::POA_var poa = + PortableServer::POA::_narrow (obj.in (), ACE_TRY_ENV); + ACE_TRY_CHECK; + // Create the array of cubit implementations. ACE_NEW_RETURN (this->servants_, Cubit_i *[this->num_of_objs_], @@ -186,7 +195,8 @@ Cubit_Task::create_servants (void) this->task_id_); ACE_NEW_RETURN (this->servants_[i], - Cubit_i (this->orb_.in ()), + Cubit_i (this->orb_.in (), + poa.in ()), -1); if (this->servants_[i] == 0) @@ -196,24 +206,19 @@ Cubit_Task::create_servants (void) i), 2); - this->orb_manager_.activate_under_child_poa - (buffer, - this->servants_[i], - TAO_TRY_ENV); - TAO_CHECK_ENV; - // Stringify the objref we'll be implementing, and print it // to stdout. Someone will take that string and give it to // some client. Then release the object. Cubit_var cubit = - this->servants_[i]->_this (TAO_TRY_ENV); - TAO_CHECK_ENV; + this->servants_[i]->_this (ACE_TRY_ENV); + ACE_TRY_CHECK; + CORBA::String_var str = this->orb_->object_to_string (cubit.in (), - TAO_TRY_ENV); - TAO_CHECK_ENV; + ACE_TRY_ENV); + ACE_TRY_CHECK; this->servants_iors_[i] = ACE_OS::strdup (str.in ()); @@ -221,11 +226,12 @@ Cubit_Task::create_servants (void) delete [] buffer; } - TAO_CATCHANY + ACE_CATCHANY { - TAO_TRY_ENV.print_exception ("print IOR"); + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, + "Cubit_Task::create_servants"); return -1; } - TAO_ENDTRY; + ACE_ENDTRY; return 0; } diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp b/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp index 6074ebeb323..35343a6c0d1 100644 --- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp +++ b/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp @@ -263,7 +263,8 @@ Client::Client (ACE_Thread_Manager *thread_manager, char **argv, u_int id) : ACE_Task<ACE_SYNCH> (thread_manager), - cubit_impl_ (0), + cubit_impl_ (CORBA::ORB::_nil (), + PortableServer::POA::_nil ()), ts_ (ts), num_ (0), id_ (id), diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/cubit_i.cpp b/TAO/performance-tests/Cubit/TAO/MT_Cubit/cubit_i.cpp index a5dfc6bcf11..818fba8d284 100644 --- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/cubit_i.cpp +++ b/TAO/performance-tests/Cubit/TAO/MT_Cubit/cubit_i.cpp @@ -6,8 +6,10 @@ ACE_RCSID(MT_Cubit, cubit_i, "$Id$") -Cubit_i::Cubit_i (CORBA::ORB_ptr orb) - :orb_ (CORBA::ORB::_duplicate (orb)) +Cubit_i::Cubit_i (CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa) + : orb_ (CORBA::ORB::_duplicate (orb)), + poa_ (PortableServer::POA::_duplicate (poa)) { } @@ -36,7 +38,7 @@ Cubit_i::cube_long (CORBA::Long l, return (CORBA::Long) (l * l * l); } -Cubit::Many +Cubit::Many Cubit_i::cube_struct (const Cubit::Many &values, CORBA::Environment &) { @@ -49,7 +51,7 @@ Cubit_i::cube_struct (const Cubit::Many &values, return out_values; } -void +void Cubit_i::noop (CORBA::Environment &) { // does nothing. @@ -57,7 +59,13 @@ Cubit_i::noop (CORBA::Environment &) void Cubit_i::shutdown (CORBA::Environment &) { - ACE_DEBUG ((LM_DEBUG, - "(%t) Calling orb ()->shutdown ()\n")); + ACE_DEBUG ((LM_DEBUG, + "(%t) Calling orb ()->shutdown ()\n")); this->orb_->shutdown (); } + +PortableServer::POA_ptr +Cubit_i::_default_POA (CORBA::Environment &) +{ + return PortableServer::POA::_duplicate (this->poa_.in ()); +} diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/cubit_i.h b/TAO/performance-tests/Cubit/TAO/MT_Cubit/cubit_i.h index c8292d754f2..6ca11a8254f 100644 --- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/cubit_i.h +++ b/TAO/performance-tests/Cubit/TAO/MT_Cubit/cubit_i.h @@ -25,7 +25,8 @@ class Cubit_i : public POA_Cubit // Cubit implementation class. public: // = Initialization and termination methods. - Cubit_i (CORBA::ORB_ptr orb); + Cubit_i (CORBA::ORB_ptr orb, + PortableServer::POA_ptr poa); ~Cubit_i (void); virtual CORBA::Octet cube_octet (CORBA::Octet o, @@ -44,9 +45,16 @@ public: virtual void shutdown (CORBA::Environment &env); + virtual PortableServer::POA_ptr + _default_POA (CORBA::Environment &ACE_TRY_ENV); + // The default POA + protected: CORBA::ORB_var orb_; // Keep a pointer to the ORB so we can shut it down. + + PortableServer::POA_var poa_; + // The default POA.. }; #endif /* _CUBIT_I_H */ diff --git a/TAO/tao/Exception.cpp b/TAO/tao/Exception.cpp index 7d9efbaea52..105dafa4240 100644 --- a/TAO/tao/Exception.cpp +++ b/TAO/tao/Exception.cpp @@ -96,7 +96,7 @@ CORBA_Exception::print_exception (const char *info, { const char *id = this->_id (); - ACE_DEBUG ((LM_ERROR, + ACE_DEBUG ((LM_ERROR, "(%P|%t) EXCEPTION, %s\n", info)); @@ -234,7 +234,7 @@ CORBA_SystemException::_raise (void) CORBA::ULong CORBA_SystemException::errno_tao_ (int errno_value) { - switch (errno_value) + switch (errno_value) { case 0: return TAO_UNSPECIFIED_MINOR_CODE; @@ -258,8 +258,8 @@ CORBA_SystemException::minor_code_tao_ (u_int location, int errno_value) { return - TAO_DEFAULT_MINOR_CODE - | location + TAO_DEFAULT_MINOR_CODE + | location | errno_tao_ (errno_value); } @@ -276,13 +276,13 @@ CORBA_SystemException::print_exception_tao_ (FILE *) const "(%P|%t) system exception, ID '%s'\n", _id ())); - CORBA::ULong VMCID = + CORBA::ULong VMCID = this->minor () & 0xFFFFF000u; if (VMCID == TAO_DEFAULT_MINOR_CODE) { const char *location; - switch (this->minor () & 0x00000FF0u) + switch (this->minor () & 0x00000FF0u) { case TAO_INVOCATION_CONNECT_MINOR_CODE : location = "invocation connect failed"; @@ -310,7 +310,7 @@ CORBA_SystemException::print_exception_tao_ (FILE *) const } const char *errno_indication; - switch (this->minor () & 0x0000000Fu) + switch (this->minor () & 0x0000000Fu) { case TAO_UNSPECIFIED_MINOR_CODE : errno_indication = "unspecified errno"; @@ -637,7 +637,7 @@ TAO_Exceptions::init (CORBA::Environment &ACE_TRY_ENV) ACE_TRY_ENV); } -CORBA_Exception * +CORBA_SystemException * TAO_Exceptions::create_system_exception (const char *id, CORBA::Environment &ACE_TRY_ENV) { diff --git a/TAO/tao/Exception.h b/TAO/tao/Exception.h index d203de82f36..213ce34a3ca 100644 --- a/TAO/tao/Exception.h +++ b/TAO/tao/Exception.h @@ -325,8 +325,10 @@ public: static void fini (void); // Runtime finalization of all standard exception typecodes. - static CORBA_Exception *create_system_exception (const char *id, - CORBA_Environment &TAO_IN_ENV = TAO_default_environment ()); + static CORBA_SystemException * + create_system_exception (const char *id, + CORBA_Environment &TAO_IN_ENV = + TAO_default_environment ()); // Create a CORBA::SystemException given the interface repository // ID. diff --git a/TAO/tao/IIOP_Acceptor.cpp b/TAO/tao/IIOP_Acceptor.cpp index e02eea95a31..f3d52cdfe6c 100644 --- a/TAO/tao/IIOP_Acceptor.cpp +++ b/TAO/tao/IIOP_Acceptor.cpp @@ -133,31 +133,56 @@ TAO_IIOP_Acceptor::open_i (TAO_ORB_Core* orb_core, const ACE_INET_Addr& addr) { if (this->base_acceptor_.open (orb_core, addr) == -1) - return -1; + { + if (TAO_debug_level > 0) + ACE_DEBUG ((LM_DEBUG, + "\n\nTAO (%P|%t) IIOP_Acceptor::open_i - %p\n\n", + "cannot open acceptor")); + return -1; + } // @@ Should this be a catastrophic error??? if (this->base_acceptor_.acceptor ().get_local_addr (this->address_) != 0) - return -1; + { + if (TAO_debug_level > 0) + ACE_DEBUG ((LM_DEBUG, + "\n\nTAO (%P|%t) IIOP_Acceptor::open_i - %p\n\n", + "cannot get local addr")); + return -1; + } if (orb_core->orb_params ()->use_dotted_decimal_addresses ()) { const char *tmp; if ((tmp = addr.get_host_addr ()) == 0) - return -1; + { + if (TAO_debug_level > 0) + ACE_DEBUG ((LM_DEBUG, + "\n\nTAO (%P|%t) IIOP_Acceptor::open_i - %p\n\n", + "cannot cache hostname")); + return -1; + } this->host_ = tmp; } else { char tmp_host[MAXHOSTNAMELEN+1]; - if (addr.get_host_name (tmp_host, sizeof(tmp_host)) != 0) - return -1; - this->host_ = tmp_host; + if (addr.get_host_name (tmp_host, sizeof(tmp_host)) != 0) + { + if (TAO_debug_level > 0) + ACE_DEBUG ((LM_DEBUG, + "\n\nTAO (%P|%t) IIOP_Acceptor::open_i - %p\n\n", + "cannot cache hostname")); + return -1; + } + this->host_ = tmp_host; } if (TAO_debug_level > 5) { ACE_DEBUG ((LM_DEBUG, - "TAO (%P|%t) listening on: <%s:%u>\n", + "\n\nTAO (%P|%t) IIOP_Acceptor::open_i - %p\n\n", + "listening on: <%s:%u>\n", this->host_.c_str (), this->address_.get_port_number ())); } diff --git a/TAO/tao/IIOP_Connector.cpp b/TAO/tao/IIOP_Connector.cpp index bde6aa8e298..867af250af4 100644 --- a/TAO/tao/IIOP_Connector.cpp +++ b/TAO/tao/IIOP_Connector.cpp @@ -120,6 +120,7 @@ TAO_IIOP_Connector::connect (TAO_Profile *profile, // object; but we obtain the transport in the <result> // variable. Other threads may modify the hint, but we are not // affected. + errno = 0; if (this->base_connector_.connect (iiop_profile->hint (), result, oa) == -1) diff --git a/TAO/tao/Invocation.cpp b/TAO/tao/Invocation.cpp index d6c963dd976..947b8c845b0 100644 --- a/TAO/tao/Invocation.cpp +++ b/TAO/tao/Invocation.cpp @@ -717,8 +717,46 @@ TAO_GIOP_Twoway_Invocation::invoke_i (CORBA::Environment &ACE_TRY_ENV) case TAO_GIOP_SYSTEM_EXCEPTION: { - // Demarshal the system exception and raise it! - return TAO_INVOKE_EXCEPTION; + // @@ Add the location macros for this exceptions... + + CORBA::String_var type_id; + if ((this->inp_stream_ >> type_id.inout ()) == 0) + { + // Could not demarshal the exception id, raise an local + // CORBA::MARSHAL + ACE_THROW_RETURN (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE, + CORBA::COMPLETED_MAYBE), + TAO_INVOKE_OK); + } + CORBA::ULong minor = 0; + CORBA::ULong completion = 0; + if ((this->inp_stream_ >> minor) == 0 + || (this->inp_stream_ >> completion) == 0) + ACE_THROW_RETURN (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE, + CORBA::COMPLETED_MAYBE), + TAO_INVOKE_OK); + + CORBA::SystemException* ex = + TAO_Exceptions::create_system_exception (type_id.in (), + ACE_TRY_ENV); + ACE_CHECK_RETURN (TAO_INVOKE_OK); + + if (ex == 0) + { + // @@ We should raise a CORBA::NO_MEMORY, but we ran out + // of memory already. We need a pre-allocated, TSS, + // CORBA::NO_MEMORY instance + ACE_NEW_RETURN (ex, CORBA::UNKNOWN, TAO_INVOKE_EXCEPTION); + } + ex->minor (minor); + ex->completed (CORBA::CompletionStatus (completion)); + + + // @@ There should be a better way to raise this exception! + // This code works for both native and emulated exceptions, + // but it is ugly. + ACE_TRY_ENV.exception (ex); + return TAO_INVOKE_OK; } // NOTREACHED. |