diff options
-rw-r--r-- | TAO/ChangeLogs/ChangeLog-02a | 73 | ||||
-rw-r--r-- | TAO/tao/ClientRequestInfo.cpp | 26 | ||||
-rw-r--r-- | TAO/tao/Exception.cpp | 46 | ||||
-rw-r--r-- | TAO/tao/IORInfo.cpp | 5 | ||||
-rw-r--r-- | TAO/tao/Invocation.cpp | 6 | ||||
-rw-r--r-- | TAO/tao/Invocation_Endpoint_Selectors.cpp | 10 | ||||
-rw-r--r-- | TAO/tao/LocalObject.cpp | 57 | ||||
-rw-r--r-- | TAO/tao/LocalObject.h | 113 | ||||
-rw-r--r-- | TAO/tao/LocalObject.i | 54 | ||||
-rw-r--r-- | TAO/tao/ORB.cpp | 36 | ||||
-rw-r--r-- | TAO/tao/Object.h | 3 | ||||
-rw-r--r-- | TAO/tao/Object_Ref_Table.cpp | 6 | ||||
-rw-r--r-- | TAO/tao/PolicyFactory_Registry.cpp | 2 | ||||
-rw-r--r-- | TAO/tao/RT_Invocation_Endpoint_Selectors.cpp | 20 | ||||
-rw-r--r-- | TAO/tao/corbafwd.h | 35 | ||||
-rw-r--r-- | TAO/tao/orb.idl | 9 |
16 files changed, 296 insertions, 205 deletions
diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a index 9d7a0e435ff..cb0345cde1c 100644 --- a/TAO/ChangeLogs/ChangeLog-02a +++ b/TAO/ChangeLogs/ChangeLog-02a @@ -1,3 +1,76 @@ +Thu May 24 16:34:37 2001 Ossama Othman <ossama@uci.edu> + + * tao/corbafwd.h: + + Removed the TAO_INVOCATION_CONNECT_MINOR_CODE location minor + code. There is already an OMG assigned minor code used for the + same type of problem. + + * tao/orb.idl: + + Added the CORBA::ParameterMode enumeration to this IDL file. + For some reason it was never defined. + + * tao/Exception.cpp: + + Updated CORBA::SystemException minor code descriptions. + + * tao/ClientRequestInfo.cpp: + * tao/IORInfo.cpp (add_ior_component_to_profile): + * tao/Object_Ref_Table.cpp (register_initial_reference): + * tao/PolicyFactory_Registry.cpp (register_policy_factory): + + Updated all exception minor codes. They were changed in the + latest Portable Interceptor draft spec. + + * tao/Invocation_Endpoint_Selectors.cpp (select_endpoint): + * tao/RT_Invocation_Endpoint_Selectors.cpp (select_endpoint): + + Removed all uses of the TAO_INVOCATION_CONNECT_MINOR_CODE + location minor code. Use the OMG assigned minor code (2) + instead. + + * tao/Invocation.cpp (invoke): + + Added the OMG assigned minor code to the thrown CORBA::UNKNOWN + system exception. This exception is thrown when an unknown user + exception occurs during an invocation. + + * tao/LocalObject.cpp (_create_request, _request): + + Added OMG assigned minor codes to the thrown CORBA::NO_IMPLEMENT + exceptions. + + (_get_interface): + + According to the CCM spec, this method should throw a + CORBA::NO_IMPLEMENT exception when invoked on a local object. + + * tao/LocalObject.h: + + Doxygenated this header. + + (_key): + + Removed unnecessary default CORBA::Environment argument. + + * tao/LocalObject.i: + + Cosmetic updates. + + * tao/ORB.cpp (object_to_string): + + Throw a CORBA::MARSHAL exception if the given object to + stringify is a locality constrained object. + + When creating a URL IOR, do not use the profile currently in + use. Use the very first one in the profile list associated with + the given object. + + * tao/Object.h (_key): + + Removed unneccessary default CORBA::Environment argument. + Thu May 24 18:31:53 2001 Jeff Parsons <parsons@cs.wustl.edu> * performance-tests/POA/Implicit_Activation/Test.idl: diff --git a/TAO/tao/ClientRequestInfo.cpp b/TAO/tao/ClientRequestInfo.cpp index 2e3aab087b5..8dab949ae98 100644 --- a/TAO/tao/ClientRequestInfo.cpp +++ b/TAO/tao/ClientRequestInfo.cpp @@ -85,7 +85,7 @@ TAO_ClientRequestInfo::received_exception (CORBA::Environment &ACE_TRY_ENV) if (this->reply_status_ != PortableInterceptor::SYSTEM_EXCEPTION && this->reply_status_ != PortableInterceptor::USER_EXCEPTION) { - ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (TAO_OMG_VMCID | 10, + ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (TAO_OMG_VMCID | 14, CORBA::COMPLETED_NO), 0); } @@ -129,7 +129,7 @@ TAO_ClientRequestInfo::received_exception_id ( if (this->reply_status_ != PortableInterceptor::SYSTEM_EXCEPTION && this->reply_status_ != PortableInterceptor::USER_EXCEPTION) { - ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (TAO_OMG_VMCID | 10, + ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (TAO_OMG_VMCID | 14, CORBA::COMPLETED_NO), 0); } @@ -177,7 +177,7 @@ TAO_ClientRequestInfo::get_effective_component ( // No tagged component was found that matched the given // IOP::ComponentId. - ACE_THROW_RETURN (CORBA::BAD_PARAM (TAO_OMG_VMCID | 25, + ACE_THROW_RETURN (CORBA::BAD_PARAM (TAO_OMG_VMCID | 28, CORBA::COMPLETED_NO), 0); } @@ -229,7 +229,7 @@ TAO_ClientRequestInfo::get_effective_components ( // No tagged component sequence was allocated, meaning no tagged // components were found that matched the given // IOP::ComponentId. - ACE_THROW_RETURN (CORBA::BAD_PARAM (TAO_OMG_VMCID | 25, + ACE_THROW_RETURN (CORBA::BAD_PARAM (TAO_OMG_VMCID | 28, CORBA::COMPLETED_NO), 0); } @@ -272,7 +272,7 @@ TAO_ClientRequestInfo::add_request_service_context ( if (service_context_list.set_context (service_context, replace) == 0) { - ACE_THROW (CORBA::BAD_INV_ORDER (TAO_OMG_VMCID | 11, + ACE_THROW (CORBA::BAD_INV_ORDER (TAO_OMG_VMCID | 15, CORBA::COMPLETED_NO)); } } @@ -368,7 +368,7 @@ Dynamic::ParameterList * TAO_ClientRequestInfo::arguments (CORBA::Environment &ACE_TRY_ENV) ACE_THROW_SPEC ((CORBA::SystemException)) { - ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (TAO_OMG_VMCID | 10, + ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (TAO_OMG_VMCID | 14, CORBA::COMPLETED_NO), 0); } @@ -377,7 +377,7 @@ Dynamic::ExceptionList * TAO_ClientRequestInfo::exceptions (CORBA::Environment &ACE_TRY_ENV) ACE_THROW_SPEC ((CORBA::SystemException)) { - ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (TAO_OMG_VMCID | 10, + ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (TAO_OMG_VMCID | 14, CORBA::COMPLETED_NO), 0); } @@ -386,7 +386,7 @@ Dynamic::ContextList * TAO_ClientRequestInfo::contexts (CORBA::Environment &ACE_TRY_ENV) ACE_THROW_SPEC ((CORBA::SystemException)) { - ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (TAO_OMG_VMCID | 10, + ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (TAO_OMG_VMCID | 14, CORBA::COMPLETED_NO), 0); } @@ -395,7 +395,7 @@ Dynamic::RequestContext * TAO_ClientRequestInfo::operation_context (CORBA::Environment &ACE_TRY_ENV) ACE_THROW_SPEC ((CORBA::SystemException)) { - ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (TAO_OMG_VMCID | 10, + ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (TAO_OMG_VMCID | 14, CORBA::COMPLETED_NO), 0); } @@ -404,7 +404,7 @@ CORBA::Any * TAO_ClientRequestInfo::result (CORBA::Environment &ACE_TRY_ENV) ACE_THROW_SPEC ((CORBA::SystemException)) { - ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (TAO_OMG_VMCID | 10, + ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (TAO_OMG_VMCID | 14, CORBA::COMPLETED_NO), 0); } @@ -434,7 +434,7 @@ TAO_ClientRequestInfo::sync_scope (CORBA::Environment &ACE_TRY_ENV) if (inv != 0 && this->response_expected_ == 0) return inv->sync_scope (); - ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (TAO_OMG_VMCID | 10, + ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (TAO_OMG_VMCID | 14, CORBA::COMPLETED_NO), -1); } @@ -446,7 +446,7 @@ TAO_ClientRequestInfo::reply_status (CORBA::Environment &ACE_TRY_ENV) { if (this->reply_status_ == -1) // A reply hasn't been received yet. - ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (TAO_OMG_VMCID | 10, + ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (TAO_OMG_VMCID | 14, CORBA::COMPLETED_NO), -1); @@ -458,7 +458,7 @@ TAO_ClientRequestInfo::forward_reference (CORBA::Environment &ACE_TRY_ENV) ACE_THROW_SPEC ((CORBA::SystemException)) { if (this->reply_status_ != PortableInterceptor::LOCATION_FORWARD) - ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (TAO_OMG_VMCID | 10, + ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (TAO_OMG_VMCID | 14, CORBA::COMPLETED_NO), CORBA::Object::_nil ()); diff --git a/TAO/tao/Exception.cpp b/TAO/tao/Exception.cpp index 7cf9aab2b7f..3b05e85d58f 100644 --- a/TAO/tao/Exception.cpp +++ b/TAO/tao/Exception.cpp @@ -408,9 +408,6 @@ CORBA_SystemException::_info (void) const const char *location; switch (this->minor () & 0x00000F80u) { - case TAO_INVOCATION_CONNECT_MINOR_CODE: - location = "invocation connect failed"; - break; case TAO_INVOCATION_LOCATION_FORWARD_MINOR_CODE: location = "location forward failed"; break; @@ -644,20 +641,25 @@ CORBA_SystemException::_tao_get_omg_exception_description ( "Supplied discriminator type illegitimate in create_union_tc.", // 20 "Any passed to ServerRequest::set_exception does not contain an exception.", // 21 "Unlisted user exception passed to ServerRequest::set_exception", // 22 - "Invalid service context ID in portable interceptor.", // 23 - "Attempt to call register_initial_reference with a null Object.", // 24 - "Invalid component ID in portable interceptor.", // 25 - "Invalid profile ID in portable interceptor." // 26 + "wchar transmission code set not in service context.", // 23 + "Service context is not in OMG-defined range.", // 24 + "Enum value out of range.", // 25 + "Invalid service context Id in portable interceptor.", // 26 + "Attempt to call register_initial_reference with a null Object.", // 27 + "Invalid component Id in portable interceptor.", // 28 + "Invalid profile Id in portable interceptor.", // 29 + "Two or more Policy objects with the same PolicyType value supplied to Object::set_policy_overrides or PolicyManager::set_policy_overrides." // 30 }; static const char *IMP_LIMIT_TABLE[] = - { + { "Unable to use any profile in IOR." // 1 }; static const char *INV_OBJREF_TABLE[] = { - "wchar Code Set support not specified." // 1 + "wchar Code Set support not specified.", // 1 + "Codeset component required for type using wchar or wstring data." // 2 }; static const char *MARSHAL_TABLE[] = @@ -665,7 +667,9 @@ CORBA_SystemException::_tao_get_omg_exception_description ( "Unable to locate value factory.", // 1 "ServerRequest::set_result called before ServerRequest::ctx when the operation IDL contains a context clause.", // 2 "NVList passed to ServerRequest::arguments does not describe all parameters passed by client.", // 3 - "Attempt to marshal Local object." // 4 + "Attempt to marshal Local object.", // 4 + "wchar or wstring data erroneously sent by client over GIOP 1.0 connection.", // 5 + "wchar or wstring data erroneously returned by server over GIOP 1.0 connection." //6 }; static const char *BAD_TYPECODE_TABLE[] = @@ -698,15 +702,22 @@ CORBA_SystemException::_tao_get_omg_exception_description ( "ServerRequest::arguments called more than once or after a call to ServerRequest::set_exception.", // 7 "ServerRequest::ctx called more than once or before ServerRequest::arguments or after ServerRequest::ctx, ServerRequest::set_result or ServerRequest::set_exception.", // 8 "ServerRequest::result called more than once or before ServerRequest::arguments or after ServerRequest::set_result or ServerRequest::set_exception.", // 9 - "Invalid portable interceptor call", // 10 - "Service context add failed in portable interceptor because a service context with the given id already exists.", // 11 - "Registration of PolicyFactory failed because a factory already exists for the given type." // 12 + "Attempt to send a DII request after it was sent previously.", // 10 + "Attempt to poll a DII request or to retrieve its result before the request was sent.", // 11 + "Attempt to poll a DII request or to retrieve its result after the result was retrieved previously.", // 12 + "Attempt to poll a synchronous DII request or to retrieve results from a synchronous DII request.", // 13 + "Invalid portable interceptor call", // 14 + "Service context add failed in portable interceptor because a service context with the given id already exists.", // 15 + "Registration of PolicyFactory failed because a factory already exists for the given type.", // 16 + "POA cannot create POAs while undergoing destruction." // 17 }; static const char *TRANSIENT_TABLE[] = { - "Request discarded due to resource exhaustion in POA.", // 1 - "Request cancelled." // 2 + "Request discarded due to resource exhaustion in POA, or because POA is in discarding state.", // 1 + "No usable profile in IOR.", // 2 + "Request cancelled.", // 3 + "POA destroyed." // 4 }; static const char *OBJ_ADAPTER_TABLE[] = @@ -731,8 +742,9 @@ CORBA_SystemException::_tao_get_omg_exception_description ( static const char *INV_POLICY_TABLE[] = { - "Invalid PolicyType.", // 1 - "No PolicyFactory has been registered for the given PolicyType." // 2 + "Unable to reconcile IOR specified policy with the effective policy override." // 1 + "Invalid PolicyType.", // 2 + "No PolicyFactory has been registered for the given PolicyType." // 3 }; if (minor_code == 0) diff --git a/TAO/tao/IORInfo.cpp b/TAO/tao/IORInfo.cpp index 305ea12228e..ab7edb16ccb 100644 --- a/TAO/tao/IORInfo.cpp +++ b/TAO/tao/IORInfo.cpp @@ -97,7 +97,6 @@ TAO_IORInfo::add_ior_component_to_profile ( // supposed to throw a CORBA::BAD_PARAM exception if no profile // matched the given ProfileId. if (found_profile == 0) - ACE_THROW (CORBA::BAD_PARAM ( - TAO_OMG_VMCID | 26, - CORBA::COMPLETED_NO)); + ACE_THROW (CORBA::BAD_PARAM (TAO_OMG_VMCID | 29, + CORBA::COMPLETED_NO)); } diff --git a/TAO/tao/Invocation.cpp b/TAO/tao/Invocation.cpp index 098f46bea12..dee6244238c 100644 --- a/TAO/tao/Invocation.cpp +++ b/TAO/tao/Invocation.cpp @@ -942,7 +942,7 @@ TAO_GIOP_Twoway_Invocation::invoke (TAO_Exception_Data *excepts, // If we couldn't find the right exception, report it as // CORBA::UNKNOWN. - ACE_THROW_RETURN (CORBA::UNKNOWN (TAO_DEFAULT_MINOR_CODE, + ACE_THROW_RETURN (CORBA::UNKNOWN (TAO_OMG_VMCID | 1, CORBA::COMPLETED_YES), TAO_INVOKE_EXCEPTION); } @@ -1023,7 +1023,7 @@ TAO_GIOP_Oneway_Invocation::invoke (CORBA::Environment &ACE_TRY_ENV) // This kind of exception shouldn't happen with oneways, // but if it does, we turn it into a CORBA::UNKNOWN exception. - ACE_THROW_RETURN (CORBA::UNKNOWN (TAO_DEFAULT_MINOR_CODE, + ACE_THROW_RETURN (CORBA::UNKNOWN (TAO_OMG_VMCID | 1, CORBA::COMPLETED_YES), TAO_INVOKE_EXCEPTION); } @@ -1088,7 +1088,7 @@ TAO_GIOP_Locate_Request_Invocation::invoke (CORBA::Environment &ACE_TRY_ENV) // This kind of exception shouldn't happen with oneways, // but if it does, we turn it into a CORBA::UNKNOWN exception. - ACE_THROW_RETURN (CORBA::UNKNOWN (TAO_DEFAULT_MINOR_CODE, + ACE_THROW_RETURN (CORBA::UNKNOWN (TAO_OMG_VMCID | 1, CORBA::COMPLETED_YES), TAO_INVOKE_EXCEPTION); } diff --git a/TAO/tao/Invocation_Endpoint_Selectors.cpp b/TAO/tao/Invocation_Endpoint_Selectors.cpp index 00499063bcd..1cd29aa4127 100644 --- a/TAO/tao/Invocation_Endpoint_Selectors.cpp +++ b/TAO/tao/Invocation_Endpoint_Selectors.cpp @@ -64,10 +64,7 @@ TAO_Default_Endpoint_Selector::select_endpoint (TAO_GIOP_Invocation *invocation, // If we get here, we completely failed to find an endpoint selector // that we know how to use, so throw an exception. - ACE_THROW (CORBA::TRANSIENT ( - CORBA_SystemException::_tao_minor_code ( - TAO_INVOCATION_CONNECT_MINOR_CODE, - errno), + ACE_THROW (CORBA::TRANSIENT (TAO_OMG_VMCID | 2, CORBA::COMPLETED_NO)); } @@ -78,10 +75,7 @@ TAO_Default_Endpoint_Selector::next (TAO_GIOP_Invocation *, { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("This method is DEPRECATED!\n"))); // if (invocation->stub_->next_profile_retry () == 0) - // ACE_THROW (CORBA::TRANSIENT ( - // CORBA_SystemException::_tao_minor_code ( - // TAO_INVOCATION_CONNECT_MINOR_CODE, - // errno), + // ACE_THROW (CORBA::TRANSIENT (TAO_OMG_VMCID | 2, // CORBA::COMPLETED_NO)); } diff --git a/TAO/tao/LocalObject.cpp b/TAO/tao/LocalObject.cpp index 45843769958..e8952ac76b2 100644 --- a/TAO/tao/LocalObject.cpp +++ b/TAO/tao/LocalObject.cpp @@ -1,17 +1,15 @@ +// -*- C++ -*- // // $Id$ -// #include "LocalObject.h" -#include "Stub.h" -#include "IFR_Client_Adapter.h" - -#include "ace/Dynamic_Service.h" #if !defined (__ACE_INLINE__) # include "LocalObject.i" #endif /* ! __ACE_INLINE__ */ +#include "PolicyC.h" + ACE_RCSID (tao, LocalObject, "$Id$") @@ -65,6 +63,7 @@ CORBA_LocalObject::_is_equivalent (CORBA_Object_ptr other_obj, // TAO's extensions + TAO_ObjectKey * CORBA_LocalObject::_key (CORBA_Environment &ACE_TRY_ENV) { @@ -104,7 +103,8 @@ CORBA_LocalObject::_tao_QueryInterface (ptr_arith_t type) CORBA::Boolean CORBA_LocalObject::_non_existent (CORBA_Environment &) { - return 0; // Always returns false. + // Always return false. + return 0; } void @@ -116,7 +116,10 @@ CORBA_LocalObject::_create_request (CORBA::Context_ptr, CORBA::Flags, CORBA_Environment &ACE_TRY_ENV) { - ACE_THROW (CORBA::NO_IMPLEMENT ()); + // @@ Correct minor code? CCM spec says one thing CORBA spec says + // another! + ACE_THROW (CORBA::NO_IMPLEMENT (TAO_OMG_VMCID | 4, + CORBA::COMPLETED_NO)); } void @@ -130,29 +133,27 @@ CORBA_LocalObject::_create_request (CORBA::Context_ptr, CORBA::Flags, CORBA_Environment &ACE_TRY_ENV) { - ACE_THROW (CORBA::NO_IMPLEMENT ()); + // @@ Correct minor code? CCM spec says one thing CORBA spec says + // another! + ACE_THROW (CORBA::NO_IMPLEMENT (TAO_OMG_VMCID | 4, + CORBA::COMPLETED_NO)); } CORBA::Request_ptr CORBA_LocalObject::_request (const CORBA::Char *, CORBA_Environment &ACE_TRY_ENV) { - ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0); + // @@ Correct minor code? CCM spec says one thing CORBA spec says + // another! + ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (TAO_OMG_VMCID | 4, + CORBA::COMPLETED_NO), + 0); } CORBA_InterfaceDef_ptr CORBA_LocalObject::_get_interface (CORBA_Environment &ACE_TRY_ENV) { - TAO_IFR_Client_Adapter *adapter = - ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance ( - TAO_ORB_Core::ifr_client_adapter_name () - ); - - CORBA::ORB_var orb = this->_stubobj ()->servant_orb_var (); - - return adapter->get_interface (orb.in (), - this->_interface_repository_id (), - ACE_TRY_ENV); + ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0); } CORBA::ImplementationDef_ptr @@ -164,6 +165,7 @@ CORBA_LocalObject::_get_implementation (CORBA_Environment &ACE_TRY_ENV) #endif /* TAO_HAS_MINIMUM_CORBA */ // **************************************************************** + void TAO_Local_RefCounted_Object::_add_ref (void) { @@ -180,40 +182,39 @@ TAO_Local_RefCounted_Object::_remove_ref (void) CORBA::Policy_ptr CORBA_LocalObject::_get_policy (CORBA::PolicyType, - CORBA_Environment &ACE_TRY_ENV) + CORBA_Environment &ACE_TRY_ENV) { - ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), CORBA::Policy::_nil ()); + ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), + CORBA::Policy::_nil ()); } CORBA::Policy_ptr CORBA_LocalObject::_get_client_policy (CORBA::PolicyType, - CORBA_Environment &ACE_TRY_ENV) + CORBA_Environment &ACE_TRY_ENV) { ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), CORBA::Policy::_nil ()); } CORBA::Object_ptr CORBA_LocalObject::_set_policy_overrides (const CORBA::PolicyList &, - CORBA::SetOverrideType, - CORBA_Environment &ACE_TRY_ENV) + CORBA::SetOverrideType, + CORBA_Environment &ACE_TRY_ENV) { ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), CORBA::Policy::_nil ()); } CORBA::PolicyList * CORBA_LocalObject::_get_policy_overrides (const CORBA::PolicyTypeSeq &, - CORBA_Environment &ACE_TRY_ENV) + CORBA_Environment &ACE_TRY_ENV) { ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0); } CORBA::Boolean CORBA_LocalObject::_validate_connection (CORBA::PolicyList_out, - CORBA_Environment &ACE_TRY_ENV) + CORBA_Environment &ACE_TRY_ENV) { ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0); } - - #endif /* TAO_HAS_CORBA_MESSAGING == 1 */ diff --git a/TAO/tao/LocalObject.h b/TAO/tao/LocalObject.h index a28279b84c7..95c9934d0db 100644 --- a/TAO/tao/LocalObject.h +++ b/TAO/tao/LocalObject.h @@ -1,28 +1,28 @@ -// This may look like C, but it's really -*- C++ -*- +// -*- C++ -*- //============================================================================= /** - * @file LocalObject.h + * @file LocalObject.h * - * $Id$ + * $Id$ * - * Header file for CORBA's base "LocalObject" type. + * Header file for CORBA's base "LocalObject" type. * - * A "LocalObject" is an entity that can be the target of an local - * invocation. See the CORBA Component Model specification for details. + * A "LocalObject" is an entity that can be the target of a local + * invocation. See the CORBA Component Model specification for + * details. * - * - * @author Portions Copyright 1997 by Washington University + * @author Nanbor Wang <nanbor@cs.wustl.edu> */ //============================================================================= #ifndef TAO_CORBA_LOCALOBJECT_H #define TAO_CORBA_LOCALOBJECT_H + #include "ace/pre.h" -#include "tao/corbafwd.h" -#include "tao/Object.h" +#include "Object.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once @@ -30,19 +30,21 @@ /** * @class CORBA_LocalObject - * @@ NW: It is not clear whether minimum CORBA should support + * + * @note NW: It is not clear whether minimum CORBA should support * LocalObject or not. I think it should. */ class TAO_Export CORBA_LocalObject : public virtual CORBA_Object { public: - /// destructor + + /// Destructor virtual ~CORBA_LocalObject (void); - /// increment the ref count + /// Increment the ref count static CORBA_LocalObject_ptr _duplicate (CORBA_LocalObject_ptr obj); - /// return a NUL object + /// Return a NIL object static CORBA_LocalObject_ptr _nil (void); /** @@ -52,14 +54,15 @@ public: * object. Or, even easier, add a <is_local> member into * CORBA_Object. I'll take the easier route for now. */ - static CORBA_LocalObject_ptr _narrow (CORBA_Object_ptr obj, + static CORBA_LocalObject_ptr _narrow (CORBA::Object_ptr obj, CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()); - /// no-op it is just here to simplify some templates. - static CORBA_LocalObject_ptr _unchecked_narrow (CORBA_Object_ptr obj, - CORBA_Environment &ACE_TRY_ENV = - TAO_default_environment ()); + /// No-op it is just here to simplify some templates. + static CORBA_LocalObject_ptr _unchecked_narrow ( + CORBA::Object_ptr obj, + CORBA_Environment &ACE_TRY_ENV = + TAO_default_environment ()); #if (TAO_HAS_MINIMUM_CORBA == 0) @@ -67,7 +70,7 @@ public: virtual CORBA::Boolean _non_existent (CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()); - /// throws NO_IMPLEMENT. + /// Throws CORBA::NO_IMPLEMENT. virtual CORBA::ImplementationDef_ptr _get_implementation (CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()); @@ -77,7 +80,7 @@ public: CORBA_Environment &ACE_TRY_ENV = TAO_default_environment () ); - /// throws NO_IMPLEMENT. + /// Throws NO_IMPLEMENT. virtual void _create_request (CORBA::Context_ptr ctx, const CORBA::Char *operation, CORBA::NVList_ptr arg_list, @@ -98,9 +101,7 @@ public: CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()); - // throws NO_IMPLEMENT. - - /// throws NO_IMPLEMENT. + /// Throws NO_IMPLEMENT. virtual CORBA::Request_ptr _request (const CORBA::Char *operation, CORBA_Environment &ACE_TRY_ENV = TAO_default_environment ()); @@ -109,21 +110,21 @@ public: #if (TAO_HAS_CORBA_MESSAGING == 1) - /// throws NO_IMPLEMENT. + /// Throws CORBA::NO_IMPLEMENT. CORBA::Policy_ptr _get_policy ( CORBA::PolicyType type, CORBA_Environment &ACE_TRY_ENV = TAO_default_environment () ); - /// throws NO_IMPLEMENT. + /// Throws CORBA::NO_IMPLEMENT. CORBA::Policy_ptr _get_client_policy ( CORBA::PolicyType type, CORBA_Environment &ACE_TRY_ENV = TAO_default_environment () ); - /// throws NO_IMPLEMENT. + /// Throws CORBA::NO_IMPLEMENT. CORBA::Object_ptr _set_policy_overrides ( const CORBA::PolicyList & policies, CORBA::SetOverrideType set_add, @@ -131,14 +132,14 @@ public: TAO_default_environment () ); - /// throws NO_IMPLEMENT. + /// Throws CORBA::NO_IMPLEMENT. CORBA::PolicyList * _get_policy_overrides ( const CORBA::PolicyTypeSeq & types, CORBA_Environment &ACE_TRY_ENV = TAO_default_environment () ); - /// throws NO_IMPLEMENT. + /// Throws CORBA::NO_IMPLEMENT. CORBA::Boolean _validate_connection ( CORBA::PolicyList_out inconsistent_policies, CORBA_Environment &ACE_TRY_ENV = @@ -178,41 +179,33 @@ public: // = TAO extensions - /// throws NO_IMPLEMENT. - virtual TAO_ObjectKey *_key (CORBA_Environment &ACE_TRY_ENV = - TAO_default_environment ()); - -#if 0 - /** - * Return a reference to the object key of profile in-use. - * If there's no in-use profile, then the program will - * probably crash. This method does not create a new copy. - */ - virtual const TAO_ObjectKey &_object_key (void); - - /// Downcasting this object pointer to some other derived class. - /// This QueryInterface stuff only work for local object. - virtual void * _tao_QueryInterface (ptr_arith_t type); -#endif /* 0 */ + /// Throws CORBA::NO_IMPLEMENT. + virtual TAO_ObjectKey *_key (CORBA_Environment &ACE_TRY_ENV); #if !defined(__GNUC__) || __GNUC__ > 2 || __GNUC_MINOR__ >= 8 + /// Useful for template programming. typedef CORBA_LocalObject_ptr _ptr_type; typedef CORBA_LocalObject_var _var_type; #endif /* __GNUC__ */ - // Useful for template programming. protected: + + /// Default constructor. + /** + * Make it protected to prevent instantiation of this class. + */ CORBA_LocalObject (void); - // Default constructor. Make it protected to prevent instantiation - // of this class. private: - // = Unimplemented methods - // constructor - + /** + * @name Unimplemented methods + */ + //@{ CORBA_LocalObject (const CORBA_LocalObject &); CORBA_LocalObject &operator = (const CORBA_LocalObject &); + //@} + }; class TAO_Export CORBA_LocalObject_var @@ -272,21 +265,27 @@ public: virtual void _remove_ref (void); protected: + + // Default constructor. + /** + * Make it protected to prevent instantiation of this class. + */ TAO_Local_RefCounted_Object (void); - // Default constructor. Make it protected to prevent instantiation - // of this class. private: - // = Unimplemented methods - // constructor - + /** + * @name Unimplemented methods + */ + //@{ TAO_Local_RefCounted_Object (const TAO_Local_RefCounted_Object &); TAO_Local_RefCounted_Object &operator = (const TAO_Local_RefCounted_Object &); + //@} + }; #if defined (__ACE_INLINE__) -# include "tao/LocalObject.i" +# include "LocalObject.i" #endif /* __ACE_INLINE__ */ #include "ace/post.h" diff --git a/TAO/tao/LocalObject.i b/TAO/tao/LocalObject.i index 4ed53a54694..f2b83c3f88b 100644 --- a/TAO/tao/LocalObject.i +++ b/TAO/tao/LocalObject.i @@ -1,3 +1,5 @@ +// -*- C++ -*- +// // $Id$ // **************************************************************** @@ -20,27 +22,31 @@ CORBA_LocalObject::_nil (void) ACE_INLINE CORBA_LocalObject_ptr CORBA_LocalObject::_narrow (CORBA_Object_ptr obj, - CORBA_Environment&) + CORBA_Environment &) { if (obj->_is_local () != 0) return - ACE_reinterpret_cast (CORBA_LocalObject_ptr, - obj->_tao_QueryInterface - (ACE_reinterpret_cast (ptr_arith_t, - &CORBA_LocalObject::_narrow))); + ACE_reinterpret_cast ( + CORBA_LocalObject_ptr, + obj->_tao_QueryInterface ( + ACE_reinterpret_cast (ptr_arith_t, + &CORBA_LocalObject::_narrow))); + return 0; } ACE_INLINE CORBA_LocalObject_ptr CORBA_LocalObject::_unchecked_narrow (CORBA_Object_ptr obj, - CORBA_Environment&) + CORBA_Environment &) { if (obj->_is_local () != 0) return - ACE_reinterpret_cast (CORBA_LocalObject_ptr, - obj->_tao_QueryInterface - (ACE_reinterpret_cast (ptr_arith_t, - &CORBA_LocalObject::_narrow))); + ACE_reinterpret_cast ( + CORBA_LocalObject_ptr, + obj->_tao_QueryInterface ( + ACE_reinterpret_cast (ptr_arith_t, + &CORBA_LocalObject::_narrow))); + return 0; } @@ -52,7 +58,7 @@ CORBA_LocalObject::CORBA_LocalObject (void) ACE_INLINE TAO_Local_RefCounted_Object::TAO_Local_RefCounted_Object (void) - // : CORBA_LocalObject () + // : CORBA_LocalObject () { } @@ -85,9 +91,9 @@ CORBA_LocalObject_var::ptr (void) const ACE_INLINE CORBA_LocalObject_var::CORBA_LocalObject_var (const CORBA_LocalObject_var &p) - // copy constructor : ptr_ (CORBA_LocalObject::_duplicate (p.ptr ())) -{} +{ +} ACE_INLINE CORBA_LocalObject_var & CORBA_LocalObject_var::operator= (CORBA_LocalObject_ptr p) @@ -101,10 +107,11 @@ ACE_INLINE CORBA_LocalObject_var & CORBA_LocalObject_var::operator= (const CORBA_LocalObject_var &p) { if (this != &p) - { - CORBA::release (this->ptr_); - this->ptr_ = CORBA_LocalObject::_duplicate (p.ptr ()); - } + { + CORBA::release (this->ptr_); + this->ptr_ = CORBA_LocalObject::_duplicate (p.ptr ()); + } + return *this; } @@ -161,23 +168,24 @@ CORBA_LocalObject_var::_retn (void) ACE_INLINE CORBA_LocalObject_out::CORBA_LocalObject_out (CORBA_LocalObject_ptr &p) - : ptr_ (p) + : ptr_ (p) { this->ptr_ = CORBA_LocalObject::_nil (); } ACE_INLINE -CORBA_LocalObject_out::CORBA_LocalObject_out (CORBA_LocalObject_var &p) // constructor from _var - : ptr_ (p.out ()) +CORBA_LocalObject_out::CORBA_LocalObject_out (CORBA_LocalObject_var &p) + : ptr_ (p.out ()) { CORBA::release (this->ptr_); this->ptr_ = CORBA_LocalObject::_nil (); } ACE_INLINE -CORBA_LocalObject_out::CORBA_LocalObject_out (const CORBA_LocalObject_out &p) // copy constructor - : ptr_ (p.ptr_) -{} +CORBA_LocalObject_out::CORBA_LocalObject_out (const CORBA_LocalObject_out &p) + : ptr_ (p.ptr_) +{ +} ACE_INLINE CORBA_LocalObject_out & CORBA_LocalObject_out::operator= (const CORBA_LocalObject_out &p) diff --git a/TAO/tao/ORB.cpp b/TAO/tao/ORB.cpp index 3c1e1eb02c1..fb0bde4a745 100644 --- a/TAO/tao/ORB.cpp +++ b/TAO/tao/ORB.cpp @@ -1803,6 +1803,13 @@ CORBA_ORB::object_to_string (CORBA::Object_ptr obj, this->check_shutdown (ACE_TRY_ENV); ACE_CHECK_RETURN (0); + if (obj->_is_local ()) + // @@ The CCM spec says one minor code, and the CORBA spec says + // another. Which is the correct one? + ACE_THROW_RETURN (CORBA::MARSHAL (TAO_OMG_VMCID | 4, + CORBA::COMPLETED_NO), + 0); + // Application writer controls what kind of objref strings they get, // maybe along with other things, by how they initialize the ORB. @@ -1814,9 +1821,13 @@ CORBA_ORB::object_to_string (CORBA::Object_ptr obj, // XXX there should be a simple way to reuse this code in other // ORB implementations ... - char buf [ACE_CDR::DEFAULT_BUFSIZE]; #if defined(ACE_HAS_PURIFY) - (void) ACE_OS::memset (buf, '\0', sizeof(buf)); + char buf [ACE_CDR::DEFAULT_BUFSIZE] = { 0 }; +#else + // Avoid the initialization overhead if not compiling with + // support for Purify. There is no need to actually perform + // initialization otherwise. + char buf [ACE_CDR::DEFAULT_BUFSIZE]; #endif /* ACE_HAS_PURIFY */ TAO_OutputCDR cdr (buf, sizeof buf, @@ -1888,19 +1899,15 @@ CORBA_ORB::object_to_string (CORBA::Object_ptr obj, 0); } - // @@ According to Carlos, we shouldn't be using - // profile_in_use(). Instead we should use the first profile - // in the MProfile instead, for example. - // - // For now, I'll just throw an exception since I was getting - // segmentation faults. - // -Ossama - if (obj->_stubobj ()->profile_in_use () == 0) + TAO_MProfile &mp = obj->_stubobj ()->base_profiles (); + + if (mp.profile_count () == 0) { if (TAO_debug_level > 0) ACE_ERROR ((LM_ERROR, - ACE_TEXT ("TAO_Profile pointer in ") - ACE_TEXT ("CORBA::ORB::object_to_string() is zero.\n"))); + ACE_TEXT ("(%P|%t) Cannot stringify given ") + ACE_TEXT ("object. No profiles.\n"))); + ACE_THROW_RETURN (CORBA::MARSHAL ( CORBA_SystemException::_tao_minor_code ( @@ -1910,7 +1917,10 @@ CORBA_ORB::object_to_string (CORBA::Object_ptr obj, 0); } - return obj->_stubobj ()->profile_in_use ()->to_string (ACE_TRY_ENV); + // For now we just use the first profile. + TAO_Profile *profile = mp.get_profile (0); + + return profile->to_string (ACE_TRY_ENV); } } diff --git a/TAO/tao/Object.h b/TAO/tao/Object.h index a3ab7ce91e5..cbbe8798f40 100644 --- a/TAO/tao/Object.h +++ b/TAO/tao/Object.h @@ -191,8 +191,7 @@ public: /// Return the object key as an out parameter. Caller should release /// return value when finished with it. - virtual TAO_ObjectKey *_key (CORBA_Environment &ACE_TRY_ENV = - TAO_default_environment ()); + virtual TAO_ObjectKey *_key (CORBA_Environment &ACE_TRY_ENV); /** * Return a reference to the object key of profile in-use. diff --git a/TAO/tao/Object_Ref_Table.cpp b/TAO/tao/Object_Ref_Table.cpp index b9299716b1c..c883296595d 100644 --- a/TAO/tao/Object_Ref_Table.cpp +++ b/TAO/tao/Object_Ref_Table.cpp @@ -34,14 +34,14 @@ TAO_Object_Ref_Table::register_initial_reference ( CORBA::Environment &ACE_TRY_ENV) { if (id == 0) - ACE_THROW (CORBA::BAD_PARAM (TAO_OMG_VMCID | 24, + ACE_THROW (CORBA::BAD_PARAM (TAO_OMG_VMCID | 27, CORBA::COMPLETED_NO)); else if (ACE_OS_String::strlen (id) == 0) - ACE_THROW (CORBA::BAD_PARAM (TAO_OMG_VMCID | 24, + ACE_THROW (CORBA::BAD_PARAM (TAO_OMG_VMCID | 27, CORBA::COMPLETED_NO)); if (CORBA::is_nil (obj)) - ACE_THROW (CORBA::BAD_PARAM (TAO_OMG_VMCID | 24, + ACE_THROW (CORBA::BAD_PARAM (TAO_OMG_VMCID | 27, CORBA::COMPLETED_NO)); int result = this->bind (id, obj); diff --git a/TAO/tao/PolicyFactory_Registry.cpp b/TAO/tao/PolicyFactory_Registry.cpp index 69faf583ce7..29910a7f3c7 100644 --- a/TAO/tao/PolicyFactory_Registry.cpp +++ b/TAO/tao/PolicyFactory_Registry.cpp @@ -43,7 +43,7 @@ TAO_PolicyFactory_Registry::register_policy_factory ( { // PolicyFactory of given type already exists. - ACE_THROW (CORBA::BAD_INV_ORDER (TAO_OMG_VMCID | 12, + ACE_THROW (CORBA::BAD_INV_ORDER (TAO_OMG_VMCID | 16, CORBA::COMPLETED_NO)); } else if (result == -1) diff --git a/TAO/tao/RT_Invocation_Endpoint_Selectors.cpp b/TAO/tao/RT_Invocation_Endpoint_Selectors.cpp index 33028c6ce18..ecb52fe077c 100644 --- a/TAO/tao/RT_Invocation_Endpoint_Selectors.cpp +++ b/TAO/tao/RT_Invocation_Endpoint_Selectors.cpp @@ -149,10 +149,7 @@ TAO_Priority_Endpoint_Selector::select_endpoint (TAO_GIOP_Invocation *invocation // If we get here, we completely failed to find an endpoint selector // that we know how to use, so throw an exception. - ACE_THROW (CORBA::TRANSIENT ( - CORBA_SystemException::_tao_minor_code ( - TAO_INVOCATION_CONNECT_MINOR_CODE, - errno), + ACE_THROW (CORBA::TRANSIENT (TAO_OMG_VMCID | 2, CORBA::COMPLETED_NO)); } @@ -332,10 +329,7 @@ TAO_Bands_Endpoint_Selector::select_endpoint (TAO_GIOP_Invocation *invocation, // If we get here, we completely failed to find an endpoint selector // that we know how to use, so throw an exception. - ACE_THROW (CORBA::TRANSIENT ( - CORBA_SystemException::_tao_minor_code ( - TAO_INVOCATION_CONNECT_MINOR_CODE, - errno), + ACE_THROW (CORBA::TRANSIENT (TAO_OMG_VMCID | 2, CORBA::COMPLETED_NO)); @@ -497,10 +491,7 @@ TAO_Protocol_Endpoint_Selector::select_endpoint (TAO_GIOP_Invocation // If we get here, we completely failed to find an endpoint selector // that we know how to use, so throw an exception. - ACE_THROW (CORBA::TRANSIENT ( - CORBA_SystemException::_tao_minor_code ( - TAO_INVOCATION_CONNECT_MINOR_CODE, - errno), + ACE_THROW (CORBA::TRANSIENT (TAO_OMG_VMCID | 2, CORBA::COMPLETED_NO)); @@ -749,10 +740,7 @@ TAO_Client_Priority_Policy_Selector::select_endpoint (TAO_GIOP_Invocation ACE_THROW (CORBA::INV_POLICY ()); } - ACE_THROW (CORBA::TRANSIENT ( - CORBA_SystemException::_tao_minor_code ( - TAO_INVOCATION_CONNECT_MINOR_CODE, - errno), + ACE_THROW (CORBA::TRANSIENT (TAO_OMG_VMCID | 2, CORBA::COMPLETED_NO)); diff --git a/TAO/tao/corbafwd.h b/TAO/tao/corbafwd.h index 57269e7258a..0dffeac413e 100644 --- a/TAO/tao/corbafwd.h +++ b/TAO/tao/corbafwd.h @@ -1711,24 +1711,23 @@ TAO_NAMESPACE_CLOSE // end of class (namespace) CORBA // T A 0 location errno // Location encoding: 5 bits, after the errno encoding. -#define TAO_INVOCATION_CONNECT_MINOR_CODE (0x01U << 7) -#define TAO_INVOCATION_LOCATION_FORWARD_MINOR_CODE (0x02U << 7) -#define TAO_INVOCATION_SEND_REQUEST_MINOR_CODE (0x03U << 7) -#define TAO_POA_DISCARDING (0x04U << 7) -#define TAO_POA_HOLDING (0x05U << 7) -#define TAO_UNHANDLED_SERVER_CXX_EXCEPTION (0x06U << 7) -#define TAO_INVOCATION_RECV_REQUEST_MINOR_CODE (0x07U << 7) -#define TAO_CONNECTOR_REGISTRY_NO_USABLE_PROTOCOL (0x08U << 7) -#define TAO_MPROFILE_CREATION_ERROR (0x09U << 7) -#define TAO_TIMEOUT_CONNECT_MINOR_CODE (0x0AU << 7) -#define TAO_TIMEOUT_SEND_MINOR_CODE (0x0BU << 7) -#define TAO_TIMEOUT_RECV_MINOR_CODE (0x0CU << 7) -#define TAO_IMPLREPO_MINOR_CODE (0x0DU << 7) -#define TAO_ACCEPTOR_REGISTRY_OPEN_LOCATION_CODE (0x0EU << 7) -#define TAO_ORB_CORE_INIT_LOCATION_CODE (0x0FU << 7) -#define TAO_POLICY_NARROW_CODE (0x10U << 7) -#define TAO_GUARD_FAILURE (0x11U << 7) -#define TAO_POA_BEING_DESTROYED (0x12U << 7) +#define TAO_INVOCATION_LOCATION_FORWARD_MINOR_CODE (0x01U << 7) +#define TAO_INVOCATION_SEND_REQUEST_MINOR_CODE (0x02U << 7) +#define TAO_POA_DISCARDING (0x03U << 7) +#define TAO_POA_HOLDING (0x04U << 7) +#define TAO_UNHANDLED_SERVER_CXX_EXCEPTION (0x05U << 7) +#define TAO_INVOCATION_RECV_REQUEST_MINOR_CODE (0x06U << 7) +#define TAO_CONNECTOR_REGISTRY_NO_USABLE_PROTOCOL (0x07U << 7) +#define TAO_MPROFILE_CREATION_ERROR (0x08U << 7) +#define TAO_TIMEOUT_CONNECT_MINOR_CODE (0x09U << 7) +#define TAO_TIMEOUT_SEND_MINOR_CODE (0x0AU << 7) +#define TAO_TIMEOUT_RECV_MINOR_CODE (0x0BU << 7) +#define TAO_IMPLREPO_MINOR_CODE (0x0CU << 7) +#define TAO_ACCEPTOR_REGISTRY_OPEN_LOCATION_CODE (0x0DU << 7) +#define TAO_ORB_CORE_INIT_LOCATION_CODE (0x0EU << 7) +#define TAO_POLICY_NARROW_CODE (0x0FU << 7) +#define TAO_GUARD_FAILURE (0x10U << 7) +#define TAO_POA_BEING_DESTROYED (0x11U << 7) // *Don't* use TAO_<location>_MINOR_CODE greater than 0x1FU! // errno encoding: bottom 7 bits. diff --git a/TAO/tao/orb.idl b/TAO/tao/orb.idl index a7a16b9f9bb..489cb6026ad 100644 --- a/TAO/tao/orb.idl +++ b/TAO/tao/orb.idl @@ -1,3 +1,5 @@ +// -*- IDL -*- + // $Id$ // Included for compatibility with the CORBA 2 specification. @@ -30,6 +32,13 @@ module CORBA SYSTEM_EXCEPTION }; + enum ParameterMode + { + PARAM_IN, + PARAM_OUT, + PARAM_INOUT + }; + interface Request; interface NVList; |