00001
00002
00003 #include "tao/SystemException.h"
00004 #include "tao/ORB_Constants.h"
00005 #include "tao/CORBA_String.h"
00006 #include "tao/CDR.h"
00007 #include "tao/debug.h"
00008 #include "tao/AnyTypeCode_Adapter.h"
00009
00010 #include "ace/Malloc.h"
00011 #include "ace/SString.h"
00012 #include "ace/OS_NS_string.h"
00013 #include "ace/OS_NS_stdio.h"
00014 #include "ace/Dynamic_Service.h"
00015
00016 #if !defined (ACE_LACKS_IOSTREAM_TOTALLY)
00017
00018
00019 #include "ace/streams.h"
00020 #endif
00021
00022 #if !defined (__ACE_INLINE__)
00023 # include "tao/SystemException.inl"
00024 #endif
00025
00026
00027 ACE_RCSID (tao,
00028 SystemException,
00029 "$Id: SystemException.cpp 85406 2009-05-20 09:07:56Z johnnyw $")
00030
00031
00032 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00033
00034
00035
00036
00037
00038
00039
00040 const CORBA::ULong TAO_UNSPECIFIED_MINOR_CODE = 0x0U;
00041 const CORBA::ULong TAO_ETIMEDOUT_MINOR_CODE = 0x1U;
00042 const CORBA::ULong TAO_ENFILE_MINOR_CODE = 0x2U;
00043 const CORBA::ULong TAO_EMFILE_MINOR_CODE = 0x3U;
00044 const CORBA::ULong TAO_EPIPE_MINOR_CODE = 0x4U;
00045 const CORBA::ULong TAO_ECONNREFUSED_MINOR_CODE = 0x5U;
00046 const CORBA::ULong TAO_ENOENT_MINOR_CODE = 0x6U;
00047 const CORBA::ULong TAO_EBADF_MINOR_CODE = 0x7U;
00048 const CORBA::ULong TAO_ENOSYS_MINOR_CODE = 0x8U;
00049 const CORBA::ULong TAO_EPERM_MINOR_CODE = 0x9U;
00050 const CORBA::ULong TAO_EAFNOSUPPORT_MINOR_CODE = 0xAU;
00051 const CORBA::ULong TAO_EAGAIN_MINOR_CODE = 0xBU;
00052 const CORBA::ULong TAO_ENOMEM_MINOR_CODE = 0xCU;
00053 const CORBA::ULong TAO_EACCES_MINOR_CODE = 0xDU;
00054 const CORBA::ULong TAO_EFAULT_MINOR_CODE = 0xEU;
00055 const CORBA::ULong TAO_EBUSY_MINOR_CODE = 0xFU;
00056 const CORBA::ULong TAO_EEXIST_MINOR_CODE = 0x10U;
00057 const CORBA::ULong TAO_EINVAL_MINOR_CODE = 0x11U;
00058 const CORBA::ULong TAO_ECOMM_MINOR_CODE = 0x12U;
00059 const CORBA::ULong TAO_ECONNRESET_MINOR_CODE = 0x13U;
00060 const CORBA::ULong TAO_ENOTSUP_MINOR_CODE = 0x14U;
00061
00062
00063
00064
00065
00066 CORBA::SystemException::SystemException (void)
00067 : minor_ (0),
00068 completed_ (CORBA::COMPLETED_NO)
00069 {
00070 }
00071
00072 CORBA::SystemException::SystemException (const char *repository_id,
00073 const char *local_name,
00074 CORBA::ULong code,
00075 CORBA::CompletionStatus completed)
00076 : CORBA::Exception (repository_id,
00077 local_name),
00078 minor_ (code),
00079 completed_ (completed)
00080 {
00081 }
00082
00083 CORBA::SystemException::SystemException (CORBA::ULong code,
00084 CORBA::CompletionStatus completed)
00085 : minor_ (code),
00086 completed_ (completed)
00087 {
00088 }
00089
00090 CORBA::SystemException::SystemException (const CORBA::SystemException &src)
00091 : CORBA::Exception (src),
00092 minor_ (src.minor_),
00093 completed_ (src.completed_)
00094 {
00095 }
00096
00097 CORBA::SystemException::~SystemException (void)
00098 {
00099 }
00100
00101 CORBA::SystemException &
00102 CORBA::SystemException::operator= (const CORBA::SystemException &src)
00103 {
00104 if (this != &src)
00105 {
00106 this->Exception::operator= (src);
00107
00108 this->minor_ = src.minor_;
00109 this->completed_ = src.completed_;
00110 }
00111
00112 return *this;
00113 }
00114
00115 void
00116 CORBA::SystemException::_tao_encode (TAO_OutputCDR &cdr) const
00117 {
00118 if (cdr.write_string (this->_rep_id ())
00119 && cdr.write_ulong (this->minor ())
00120 && cdr.write_ulong (this->completed ()))
00121 {
00122 return;
00123 }
00124
00125 throw ::CORBA::MARSHAL ();
00126 }
00127
00128 void
00129 CORBA::SystemException::_tao_decode (TAO_InputCDR &cdr)
00130 {
00131
00132
00133
00134 CORBA::ULong tmp;
00135
00136 if (cdr.read_ulong (this->minor_)
00137 && cdr.read_ulong (tmp))
00138 {
00139 this->completed_ = CORBA::CompletionStatus (tmp);
00140 return;
00141 }
00142
00143 throw ::CORBA::MARSHAL ();
00144 }
00145
00146 CORBA::ULong
00147 CORBA::SystemException::_tao_errno (int errno_value)
00148 {
00149 switch (errno_value)
00150 {
00151 case 0:
00152 return TAO_UNSPECIFIED_MINOR_CODE;
00153 case ETIMEDOUT:
00154 return TAO_ETIMEDOUT_MINOR_CODE;
00155 case ENFILE:
00156 return TAO_ENFILE_MINOR_CODE;
00157 case EPIPE:
00158 return TAO_EPIPE_MINOR_CODE;
00159 case ECONNREFUSED:
00160 return TAO_ECONNREFUSED_MINOR_CODE;
00161 case ENOENT:
00162 return TAO_ENOENT_MINOR_CODE;
00163
00164 #if !defined (ACE_HAS_WINCE)
00165 case EMFILE:
00166 return TAO_EMFILE_MINOR_CODE;
00167 case EBADF:
00168 return TAO_EBADF_MINOR_CODE;
00169 case EPERM:
00170 return TAO_EPERM_MINOR_CODE;
00171 case EINVAL:
00172 return TAO_EINVAL_MINOR_CODE;
00173 #endif // ACE_HAS_WINCE
00174
00175 #if (ENOSYS != EFAULT)
00176 case ENOSYS:
00177 return TAO_ENOSYS_MINOR_CODE;
00178 #endif
00179 case EAFNOSUPPORT:
00180 return TAO_EAFNOSUPPORT_MINOR_CODE;
00181 case EAGAIN:
00182 return TAO_EAGAIN_MINOR_CODE;
00183 case ENOMEM:
00184 return TAO_ENOMEM_MINOR_CODE;
00185 case EACCES:
00186 return TAO_EACCES_MINOR_CODE;
00187 case EFAULT:
00188 return TAO_EFAULT_MINOR_CODE;
00189 case EBUSY:
00190 return TAO_EBUSY_MINOR_CODE;
00191 case EEXIST:
00192 return TAO_EEXIST_MINOR_CODE;
00193 case ECOMM:
00194 return TAO_ECOMM_MINOR_CODE;
00195 case ECONNRESET:
00196 return TAO_ECONNRESET_MINOR_CODE;
00197 #if (ENOTSUP != ENOSYS)
00198 case ENOTSUP:
00199 return TAO_ENOTSUP_MINOR_CODE;
00200 #endif
00201 default:
00202
00203 return errno_value & 0x7FU;
00204 }
00205 }
00206
00207 CORBA::Exception *
00208 CORBA::SystemException::_tao_duplicate (void) const
00209 {
00210 return 0;
00211 }
00212
00213 CORBA::ULong
00214 CORBA::SystemException::_tao_minor_code (u_int location, int errno_value)
00215 {
00216 return
00217 TAO::VMCID
00218 | location
00219 | _tao_errno (errno_value);
00220 }
00221
00222 void
00223 CORBA::SystemException::_tao_print_system_exception (FILE *) const
00224 {
00225 ACE_ERROR ((LM_ERROR,
00226 ACE_TEXT("(%P|%t) system exception, ID '%C'\n"),
00227 this->_info ().c_str ()));
00228 }
00229
00230 ACE_CString
00231 CORBA::SystemException::_info (void) const
00232 {
00233
00234
00235
00236
00237
00238
00239 ACE_CString info = "system exception, ID '";
00240 info += this->_rep_id ();
00241 info += "'\n";
00242
00243 CORBA::ULong const VMCID = this->minor () & 0xFFFFF000u;
00244
00245 if (VMCID == TAO::VMCID)
00246 {
00247
00248 const char *location = 0;
00249 switch (this->minor () & 0x00000F80u)
00250 {
00251 case TAO_INVOCATION_LOCATION_FORWARD_MINOR_CODE:
00252 location = "location forward failed";
00253 break;
00254 case TAO_INVOCATION_SEND_REQUEST_MINOR_CODE:
00255 location = "send request failed";
00256 break;
00257 case TAO_POA_DISCARDING:
00258 location = "poa in discarding state";
00259 break;
00260 case TAO_POA_HOLDING:
00261 location = "poa in holding state";
00262 break;
00263 case TAO_POA_INACTIVE:
00264 location = "poa in inactive state";
00265 break;
00266 case TAO_UNHANDLED_SERVER_CXX_EXCEPTION:
00267 location = "unhandled c++ exception in server side";
00268 break;
00269 case TAO_INVOCATION_RECV_REQUEST_MINOR_CODE:
00270 location = "failed to recv request response";
00271 break;
00272 case TAO_CONNECTOR_REGISTRY_NO_USABLE_PROTOCOL:
00273 location = "all protocols failed to parse the IOR";
00274 break;
00275 case TAO_MPROFILE_CREATION_ERROR:
00276 location = "error during MProfile creation";
00277 break;
00278 case TAO_TIMEOUT_CONNECT_MINOR_CODE:
00279 location = "timeout during connect";
00280 break;
00281 case TAO_TIMEOUT_SEND_MINOR_CODE:
00282 location = "timeout during send";
00283 break;
00284 case TAO_TIMEOUT_RECV_MINOR_CODE:
00285 location = "timeout during recv";
00286 break;
00287 case TAO_IMPLREPO_MINOR_CODE:
00288 location = "implrepo server exception";
00289 break;
00290 case TAO_ACCEPTOR_REGISTRY_OPEN_LOCATION_CODE:
00291 location = "endpoint initialization failure in Acceptor Registry";
00292 break;
00293 case TAO_ORB_CORE_INIT_LOCATION_CODE:
00294 location = "ORB Core initialization failed";
00295 break;
00296 case TAO_POLICY_NARROW_CODE:
00297 location = "Failure when narrowing a Policy";
00298 break;
00299 case TAO_GUARD_FAILURE:
00300 location = "Failure when trying to acquire a guard/monitor";
00301 break;
00302 case TAO_POA_BEING_DESTROYED:
00303 location = "POA has been destroyed or is currently being destroyed";
00304 break;
00305 case TAO_AMH_REPLY_LOCATION_CODE:
00306 location = "Failure when trying to send AMH reply";
00307 break;
00308 case TAO_RTCORBA_THREAD_CREATION_LOCATION_CODE:
00309 location = "Failure in thread creation for RTCORBA thread pool";
00310 break;
00311 default:
00312 location = "unknown location";
00313 }
00314
00315 const char *errno_indication = 0;
00316 char unknown_errno [255];
00317 CORBA::ULong minor_code = this->minor () & 0x7FU;
00318 switch (minor_code)
00319 {
00320 case TAO_UNSPECIFIED_MINOR_CODE:
00321 errno_indication = "unspecified errno";
00322 break;
00323 case TAO_ETIMEDOUT_MINOR_CODE:
00324 errno_indication = "ETIMEOUT";
00325 break;
00326 case TAO_ENFILE_MINOR_CODE:
00327 errno_indication = "ENFILE";
00328 break;
00329 case TAO_EMFILE_MINOR_CODE:
00330 errno_indication = "EMFILE";
00331 break;
00332 case TAO_EPIPE_MINOR_CODE:
00333 errno_indication = "EPIPE";
00334 break;
00335 case TAO_ECONNREFUSED_MINOR_CODE:
00336 errno_indication = "ECONNREFUSED";
00337 break;
00338 case TAO_ENOENT_MINOR_CODE:
00339 errno_indication = "ENOENT";
00340 break;
00341 case TAO_EBADF_MINOR_CODE:
00342 errno_indication = "EBADF";
00343 break;
00344 case TAO_ENOSYS_MINOR_CODE:
00345 errno_indication = "ENOSYS";
00346 break;
00347 case TAO_EPERM_MINOR_CODE:
00348 errno_indication = "EPERM";
00349 break;
00350 case TAO_EAFNOSUPPORT_MINOR_CODE:
00351 errno_indication = "EAFNOSUPPORT";
00352 break;
00353 case TAO_EAGAIN_MINOR_CODE:
00354 errno_indication = "EAGAIN";
00355 break;
00356 case TAO_ENOMEM_MINOR_CODE:
00357 errno_indication = "ENOMEM";
00358 break;
00359 case TAO_EACCES_MINOR_CODE:
00360 errno_indication = "EACCES";
00361 break;
00362 case TAO_EFAULT_MINOR_CODE:
00363 errno_indication = "EFAULT";
00364 break;
00365 case TAO_EBUSY_MINOR_CODE:
00366 errno_indication = "EBUSY";
00367 break;
00368 case TAO_EEXIST_MINOR_CODE:
00369 errno_indication = "EEXIST";
00370 break;
00371 case TAO_EINVAL_MINOR_CODE:
00372 errno_indication = "EINVAL";
00373 break;
00374 case TAO_ECOMM_MINOR_CODE:
00375 errno_indication = "ECOMM";
00376 break;
00377 case TAO_ECONNRESET_MINOR_CODE:
00378 errno_indication = "ECONNRESET";
00379 break;
00380 case TAO_ENOTSUP_MINOR_CODE:
00381 errno_indication = "ENOTSUP";
00382 break;
00383 default:
00384 {
00385
00386 ACE_OS::sprintf (unknown_errno,
00387 "low 7 bits of errno: %3u %s",
00388 minor_code, ACE_OS::strerror (minor_code));
00389
00390 errno_indication = unknown_errno;
00391 }
00392 }
00393
00394 char buffer[BUFSIZ];
00395 ACE_OS::sprintf (buffer,
00396 "TAO exception, "
00397 "minor code = %x (%s; %s), "
00398 "completed = %s\n",
00399 minor_code,
00400 location,
00401 errno_indication,
00402 (completed () == CORBA::COMPLETED_YES) ? "YES" :
00403 (completed () == CORBA::COMPLETED_NO) ? "NO" :
00404 (completed () == CORBA::COMPLETED_MAYBE) ? "MAYBE" :
00405 "garbage");
00406
00407 info += buffer;
00408 }
00409 else if (VMCID == CORBA::OMGVMCID)
00410 {
00411 CORBA::ULong const minor_code = this->minor () & 0xFFFU;
00412
00413 const char *minor_description = 0;
00414
00415 if (minor_code > 0)
00416 minor_description =
00417 CORBA::SystemException::_tao_get_omg_exception_description (
00418 *this,
00419 minor_code);
00420 else
00421 minor_description = "*unknown description*";
00422
00423 char buffer[BUFSIZ];
00424 ACE_OS::sprintf (buffer,
00425 "OMG minor code (%d), "
00426 "described as '%s', "
00427 "completed = %s\n",
00428 minor_code,
00429 minor_description,
00430 (completed () == CORBA::COMPLETED_YES) ? "YES" :
00431 (completed () == CORBA::COMPLETED_NO) ? "NO" :
00432 (completed () == CORBA::COMPLETED_MAYBE) ? "MAYBE" :
00433 "garbage");
00434
00435 info += buffer;
00436 }
00437 else
00438 {
00439 char buffer[BUFSIZ];
00440 ACE_OS::sprintf (buffer,
00441 "Unknown vendor minor code id (%x), "
00442 "minor code = %x, completed = %s\n",
00443 VMCID,
00444 this->minor (),
00445 (completed () == CORBA::COMPLETED_YES) ? "YES" :
00446 (completed () == CORBA::COMPLETED_NO) ? "NO" :
00447 (completed () == CORBA::COMPLETED_MAYBE) ? "MAYBE" :
00448 "garbage");
00449
00450 info += buffer;
00451 }
00452
00453 return info;
00454 }
00455
00456 const char *
00457 CORBA::SystemException::_tao_get_omg_exception_description (
00458 const CORBA::SystemException &exc,
00459 CORBA::ULong minor_code)
00460 {
00461 #ifndef ACE_NDEBUG
00462
00463 static const char *UNKNOWN_TABLE[] =
00464 {
00465 "Unlisted user exception received by client.",
00466 "Non-standard SystemException not supported.",
00467 "An unknown user exception received by a portable interceptor."
00468 };
00469
00470 static const char *BAD_PARAM_TABLE[] =
00471 {
00472 "Failure to register, unregister, or lookup value factory.",
00473 "RID already defined in IFR.",
00474 "Name already used in the context in IFR.",
00475 "Target is not a valid container.",
00476 "Name clash in inherited context.",
00477 "Incorrect type for abstract interface.",
00478 "string_to_object conversion failed due to a bad scheme name.",
00479 "string_to_object conversion failed due to a bad address.",
00480 "string_to_object conversion failed due to a bad schema specific part.",
00481 "string_to_object conversion failed due to non specific reason.",
00482 "Attempt to derive abstract interface from non-abstract base interface in the Interface Repository.",
00483 "Attempt to let a ValueDef support more than one non-abstract interface in the Interface Repository.",
00484 "Attempt to use an incomplete TypeCode as a parameter.",
00485 "Invalid object id passed to POA::create_reference_by_id.",
00486 "Bad name argument in TypeCode operation.",
00487 "Bad RepositoryId argument in TypeCode operation.",
00488 "Invalid member name in TypeCode operation.",
00489 "Duplicate label value in create_union_tc.",
00490 "Incompatible TypeCode of label and discriminator in create_union_tc.",
00491 "Supplied discriminator type illegitimate in create_union_tc.",
00492 "Any passed to ServerRequest::set_exception does not contain an exception.",
00493 "Unlisted user exception passed to ServerRequest::set_exception",
00494 "wchar transmission code set not in service context.",
00495 "Service context is not in OMG-defined range.",
00496 "Enum value out of range.",
00497 "Invalid service context Id in portable interceptor.",
00498 "Attempt to call register_initial_reference with a null Object.",
00499 "Invalid component Id in portable interceptor.",
00500 "Invalid profile Id in portable interceptor.",
00501 "Two or more Policy objects with the same PolicyType value supplied to Object::set_policy_overrides or PolicyManager::set_policy_overrides."
00502 "Attempt to define a oneway operation with non-void result, out or inout parameters or user exceptions.",
00503 "DII asked to create request for an implicit operation.",
00504 "An OTS/XA integration xa_ call returned XAER_INVAL.",
00505 "Union branch modifier called with bad case label discriminator.",
00506 "Illegal IDL context property name.",
00507 "Illegal IDL property search string.",
00508 "Illegal IDL context name.",
00509 "Non-empty IDL context.",
00510 "Unsupported RMI/IDL customer value type stream format.",
00511 "ORB output stream does not support ValueOutputStream interface.",
00512 "ORB input stream does not support ValueInputStream interface.",
00513 "Character support limited to ISO 8859-1 for this object reference",
00514 "Attempt to add a Pollable to a second PollableSet."
00515 };
00516
00517 static const char *IMP_LIMIT_TABLE[] =
00518 {
00519 "Unable to use any profile in IOR."
00520 };
00521
00522 static const char *INITIALIZE_TABLE[] =
00523 {
00524 "Priority range too restricted for ORB."
00525 };
00526
00527
00528 static const char *INV_OBJREF_TABLE[] =
00529 {
00530 "wchar Code Set support not specified.",
00531 "Codeset component required for type using wchar or wstring data."
00532 };
00533
00534 static const char *MARSHAL_TABLE[] =
00535 {
00536 "Unable to locate value factory.",
00537 "ServerRequest::set_result called before ServerRequest::ctx when the operation IDL contains a context clause.",
00538 "NVList passed to ServerRequest::arguments does not describe all parameters passed by client.",
00539 "Attempt to marshal Local object.",
00540 "wchar or wstring data erroneously sent by client over GIOP 1.0 connection.",
00541 "wchar or wstring data erroneously returned by server over GIOP 1.0 connection.",
00542 "Unsupported RMI/IDL custom value type stream format.",
00543 "Custom data not compatible with ValueHandler read operation.",
00544 "Codeset service contexts with different values recieved on the same connection."
00545
00546 };
00547
00548 static const char *BAD_TYPECODE_TABLE[] =
00549 {
00550 "Attempt to marshal incomplete TypeCode.",
00551 "Member type code illegitimate in TypeCode operation.",
00552 "Illegal parameter type."
00553 };
00554
00555 static const char *NO_IMPLEMENT_TABLE[] =
00556 {
00557 "Missing local value implementation.",
00558 "Incompatible value implementation version.",
00559 "Unable to use any profile in IOR.",
00560 "Attempt to use DII on Local object.",
00561 "Biomolecular Sequence Analysis iterator cannot be reset.",
00562 "Biomolecular Sequence Analysis metadata is not available as XML.",
00563 "Genomic Maps iterator cannot be rest.",
00564 "Operation not implemented in local object"
00565 };
00566
00567 static const char *NO_RESOURCES_TABLE[] =
00568 {
00569 "Portable Interceptor operation not support in this binding.",
00570 "No connection for request's priority."
00571 };
00572
00573 static const char *BAD_INV_ORDER_TABLE[] =
00574 {
00575 "Dependency exists in IFR preventing destruction of this object",
00576 "Attempt to destroy indestructible objects in IFR.",
00577 "Operation would deadlock.",
00578 "ORB has shutdown.",
00579 "Attempt to invoke \"send\" or \"invoke\" operation of the same \"Request\" object more than once.",
00580 "Attempt to set a servant manager after one has already been set.",
00581 "ServerRequest::arguments called more than once or after a call to ServerRequest::set_exception.",
00582 "ServerRequest::ctx called more than once or before ServerRequest::arguments or after ServerRequest::ctx, ServerRequest::set_result or ServerRequest::set_exception.",
00583 "ServerRequest::set_result called more than once or before ServerRequest::arguments or after ServerRequest::set_result or ServerRequest::set_exception.",
00584 "Attempt to send a DII request after it was sent previously.",
00585 "Attempt to poll a DII request or to retrieve its result before the request was sent.",
00586 "Attempt to poll a DII request or to retrieve its result after the result was retrieved previously.",
00587 "Attempt to poll a synchronous DII request or to retrieve results from a synchronous DII request.",
00588 "Invalid portable interceptor call",
00589 "Service context add failed in portable interceptor because a service context with the given id already exists.",
00590 "Registration of PolicyFactory failed because a factory already exists for the given type.",
00591 "POA cannot create POAs while undergoing destruction.",
00592 "Attempt to reassign priority.",
00593 "An OTS/XA integration xa_start call returned XAER_OUTSIDE.",
00594 "An OTS/XA integration xa_call returned XAER_PROTO.",
00595 "Transaction context of request & client threads do not match in interceptor.",
00596 "Poller has not returned any response yet.",
00597 "Registration of TaggedProfileFactory failed because a factory already exists for the given id.",
00598 "Registration of TaggedComponentFactory failed because a factory already exists for the given id.",
00599 "Iteration has no more elements.",
00600 "Invocation of this operation not allowed in post_init."
00601
00602 };
00603
00604 static const char *TRANSIENT_TABLE[] =
00605 {
00606 "Request discarded because of resource exhaustion in POA, or because POA is in discarding state.",
00607 "No usable profile in IOR.",
00608 "Request cancelled.",
00609 "POA destroyed."
00610 };
00611
00612 static const char *OBJ_ADAPTER_TABLE[] =
00613 {
00614 "System exception in AdapterActivator::unknown_adapter.",
00615 "Incorrect servant type returned by servant manager",
00616 "No default servant available [POA policy].",
00617 "No servant manager available [POA policy].",
00618 "Violation of POA policy by ServantActivator::incarnate.",
00619 "Exception in PortableInterceptor::IORInterceptor.components_established.",
00620 "Null servant returned by servant manager."
00621 };
00622
00623 static const char *DATA_CONVERSION_TABLE[] =
00624 {
00625 "Character does not map to negotiated transmission code set.",
00626 "Failure of PriorityMapping object."
00627 };
00628
00629 static const char *OBJECT_NOT_EXIST_TABLE[] =
00630 {
00631 "Attempt to pass an unactivated (unregistered) value as an object reference.",
00632 "Failed to create or locate Object Adapter.",
00633 "Biomolecular Sequence Analysis Service is no longer available.",
00634 "Object Adapter inactive.",
00635 "This Poller has already delivered a reply to some client."
00636 };
00637
00638 static const char *INV_POLICY_TABLE[] =
00639 {
00640 "Unable to reconcile IOR specified policy with the effective policy override.",
00641 "Invalid PolicyType.",
00642 "No PolicyFactory has been registered for the given PolicyType."
00643 };
00644
00645 static const char *ACTIVITY_COMPLETED_TABLE[] =
00646 {
00647 "Activity context completed through timeout, or in some way other then requested."
00648 };
00649
00650 static const char *ACTIVITY_REQUIRED_TABLE[] =
00651 {
00652 "Calling thread lacks required activity context."
00653 };
00654
00655 static const char *BAD_OPERATION_TABLE[] =
00656 {
00657 "ServantManager returned wrong servant type.",
00658 "Operation or attribute not known to target object."
00659 };
00660
00661 static const char *BAD_CONTEXT_TABLE[] =
00662 {
00663 "IDL context not found.",
00664 "No matching IDL context property."
00665 };
00666
00667 static const char *CODESET_INCOMPATIBLE_TABLE[] =
00668 {
00669 "Codeset negotiation failed.",
00670 "Codeset delivered in CodeSetContext is not supported by server as transmission codeset."
00671 };
00672
00673 static const char *INTF_REPOS_TABLE[] =
00674 {
00675 "Interface Repository not available.",
00676 "No entry for requested interface in Interface Repository."
00677 };
00678
00679 static const char *TIMEOUT_TABLE[] =
00680 {
00681 "Reply is not available in the Poller by the timeout set for it.",
00682 "End time specified in RequestEndTimePolicy or RelativeRequestTimeoutPolicy has expired.",
00683 "End time specified in ReplyEndTimePolicy or RelativeReplyTimeoutPolicy has expired."
00684 };
00685
00686 if (minor_code == 0)
00687 return "*unknown description*";
00688
00689 --minor_code;
00690
00691 CORBA::UNKNOWN const * unknown_exception =
00692 dynamic_cast <const CORBA::UNKNOWN *> (&exc);
00693 if (unknown_exception != 0
00694 && minor_code < sizeof UNKNOWN_TABLE / sizeof (char *))
00695 return UNKNOWN_TABLE[minor_code];
00696
00697 CORBA::BAD_PARAM const * bad_param__exception =
00698 dynamic_cast <const CORBA::BAD_PARAM *> (&exc);
00699 if (bad_param__exception != 0
00700 && minor_code < sizeof BAD_PARAM_TABLE / sizeof (char *))
00701 return BAD_PARAM_TABLE[minor_code];
00702
00703 CORBA::IMP_LIMIT const * imp_limit_exception =
00704 dynamic_cast <const CORBA::IMP_LIMIT *> (&exc);
00705 if (imp_limit_exception != 0
00706 && minor_code < sizeof IMP_LIMIT_TABLE / sizeof (char *))
00707 return IMP_LIMIT_TABLE[minor_code];
00708
00709 CORBA::INITIALIZE const * initialize_exception =
00710 dynamic_cast <const CORBA::INITIALIZE *> (&exc);
00711 if (initialize_exception != 0
00712 && minor_code < sizeof INITIALIZE_TABLE / sizeof (char *))
00713 return INITIALIZE_TABLE[minor_code];
00714
00715 CORBA::INV_OBJREF const * inv_objref_exception =
00716 dynamic_cast <const CORBA::INV_OBJREF *> (&exc);
00717 if (inv_objref_exception != 0
00718 && minor_code < sizeof INV_OBJREF_TABLE / sizeof (char *))
00719 return INV_OBJREF_TABLE[minor_code];
00720
00721 CORBA::MARSHAL const * marshal_exception =
00722 dynamic_cast <const CORBA::MARSHAL *> (&exc);
00723 if (marshal_exception != 0
00724 && minor_code < sizeof MARSHAL_TABLE / sizeof (char *))
00725 return MARSHAL_TABLE[minor_code];
00726
00727 CORBA::BAD_TYPECODE const * bad_typecode_exception =
00728 dynamic_cast <const CORBA::BAD_TYPECODE *> (&exc);
00729 if (bad_typecode_exception != 0
00730 && minor_code < sizeof BAD_TYPECODE_TABLE / sizeof (char *))
00731 return BAD_TYPECODE_TABLE[minor_code];
00732
00733 CORBA::NO_IMPLEMENT const * no_implement_exception =
00734 dynamic_cast <const CORBA::NO_IMPLEMENT *> (&exc);
00735 if (no_implement_exception != 0
00736 && minor_code < sizeof NO_IMPLEMENT_TABLE / sizeof (char *))
00737 return NO_IMPLEMENT_TABLE[minor_code];
00738
00739 CORBA::NO_RESOURCES const * no_resource_exception =
00740 dynamic_cast <const CORBA::NO_RESOURCES *> (&exc);
00741 if (no_resource_exception != 0
00742 && minor_code < sizeof NO_RESOURCES_TABLE / sizeof (char *))
00743 return NO_RESOURCES_TABLE[minor_code];
00744
00745 CORBA::BAD_INV_ORDER const * bad_inv_order_exception =
00746 dynamic_cast <const CORBA::BAD_INV_ORDER *> (&exc);
00747 if (bad_inv_order_exception != 0
00748 && minor_code < sizeof BAD_INV_ORDER_TABLE / sizeof (char *))
00749 return BAD_INV_ORDER_TABLE[minor_code];
00750
00751 CORBA::TRANSIENT const * transient_exception =
00752 dynamic_cast <const CORBA::TRANSIENT *> (&exc);
00753 if (transient_exception != 0
00754 && minor_code < sizeof TRANSIENT_TABLE / sizeof (char *))
00755 return TRANSIENT_TABLE[minor_code];
00756
00757 CORBA::OBJ_ADAPTER const * obj_adapter_exception =
00758 dynamic_cast <const CORBA::OBJ_ADAPTER *> (&exc);
00759 if (obj_adapter_exception != 0
00760 && minor_code < sizeof OBJ_ADAPTER_TABLE / sizeof (char *))
00761 return OBJ_ADAPTER_TABLE[minor_code];
00762
00763 CORBA::DATA_CONVERSION const * data_conversion_exception =
00764 dynamic_cast <const CORBA::DATA_CONVERSION *> (&exc);
00765 if (data_conversion_exception != 0
00766 && minor_code < sizeof DATA_CONVERSION_TABLE / sizeof (char *))
00767 return DATA_CONVERSION_TABLE[minor_code];
00768
00769 CORBA::OBJECT_NOT_EXIST const * object_not_exist_exception =
00770 dynamic_cast <const CORBA::OBJECT_NOT_EXIST *> (&exc);
00771 if (object_not_exist_exception != 0
00772 && minor_code < sizeof OBJECT_NOT_EXIST_TABLE / sizeof (char *))
00773 return OBJECT_NOT_EXIST_TABLE[minor_code];
00774
00775 CORBA::INV_POLICY const * inv_policy_exception =
00776 dynamic_cast <const CORBA::INV_POLICY *> (&exc);
00777 if (inv_policy_exception != 0
00778 && minor_code < sizeof INV_POLICY_TABLE / sizeof (char *))
00779 return INV_POLICY_TABLE[minor_code];
00780
00781 CORBA::ACTIVITY_COMPLETED const * activity_completed_exception =
00782 dynamic_cast <const CORBA::ACTIVITY_COMPLETED *> (&exc);
00783 if (activity_completed_exception != 0
00784 && minor_code < sizeof ACTIVITY_COMPLETED_TABLE / sizeof (char *))
00785 return ACTIVITY_COMPLETED_TABLE[minor_code];
00786
00787 CORBA::ACTIVITY_REQUIRED const * activity_required_exception =
00788 dynamic_cast <const CORBA::ACTIVITY_REQUIRED *> (&exc);
00789 if (activity_required_exception != 0
00790 && minor_code < sizeof ACTIVITY_REQUIRED_TABLE / sizeof (char *))
00791 return ACTIVITY_REQUIRED_TABLE[minor_code];
00792
00793 CORBA::BAD_OPERATION const * bad_operation_exception =
00794 dynamic_cast <const CORBA::BAD_OPERATION *> (&exc);
00795 if (bad_operation_exception != 0
00796 && minor_code < sizeof BAD_OPERATION_TABLE / sizeof (char *))
00797 return BAD_OPERATION_TABLE[minor_code];
00798
00799 CORBA::BAD_CONTEXT const * bad_context_exception =
00800 dynamic_cast <const CORBA::BAD_CONTEXT *> (&exc);
00801 if (bad_context_exception != 0
00802 && minor_code < sizeof BAD_CONTEXT_TABLE / sizeof (char *))
00803 return BAD_CONTEXT_TABLE[minor_code];
00804
00805 CORBA::CODESET_INCOMPATIBLE const * codeset_incompatible_exception =
00806 dynamic_cast <const CORBA::CODESET_INCOMPATIBLE *> (&exc);
00807 if (codeset_incompatible_exception != 0
00808 && minor_code < sizeof CODESET_INCOMPATIBLE_TABLE / sizeof (char *))
00809 return CODESET_INCOMPATIBLE_TABLE[minor_code];
00810
00811 CORBA::INTF_REPOS const * intf_repos_exception =
00812 dynamic_cast <const CORBA::INTF_REPOS *> (&exc);
00813 if (intf_repos_exception != 0
00814 && minor_code < sizeof INTF_REPOS_TABLE / sizeof (char *))
00815 return INTF_REPOS_TABLE[minor_code];
00816
00817 CORBA::TIMEOUT const * timeout_exception =
00818 dynamic_cast <const CORBA::TIMEOUT *> (&exc);
00819 if (timeout_exception != 0
00820 && minor_code < sizeof TIMEOUT_TABLE / sizeof (char *))
00821 return TIMEOUT_TABLE[minor_code];
00822
00823 #else
00824 ACE_UNUSED_ARG (exc);
00825 ACE_UNUSED_ARG (minor_code);
00826 #endif
00827
00828 return "*unknown description*";
00829 }
00830
00831 TAO_END_VERSIONED_NAMESPACE_DECL
00832
00833 #if defined (THREAD_CANCELLED)
00834 #undef THREAD_CANCELLED
00835 #endif
00836
00837
00838
00839
00840
00841
00842 #define STANDARD_EXCEPTION_LIST \
00843 TAO_SYSTEM_EXCEPTION (UNKNOWN) \
00844 TAO_SYSTEM_EXCEPTION (BAD_PARAM) \
00845 TAO_SYSTEM_EXCEPTION (NO_MEMORY) \
00846 TAO_SYSTEM_EXCEPTION (IMP_LIMIT) \
00847 TAO_SYSTEM_EXCEPTION (COMM_FAILURE) \
00848 TAO_SYSTEM_EXCEPTION (INV_OBJREF) \
00849 TAO_SYSTEM_EXCEPTION (OBJECT_NOT_EXIST) \
00850 TAO_SYSTEM_EXCEPTION (NO_PERMISSION) \
00851 TAO_SYSTEM_EXCEPTION (INTERNAL) \
00852 TAO_SYSTEM_EXCEPTION (MARSHAL) \
00853 TAO_SYSTEM_EXCEPTION (INITIALIZE) \
00854 TAO_SYSTEM_EXCEPTION (NO_IMPLEMENT) \
00855 TAO_SYSTEM_EXCEPTION (BAD_TYPECODE) \
00856 TAO_SYSTEM_EXCEPTION (BAD_OPERATION) \
00857 TAO_SYSTEM_EXCEPTION (NO_RESOURCES) \
00858 TAO_SYSTEM_EXCEPTION (NO_RESPONSE) \
00859 TAO_SYSTEM_EXCEPTION (PERSIST_STORE) \
00860 TAO_SYSTEM_EXCEPTION (BAD_INV_ORDER) \
00861 TAO_SYSTEM_EXCEPTION (TRANSIENT) \
00862 TAO_SYSTEM_EXCEPTION (FREE_MEM) \
00863 TAO_SYSTEM_EXCEPTION (INV_IDENT) \
00864 TAO_SYSTEM_EXCEPTION (INV_FLAG) \
00865 TAO_SYSTEM_EXCEPTION (INTF_REPOS) \
00866 TAO_SYSTEM_EXCEPTION (BAD_CONTEXT) \
00867 TAO_SYSTEM_EXCEPTION (OBJ_ADAPTER) \
00868 TAO_SYSTEM_EXCEPTION (DATA_CONVERSION) \
00869 TAO_SYSTEM_EXCEPTION (INV_POLICY) \
00870 TAO_SYSTEM_EXCEPTION (REBIND) \
00871 TAO_SYSTEM_EXCEPTION (TIMEOUT) \
00872 TAO_SYSTEM_EXCEPTION (TRANSACTION_UNAVAILABLE) \
00873 TAO_SYSTEM_EXCEPTION (TRANSACTION_MODE) \
00874 TAO_SYSTEM_EXCEPTION (TRANSACTION_REQUIRED) \
00875 TAO_SYSTEM_EXCEPTION (TRANSACTION_ROLLEDBACK) \
00876 TAO_SYSTEM_EXCEPTION (INVALID_TRANSACTION) \
00877 TAO_SYSTEM_EXCEPTION (CODESET_INCOMPATIBLE) \
00878 TAO_SYSTEM_EXCEPTION (BAD_QOS) \
00879 TAO_SYSTEM_EXCEPTION (INVALID_ACTIVITY) \
00880 TAO_SYSTEM_EXCEPTION (ACTIVITY_COMPLETED) \
00881 TAO_SYSTEM_EXCEPTION (ACTIVITY_REQUIRED) \
00882 TAO_SYSTEM_EXCEPTION (THREAD_CANCELLED)
00883
00884 static const char *repo_id_array[] = {
00885 #define TAO_SYSTEM_EXCEPTION(name) \
00886 (char *) "IDL:omg.org/CORBA/" #name ":1.0",
00887 STANDARD_EXCEPTION_LIST
00888 #undef TAO_SYSTEM_EXCEPTION
00889 0
00890 };
00891
00892
00893 static const CORBA::ULong array_sz =
00894 (sizeof (repo_id_array) / sizeof (char const *)) - 1;
00895
00896 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00897
00898 TAO::excp_factory excp_array [] = {
00899 #define TAO_SYSTEM_EXCEPTION(name) \
00900 &CORBA::name::_tao_create,
00901 STANDARD_EXCEPTION_LIST
00902 #undef TAO_SYSTEM_EXCEPTION
00903 0
00904 };
00905
00906
00907 #define TAO_SYSTEM_EXCEPTION(name) \
00908 CORBA::name ::name (void) \
00909 : CORBA::SystemException ("IDL:omg.org/CORBA/" #name ":1.0", \
00910 #name, \
00911 0, \
00912 CORBA::COMPLETED_NO) \
00913 { \
00914 } \
00915 \
00916 CORBA::name ::name (CORBA::ULong code, CORBA::CompletionStatus completed) \
00917 : CORBA::SystemException ("IDL:omg.org/CORBA/" #name ":1.0", \
00918 #name, \
00919 code, \
00920 completed) \
00921 { \
00922 }
00923
00924 STANDARD_EXCEPTION_LIST
00925 #undef TAO_SYSTEM_EXCEPTION
00926
00927 #define TAO_SYSTEM_EXCEPTION(name) \
00928 CORBA::TypeCode_ptr \
00929 CORBA::name ::_tao_type (void) const \
00930 { \
00931 TAO_AnyTypeCode_Adapter *adapter = \
00932 ACE_Dynamic_Service<TAO_AnyTypeCode_Adapter>::instance ( \
00933 "AnyTypeCode_Adapter" \
00934 ); \
00935 if (adapter != 0) \
00936 return adapter->_tao_type_ ## name (); \
00937 else \
00938 { \
00939 ACE_ERROR ((LM_ERROR, \
00940 ACE_TEXT ("(%P|%t) %p\n"), \
00941 ACE_TEXT ("Unable to find the ") \
00942 ACE_TEXT ("AnyTypeCode Adapter instance"))); \
00943 return 0; \
00944 } \
00945 }
00946
00947 STANDARD_EXCEPTION_LIST
00948 #undef TAO_SYSTEM_EXCEPTION
00949
00950 CORBA::SystemException *
00951 TAO::create_system_exception (const char *id)
00952 {
00953 for (CORBA::ULong i = 0; i < array_sz; ++i)
00954 {
00955 if (ACE_OS::strcmp (id, repo_id_array[i]) == 0)
00956 return (*(excp_array[i])) ();
00957 }
00958
00959 return 0;
00960 }
00961
00962 #define TAO_SYSTEM_EXCEPTION(name) \
00963 void \
00964 CORBA::name ::_raise (void) const \
00965 { \
00966 throw *this; \
00967 }
00968
00969 STANDARD_EXCEPTION_LIST
00970 #undef TAO_SYSTEM_EXCEPTION
00971
00972 #define TAO_SYSTEM_EXCEPTION(name) \
00973 CORBA::Exception * \
00974 CORBA::name ::_tao_duplicate (void) const \
00975 { \
00976 CORBA::Exception * result = 0; \
00977 ACE_NEW_RETURN (result, CORBA::name (*this), 0); \
00978 return result; \
00979 }
00980
00981 STANDARD_EXCEPTION_LIST
00982 #undef TAO_SYSTEM_EXCEPTION
00983
00984 #define TAO_SYSTEM_EXCEPTION(name) \
00985 CORBA::SystemException * \
00986 CORBA::name ::_tao_create (void) \
00987 { \
00988 CORBA::name *result = 0; \
00989 ACE_NEW_RETURN (result, CORBA::name (), 0); \
00990 return result; \
00991 }
00992
00993 STANDARD_EXCEPTION_LIST
00994 #undef TAO_SYSTEM_EXCEPTION
00995
00996 TAO_END_VERSIONED_NAMESPACE_DECL