OpenDDS  Snapshot(2023/04/28-20:55)
SystemException.cpp
Go to the documentation of this file.
1 #include "tao/SystemException.h"
2 #include "tao/ORB_Constants.h"
3 #include "tao/CORBA_String.h"
4 #include "tao/debug.h"
6 
7 #include "ace/Malloc.h"
8 #include "ace/SString.h"
9 #include "ace/OS_NS_string.h"
10 #include "ace/OS_NS_stdio.h"
11 
12 #if !defined (__ACE_INLINE__)
13 # include "tao/SystemException.inl"
14 #endif /* __ACE_INLINE__ */
15 
17 
18 /**
19  * @name @c errno Encoding
20  *
21  * The @c errno encoding is located in the bottom 7 bits.
22  */
23 //@{
45 // *Don't* use TAO_<errno>_MINOR_CODE greater than 0x7FU!
46 //@}
47 
48 // ****************************************************************
49 
51  : minor_ (0),
52  completed_ (CORBA::COMPLETED_NO)
53 {
54 }
55 
56 CORBA::SystemException::SystemException (const char *repository_id,
57  const char *local_name,
59  CORBA::CompletionStatus completed)
60  : CORBA::Exception (repository_id,
61  local_name),
62  minor_ (code),
63  completed_ (completed)
64 {
65 }
66 
68  CORBA::CompletionStatus completed)
69  : minor_ (code),
70  completed_ (completed)
71 {
72 }
73 
75  : CORBA::Exception (src),
76  minor_ (src.minor_),
77  completed_ (src.completed_)
78 {
79 }
80 
82 {
83 }
84 
87 {
88  this->Exception::operator= (src);
89 
90  this->minor_ = src.minor_;
91  this->completed_ = src.completed_;
92 
93  return *this;
94 }
95 
96 void
98 {
99  throw ::CORBA::MARSHAL ();
100 }
101 
102 void
104 {
105  throw ::CORBA::MARSHAL ();
106 }
107 
109 CORBA::SystemException::_tao_errno (int errno_value)
110 {
111  switch (errno_value)
112  {
113  case 0:
115  case ETIMEDOUT:
117  case ENFILE:
118  return TAO_ENFILE_MINOR_CODE;
119  case EPIPE:
120  return TAO_EPIPE_MINOR_CODE;
121  case ECONNREFUSED:
123  case ENOENT:
124  return TAO_ENOENT_MINOR_CODE;
125 
126 #if !defined (ACE_HAS_WINCE)
127  case EMFILE:
128  return TAO_EMFILE_MINOR_CODE;
129  case EBADF:
130  return TAO_EBADF_MINOR_CODE;
131  case EPERM:
132  return TAO_EPERM_MINOR_CODE;
133  case EINVAL:
134  return TAO_EINVAL_MINOR_CODE;
135 #endif // ACE_HAS_WINCE
136 
137 #if (ENOSYS != EFAULT)
138  case ENOSYS:
139  return TAO_ENOSYS_MINOR_CODE;
140 #endif /* ENOSYS != EFAULT */
141  case EAFNOSUPPORT:
143  case EAGAIN:
144  return TAO_EAGAIN_MINOR_CODE;
145  case ENOMEM:
146  return TAO_ENOMEM_MINOR_CODE;
147  case EACCES:
148  return TAO_EACCES_MINOR_CODE;
149  case EFAULT:
150  return TAO_EFAULT_MINOR_CODE;
151  case EBUSY:
152  return TAO_EBUSY_MINOR_CODE;
153  case EEXIST:
154  return TAO_EEXIST_MINOR_CODE;
155  case ECOMM:
156  return TAO_ECOMM_MINOR_CODE;
157  case ECONNRESET:
159 #if (ENOTSUP != ENOSYS)
160  case ENOTSUP:
161  return TAO_ENOTSUP_MINOR_CODE;
162 #endif /* ENOSYS != EFAULT */
163  default:
164  // Mask off bottom 7 bits and return them.
165  return errno_value & 0x7FU;
166  }
167 }
168 
171 {
172  return 0;
173 }
174 
176 CORBA::SystemException::_tao_minor_code (u_int location, int errno_value)
177 {
178  return
179  TAO::VMCID
180  | location
181  | _tao_errno (errno_value);
182 }
183 
184 void
186 {
188  ACE_TEXT("(%P|%t) system exception, ID '%C'\n"),
189  this->_info ().c_str ()));
190 }
191 
194 {
195  // @@ there are a few other "user exceptions" in the CORBA scope,
196  // they're not all standard/system exceptions ... really need to
197  // either compare exhaustively against all those IDs (yeech) or
198  // (preferably) to represent the exception type directly in the
199  // exception value so it can be queried.
200 
201  ACE_CString info = "system exception, ID '";
202  info += this->_rep_id ();
203  info += "'\n";
204 
205  CORBA::ULong const VMCID = this->minor () & 0xFFFFF000u;
206 
207  if (VMCID == TAO::VMCID)
208  {
209  // @@ Move the following code to a subroutine, it is too long already!
210  const char *location = 0;
211  switch (this->minor () & 0x00000F80u)
212  {
214  location = "location forward failed";
215  break;
217  location = "send request failed";
218  break;
219  case TAO_POA_DISCARDING:
220  location = "poa in discarding state";
221  break;
222  case TAO_POA_HOLDING:
223  location = "poa in holding state";
224  break;
225  case TAO_POA_INACTIVE:
226  location = "poa in inactive state";
227  break;
229  location = "unhandled c++ exception in server side";
230  break;
232  location = "failed to recv request response";
233  break;
235  location = "all protocols failed to parse the IOR";
236  break;
238  location = "error during MProfile creation";
239  break;
241  location = "timeout during connect";
242  break;
244  location = "timeout during send";
245  break;
247  location = "timeout during recv";
248  break;
250  location = "implrepo server exception";
251  break;
253  location = "endpoint initialization failure in Acceptor Registry";
254  break;
256  location = "ORB Core initialization failed";
257  break;
259  location = "Failure when narrowing a Policy";
260  break;
261  case TAO_GUARD_FAILURE:
262  location = "Failure when trying to acquire a guard/monitor";
263  break;
265  location = "POA has been destroyed or is currently being destroyed";
266  break;
268  location = "Failure when trying to send AMH reply";
269  break;
271  location = "Failure in thread creation for RTCORBA thread pool";
272  break;
273  default:
274  location = "unknown location";
275  }
276 
277  const char *errno_indication;
278  char unknown_errno [255];
279  CORBA::ULong minor_code = this->minor () & 0x7FU;
280  switch (minor_code)
281  {
283  errno_indication = "unspecified errno";
284  break;
286  errno_indication = "ETIMEOUT";
287  break;
289  errno_indication = "ENFILE";
290  break;
292  errno_indication = "EMFILE";
293  break;
295  errno_indication = "EPIPE";
296  break;
298  errno_indication = "ECONNREFUSED";
299  break;
301  errno_indication = "ENOENT";
302  break;
304  errno_indication = "EBADF";
305  break;
307  errno_indication = "ENOSYS";
308  break;
310  errno_indication = "EPERM";
311  break;
313  errno_indication = "EAFNOSUPPORT";
314  break;
316  errno_indication = "EAGAIN";
317  break;
319  errno_indication = "ENOMEM";
320  break;
322  errno_indication = "EACCES";
323  break;
325  errno_indication = "EFAULT";
326  break;
328  errno_indication = "EBUSY";
329  break;
331  errno_indication = "EEXIST";
332  break;
334  errno_indication = "EINVAL";
335  break;
337  errno_indication = "ECOMM";
338  break;
340  errno_indication = "ECONNRESET";
341  break;
343  errno_indication = "ENOTSUP";
344  break;
345  default:
346  {
347  // 7 bits of some other errno.
348  ACE_OS::snprintf (unknown_errno,
349  255,
350  "low 7 bits of errno: %3u %s",
351  minor_code, ACE_OS::strerror (minor_code));
352 
353  errno_indication = unknown_errno;
354  }
355  }
356 
357  char buffer[BUFSIZ];
358  ACE_OS::snprintf (buffer,
359  BUFSIZ,
360  "TAO exception, "
361  "minor code = %x (%s; %s), "
362  "completed = %s\n",
363  minor_code,
364  location,
365  errno_indication,
366  (completed () == CORBA::COMPLETED_YES) ? "YES" :
367  (completed () == CORBA::COMPLETED_NO) ? "NO" :
368  (completed () == CORBA::COMPLETED_MAYBE) ? "MAYBE" :
369  "garbage");
370 
371  info += buffer;
372  }
373  else if (VMCID == CORBA::OMGVMCID)
374  {
375  CORBA::ULong const minor_code = this->minor () & 0xFFFU;
376 
377  const char *minor_description = 0;
378 
379  if (minor_code > 0)
380  minor_description =
382  *this,
383  minor_code);
384  else
385  minor_description = "*unknown description*";
386 
387  char buffer[BUFSIZ];
388  ACE_OS::snprintf (buffer,
389  BUFSIZ,
390  "OMG minor code (%d), "
391  "described as '%s', "
392  "completed = %s\n",
393  minor_code,
394  minor_description,
395  (completed () == CORBA::COMPLETED_YES) ? "YES" :
396  (completed () == CORBA::COMPLETED_NO) ? "NO" :
397  (completed () == CORBA::COMPLETED_MAYBE) ? "MAYBE" :
398  "garbage");
399 
400  info += buffer;
401  }
402  else
403  {
404  char buffer[BUFSIZ];
405  ACE_OS::snprintf (buffer,
406  BUFSIZ,
407  "Unknown vendor minor code id (%x), "
408  "minor code = %x, completed = %s\n",
409  VMCID,
410  this->minor (), // Use the raw minor code
411  (completed () == CORBA::COMPLETED_YES) ? "YES" :
412  (completed () == CORBA::COMPLETED_NO) ? "NO" :
413  (completed () == CORBA::COMPLETED_MAYBE) ? "MAYBE" :
414  "garbage");
415 
416  info += buffer;
417  }
418 
419  return info;
420 }
421 
422 const char *
424  const CORBA::SystemException &exc,
425  CORBA::ULong minor_code)
426 {
427 #ifndef ACE_NDEBUG
428 
429  static const char *UNKNOWN_TABLE[] =
430  {
431  "Unlisted user exception received by client.", // 1
432  "Non-standard SystemException not supported.", // 2
433  "An unknown user exception received by a portable interceptor." // 3
434  };
435 
436  static const char *BAD_PARAM_TABLE[] =
437  {
438  "Failure to register, unregister, or lookup value factory.", // 1
439  "RID already defined in IFR.", // 2
440  "Name already used in the context in IFR.", // 3
441  "Target is not a valid container.", // 4
442  "Name clash in inherited context.", // 5
443  "Incorrect type for abstract interface.", // 6
444  "string_to_object conversion failed due to a bad scheme name.", // 7
445  "string_to_object conversion failed due to a bad address.", // 8
446  "string_to_object conversion failed due to a bad schema specific part.",// 9
447  "string_to_object conversion failed due to non specific reason.", // 10
448  "Attempt to derive abstract interface from non-abstract base interface in the Interface Repository.", // 11
449  "Attempt to let a ValueDef support more than one non-abstract interface in the Interface Repository.", // 12
450  "Attempt to use an incomplete TypeCode as a parameter.", // 13
451  "Invalid object id passed to POA::create_reference_by_id.", // 14
452  "Bad name argument in TypeCode operation.", // 15
453  "Bad RepositoryId argument in TypeCode operation.", // 16
454  "Invalid member name in TypeCode operation.", // 17
455  "Duplicate label value in create_union_tc.", // 18
456  "Incompatible TypeCode of label and discriminator in create_union_tc.", // 19
457  "Supplied discriminator type illegitimate in create_union_tc.", // 20
458  "Any passed to ServerRequest::set_exception does not contain an exception.", // 21
459  "Unlisted user exception passed to ServerRequest::set_exception", // 22
460  "wchar transmission code set not in service context.", // 23
461  "Service context is not in OMG-defined range.", // 24
462  "Enum value out of range.", // 25
463  "Invalid service context Id in portable interceptor.", // 26
464  "Attempt to call register_initial_reference with a null Object.", // 27
465  "Invalid component Id in portable interceptor.", // 28
466  "Invalid profile Id in portable interceptor.", // 29
467  "Two or more Policy objects with the same PolicyType value supplied to Object::set_policy_overrides or PolicyManager::set_policy_overrides." // 30
468  "Attempt to define a oneway operation with non-void result, out or inout parameters or user exceptions.", // 31
469  "DII asked to create request for an implicit operation.", // 32,
470  "An OTS/XA integration xa_ call returned XAER_INVAL.", // 33
471  "Union branch modifier called with bad case label discriminator.", // 34
472  "Illegal IDL context property name.", // 35
473  "Illegal IDL property search string.", // 36
474  "Illegal IDL context name.", // 37
475  "Non-empty IDL context.", // 38
476  "Unsupported RMI/IDL customer value type stream format.", // 39
477  "ORB output stream does not support ValueOutputStream interface.", // 40
478  "ORB input stream does not support ValueInputStream interface.", // 41
479  "Character support limited to ISO 8859-1 for this object reference", // 42
480  "Attempt to add a Pollable to a second PollableSet." // 43
481  };
482 
483  static const char *IMP_LIMIT_TABLE[] =
484  {
485  "Unable to use any profile in IOR." // 1
486  };
487 
488  static const char *INITIALIZE_TABLE[] =
489  {
490  "Priority range too restricted for ORB." // 1
491  };
492 
493 
494  static const char *INV_OBJREF_TABLE[] =
495  {
496  "wchar Code Set support not specified.", // 1
497  "Codeset component required for type using wchar or wstring data." // 2
498  };
499 
500  static const char *MARSHAL_TABLE[] =
501  {
502  "Unable to locate value factory.", // 1
503  "ServerRequest::set_result called before ServerRequest::ctx when the operation IDL contains a context clause.", // 2
504  "NVList passed to ServerRequest::arguments does not describe all parameters passed by client.", // 3
505  "Attempt to marshal Local object.", // 4
506  "wchar or wstring data erroneously sent by client over GIOP 1.0 connection.", // 5
507  "wchar or wstring data erroneously returned by server over GIOP 1.0 connection.", //6
508  "Unsupported RMI/IDL custom value type stream format.", // 7
509  "Custom data not compatible with ValueHandler read operation.", // 8
510  "Codeset service contexts with different values received on the same connection." // 9
511 
512  };
513 
514  static const char *BAD_TYPECODE_TABLE[] =
515  {
516  "Attempt to marshal incomplete TypeCode.", // 1
517  "Member type code illegitimate in TypeCode operation.", // 2
518  "Illegal parameter type." // 3
519  };
520 
521  static const char *NO_IMPLEMENT_TABLE[] =
522  {
523  "Missing local value implementation.", // 1
524  "Incompatible value implementation version.", // 2
525  "Unable to use any profile in IOR.", // 3
526  "Attempt to use DII on Local object.", // 4
527  "Biomolecular Sequence Analysis iterator cannot be reset.", // 5
528  "Biomolecular Sequence Analysis metadata is not available as XML.", // 6
529  "Genomic Maps iterator cannot be rest.", // 7
530  "Operation not implemented in local object" // 8
531  };
532 
533  static const char *NO_RESOURCES_TABLE[] =
534  {
535  "Portable Interceptor operation not support in this binding.", // 1
536  "No connection for request's priority." // 2
537  };
538 
539  static const char *BAD_INV_ORDER_TABLE[] =
540  {
541  "Dependency exists in IFR preventing destruction of this object", // 1
542  "Attempt to destroy indestructible objects in IFR.", // 2
543  "Operation would deadlock.", // 3
544  "ORB has shutdown.", // 4
545  "Attempt to invoke \"send\" or \"invoke\" operation of the same \"Request\" object more than once.", // 5
546  "Attempt to set a servant manager after one has already been set.", // 6
547  "ServerRequest::arguments called more than once or after a call to ServerRequest::set_exception.", // 7
548  "ServerRequest::ctx called more than once or before ServerRequest::arguments or after ServerRequest::ctx, ServerRequest::set_result or ServerRequest::set_exception.", // 8
549  "ServerRequest::set_result called more than once or before ServerRequest::arguments or after ServerRequest::set_result or ServerRequest::set_exception.", // 9
550  "Attempt to send a DII request after it was sent previously.", // 10
551  "Attempt to poll a DII request or to retrieve its result before the request was sent.", // 11
552  "Attempt to poll a DII request or to retrieve its result after the result was retrieved previously.", // 12
553  "Attempt to poll a synchronous DII request or to retrieve results from a synchronous DII request.", // 13
554  "Invalid portable interceptor call", // 14
555  "Service context add failed in portable interceptor because a service context with the given id already exists.", // 15
556  "Registration of PolicyFactory failed because a factory already exists for the given type.", // 16
557  "POA cannot create POAs while undergoing destruction.", // 17
558  "Attempt to reassign priority.", // 18
559  "An OTS/XA integration xa_start call returned XAER_OUTSIDE.", // 19
560  "An OTS/XA integration xa_call returned XAER_PROTO.", // 20
561  "Transaction context of request & client threads do not match in interceptor.", // 21
562  "Poller has not returned any response yet.", // 22
563  "Registration of TaggedProfileFactory failed because a factory already exists for the given id.", // 23
564  "Registration of TaggedComponentFactory failed because a factory already exists for the given id.", // 24
565  "Iteration has no more elements.", // 25
566  "Invocation of this operation not allowed in post_init." // 26
567 
568  };
569 
570  static const char *TRANSIENT_TABLE[] =
571  {
572  "Request discarded because of resource exhaustion in POA, or because POA is in discarding state.", // 1
573  "No usable profile in IOR.", // 2
574  "Request cancelled.", // 3
575  "POA destroyed." // 4
576  };
577 
578  static const char *OBJ_ADAPTER_TABLE[] =
579  {
580  "System exception in AdapterActivator::unknown_adapter.", // 1
581  "Incorrect servant type returned by servant manager", // 2
582  "No default servant available [POA policy].", // 3
583  "No servant manager available [POA policy].", // 4
584  "Violation of POA policy by ServantActivator::incarnate.",// 5
585  "Exception in PortableInterceptor::IORInterceptor.components_established.", // 6
586  "Null servant returned by servant manager." // 7
587  };
588 
589  static const char *DATA_CONVERSION_TABLE[] =
590  {
591  "Character does not map to negotiated transmission code set.", // 1
592  "Failure of PriorityMapping object." // 2
593  };
594 
595  static const char *OBJECT_NOT_EXIST_TABLE[] =
596  {
597  "Attempt to pass an unactivated (unregistered) value as an object reference.", // 1
598  "Failed to create or locate Object Adapter.", // 2
599  "Biomolecular Sequence Analysis Service is no longer available.", // 3
600  "Object Adapter inactive.", // 4
601  "This Poller has already delivered a reply to some client." // 5
602  };
603 
604  static const char *INV_POLICY_TABLE[] =
605  {
606  "Unable to reconcile IOR specified policy with the effective policy override.", // 1
607  "Invalid PolicyType.", // 2
608  "No PolicyFactory has been registered for the given PolicyType." // 3
609  };
610 
611  static const char *ACTIVITY_COMPLETED_TABLE[] =
612  {
613  "Activity context completed through timeout, or in some way other then requested." // 1
614  };
615 
616  static const char *ACTIVITY_REQUIRED_TABLE[] =
617  {
618  "Calling thread lacks required activity context." // 1
619  };
620 
621  static const char *BAD_OPERATION_TABLE[] =
622  {
623  "ServantManager returned wrong servant type.", // 1
624  "Operation or attribute not known to target object." // 2
625  };
626 
627  static const char *BAD_CONTEXT_TABLE[] =
628  {
629  "IDL context not found.", // 1
630  "No matching IDL context property." // 2
631  };
632 
633  static const char *CODESET_INCOMPATIBLE_TABLE[] =
634  {
635  "Codeset negotiation failed.", // 1
636  "Codeset delivered in CodeSetContext is not supported by server as transmission codeset." // 2
637  };
638 
639  static const char *INTF_REPOS_TABLE[] =
640  {
641  "Interface Repository not available.", // 1
642  "No entry for requested interface in Interface Repository." // 2
643  };
644 
645  if (minor_code == 0)
646  return "*unknown description*";
647 
648  --minor_code; // Adjust to match table offset.
649 
650  CORBA::UNKNOWN const * unknown_exception =
651  dynamic_cast <const CORBA::UNKNOWN *> (&exc);
652  if (unknown_exception != 0
653  && minor_code < sizeof UNKNOWN_TABLE / sizeof (char *))
654  return UNKNOWN_TABLE[minor_code];
655 
656  CORBA::BAD_PARAM const * bad_param__exception =
657  dynamic_cast <const CORBA::BAD_PARAM *> (&exc);
658  if (bad_param__exception != 0
659  && minor_code < sizeof BAD_PARAM_TABLE / sizeof (char *))
660  return BAD_PARAM_TABLE[minor_code];
661 
662  CORBA::IMP_LIMIT const * imp_limit_exception =
663  dynamic_cast <const CORBA::IMP_LIMIT *> (&exc);
664  if (imp_limit_exception != 0
665  && minor_code < sizeof IMP_LIMIT_TABLE / sizeof (char *))
666  return IMP_LIMIT_TABLE[minor_code];
667 
668  CORBA::INITIALIZE const * initialize_exception =
669  dynamic_cast <const CORBA::INITIALIZE *> (&exc);
670  if (initialize_exception != 0
671  && minor_code < sizeof INITIALIZE_TABLE / sizeof (char *))
672  return INITIALIZE_TABLE[minor_code];
673 
674  CORBA::INV_OBJREF const * inv_objref_exception =
675  dynamic_cast <const CORBA::INV_OBJREF *> (&exc);
676  if (inv_objref_exception != 0
677  && minor_code < sizeof INV_OBJREF_TABLE / sizeof (char *))
678  return INV_OBJREF_TABLE[minor_code];
679 
680  CORBA::MARSHAL const * marshal_exception =
681  dynamic_cast <const CORBA::MARSHAL *> (&exc);
682  if (marshal_exception != 0
683  && minor_code < sizeof MARSHAL_TABLE / sizeof (char *))
684  return MARSHAL_TABLE[minor_code];
685 
686  CORBA::BAD_TYPECODE const * bad_typecode_exception =
687  dynamic_cast <const CORBA::BAD_TYPECODE *> (&exc);
688  if (bad_typecode_exception != 0
689  && minor_code < sizeof BAD_TYPECODE_TABLE / sizeof (char *))
690  return BAD_TYPECODE_TABLE[minor_code];
691 
692  CORBA::NO_IMPLEMENT const * no_implement_exception =
693  dynamic_cast <const CORBA::NO_IMPLEMENT *> (&exc);
694  if (no_implement_exception != 0
695  && minor_code < sizeof NO_IMPLEMENT_TABLE / sizeof (char *))
696  return NO_IMPLEMENT_TABLE[minor_code];
697 
698  CORBA::NO_RESOURCES const * no_resource_exception =
699  dynamic_cast <const CORBA::NO_RESOURCES *> (&exc);
700  if (no_resource_exception != 0
701  && minor_code < sizeof NO_RESOURCES_TABLE / sizeof (char *))
702  return NO_RESOURCES_TABLE[minor_code];
703 
704  CORBA::BAD_INV_ORDER const * bad_inv_order_exception =
705  dynamic_cast <const CORBA::BAD_INV_ORDER *> (&exc);
706  if (bad_inv_order_exception != 0
707  && minor_code < sizeof BAD_INV_ORDER_TABLE / sizeof (char *))
708  return BAD_INV_ORDER_TABLE[minor_code];
709 
710  CORBA::TRANSIENT const * transient_exception =
711  dynamic_cast <const CORBA::TRANSIENT *> (&exc);
712  if (transient_exception != 0
713  && minor_code < sizeof TRANSIENT_TABLE / sizeof (char *))
714  return TRANSIENT_TABLE[minor_code];
715 
716  CORBA::OBJ_ADAPTER const * obj_adapter_exception =
717  dynamic_cast <const CORBA::OBJ_ADAPTER *> (&exc);
718  if (obj_adapter_exception != 0
719  && minor_code < sizeof OBJ_ADAPTER_TABLE / sizeof (char *))
720  return OBJ_ADAPTER_TABLE[minor_code];
721 
722  CORBA::DATA_CONVERSION const * data_conversion_exception =
723  dynamic_cast <const CORBA::DATA_CONVERSION *> (&exc);
724  if (data_conversion_exception != 0
725  && minor_code < sizeof DATA_CONVERSION_TABLE / sizeof (char *))
726  return DATA_CONVERSION_TABLE[minor_code];
727 
728  CORBA::OBJECT_NOT_EXIST const * object_not_exist_exception =
729  dynamic_cast <const CORBA::OBJECT_NOT_EXIST *> (&exc);
730  if (object_not_exist_exception != 0
731  && minor_code < sizeof OBJECT_NOT_EXIST_TABLE / sizeof (char *))
732  return OBJECT_NOT_EXIST_TABLE[minor_code];
733 
734  CORBA::INV_POLICY const * inv_policy_exception =
735  dynamic_cast <const CORBA::INV_POLICY *> (&exc);
736  if (inv_policy_exception != 0
737  && minor_code < sizeof INV_POLICY_TABLE / sizeof (char *))
738  return INV_POLICY_TABLE[minor_code];
739 
740  CORBA::ACTIVITY_COMPLETED const * activity_completed_exception =
741  dynamic_cast <const CORBA::ACTIVITY_COMPLETED *> (&exc);
742  if (activity_completed_exception != 0
743  && minor_code < sizeof ACTIVITY_COMPLETED_TABLE / sizeof (char *))
744  return ACTIVITY_COMPLETED_TABLE[minor_code];
745 
746  CORBA::ACTIVITY_REQUIRED const * activity_required_exception =
747  dynamic_cast <const CORBA::ACTIVITY_REQUIRED *> (&exc);
748  if (activity_required_exception != 0
749  && minor_code < sizeof ACTIVITY_REQUIRED_TABLE / sizeof (char *))
750  return ACTIVITY_REQUIRED_TABLE[minor_code];
751 
752  CORBA::BAD_OPERATION const * bad_operation_exception =
753  dynamic_cast <const CORBA::BAD_OPERATION *> (&exc);
754  if (bad_operation_exception != 0
755  && minor_code < sizeof BAD_OPERATION_TABLE / sizeof (char *))
756  return BAD_OPERATION_TABLE[minor_code];
757 
758  CORBA::BAD_CONTEXT const * bad_context_exception =
759  dynamic_cast <const CORBA::BAD_CONTEXT *> (&exc);
760  if (bad_context_exception != 0
761  && minor_code < sizeof BAD_CONTEXT_TABLE / sizeof (char *))
762  return BAD_CONTEXT_TABLE[minor_code];
763 
764  CORBA::CODESET_INCOMPATIBLE const * codeset_incompatible_exception =
765  dynamic_cast <const CORBA::CODESET_INCOMPATIBLE *> (&exc);
766  if (codeset_incompatible_exception != 0
767  && minor_code < sizeof CODESET_INCOMPATIBLE_TABLE / sizeof (char *))
768  return CODESET_INCOMPATIBLE_TABLE[minor_code];
769 
770  CORBA::INTF_REPOS const * intf_repos_exception =
771  dynamic_cast <const CORBA::INTF_REPOS *> (&exc);
772  if (intf_repos_exception != 0
773  && minor_code < sizeof INTF_REPOS_TABLE / sizeof (char *))
774  return INTF_REPOS_TABLE[minor_code];
775 
776 #else
777  ACE_UNUSED_ARG (exc);
778  ACE_UNUSED_ARG (minor_code);
779 #endif /* !ACE_NDEBUG */
780 
781  return "*unknown description*";
782 }
783 
785 
786 #if defined (THREAD_CANCELLED)
787 #undef THREAD_CANCELLED
788 #endif /* THREAD_CANCELLED */
789 
790 // List of standard/system exceptions ... used to create static
791 // storage for their typecodes, then later to initialize that storage
792 // using the routine above. (It's just too painful to init these
793 // typecodes statically in all cases!)
794 
795 #define STANDARD_EXCEPTION_LIST \
796  TAO_SYSTEM_EXCEPTION (UNKNOWN) \
797  TAO_SYSTEM_EXCEPTION (BAD_PARAM) \
798  TAO_SYSTEM_EXCEPTION (NO_MEMORY) \
799  TAO_SYSTEM_EXCEPTION (IMP_LIMIT) \
800  TAO_SYSTEM_EXCEPTION (COMM_FAILURE) \
801  TAO_SYSTEM_EXCEPTION (INV_OBJREF) \
802  TAO_SYSTEM_EXCEPTION (OBJECT_NOT_EXIST) \
803  TAO_SYSTEM_EXCEPTION (NO_PERMISSION) \
804  TAO_SYSTEM_EXCEPTION (INTERNAL) \
805  TAO_SYSTEM_EXCEPTION (MARSHAL) \
806  TAO_SYSTEM_EXCEPTION (INITIALIZE) \
807  TAO_SYSTEM_EXCEPTION (NO_IMPLEMENT) \
808  TAO_SYSTEM_EXCEPTION (BAD_TYPECODE) \
809  TAO_SYSTEM_EXCEPTION (BAD_OPERATION) \
810  TAO_SYSTEM_EXCEPTION (NO_RESOURCES) \
811  TAO_SYSTEM_EXCEPTION (NO_RESPONSE) \
812  TAO_SYSTEM_EXCEPTION (PERSIST_STORE) \
813  TAO_SYSTEM_EXCEPTION (BAD_INV_ORDER) \
814  TAO_SYSTEM_EXCEPTION (TRANSIENT) \
815  TAO_SYSTEM_EXCEPTION (FREE_MEM) \
816  TAO_SYSTEM_EXCEPTION (INV_IDENT) \
817  TAO_SYSTEM_EXCEPTION (INV_FLAG) \
818  TAO_SYSTEM_EXCEPTION (INTF_REPOS) \
819  TAO_SYSTEM_EXCEPTION (BAD_CONTEXT) \
820  TAO_SYSTEM_EXCEPTION (OBJ_ADAPTER) \
821  TAO_SYSTEM_EXCEPTION (DATA_CONVERSION) \
822  TAO_SYSTEM_EXCEPTION (INV_POLICY) \
823  TAO_SYSTEM_EXCEPTION (REBIND) \
824  TAO_SYSTEM_EXCEPTION (TIMEOUT) \
825  TAO_SYSTEM_EXCEPTION (TRANSACTION_UNAVAILABLE) \
826  TAO_SYSTEM_EXCEPTION (TRANSACTION_MODE) \
827  TAO_SYSTEM_EXCEPTION (TRANSACTION_REQUIRED) \
828  TAO_SYSTEM_EXCEPTION (TRANSACTION_ROLLEDBACK) \
829  TAO_SYSTEM_EXCEPTION (INVALID_TRANSACTION) \
830  TAO_SYSTEM_EXCEPTION (CODESET_INCOMPATIBLE) \
831  TAO_SYSTEM_EXCEPTION (BAD_QOS) \
832  TAO_SYSTEM_EXCEPTION (INVALID_ACTIVITY) \
833  TAO_SYSTEM_EXCEPTION (ACTIVITY_COMPLETED) \
834  TAO_SYSTEM_EXCEPTION (ACTIVITY_REQUIRED) \
835  TAO_SYSTEM_EXCEPTION (THREAD_CANCELLED)
836 
837 static const char *repo_id_array[] = {
838 #define TAO_SYSTEM_EXCEPTION(name) \
839  (char *) "IDL:omg.org/CORBA/" #name ":1.0",
841 #undef TAO_SYSTEM_EXCEPTION
842  0
843  };
844 
845 // Since we add an extra element subtract 1
846 static const CORBA::ULong array_sz =
847  (sizeof (repo_id_array) / sizeof (char const *)) - 1;
848 
850 
852 #define TAO_SYSTEM_EXCEPTION(name) \
853  &CORBA::name::_tao_create,
855 #undef TAO_SYSTEM_EXCEPTION
856  0
857 };
858 
859 // Concrete SystemException constructors
860 #define TAO_SYSTEM_EXCEPTION(name) \
861 CORBA::name ::name (void) \
862  : CORBA::SystemException ("IDL:omg.org/CORBA/" #name ":1.0", \
863  #name, \
864  0, \
865  CORBA::COMPLETED_NO) \
866 { \
867 } \
868 \
869 CORBA::name ::name (CORBA::ULong code, CORBA::CompletionStatus completed) \
870  : CORBA::SystemException ("IDL:omg.org/CORBA/" #name ":1.0", \
871  #name, \
872  code, \
873  completed) \
874 { \
875 }
876 
878 #undef TAO_SYSTEM_EXCEPTION
879 
880 #define TAO_SYSTEM_EXCEPTION(name) \
881 CORBA::TypeCode_ptr \
882 CORBA::name ::_tao_type (void) const \
883 { \
884  return 0; \
885 }
886 
888 #undef TAO_SYSTEM_EXCEPTION
889 
891 TAO::create_system_exception (const char *id)
892 {
893  for (CORBA::ULong i = 0; i < array_sz; ++i)
894  {
895  if (ACE_OS::strcmp (id, repo_id_array[i]) == 0)
896  return (*(excp_array[i])) ();
897  }
898 
899  return 0;
900 }
901 
902 #define TAO_SYSTEM_EXCEPTION(name) \
903 void \
904 CORBA::name ::_raise (void) const \
905 { \
906  throw *this; \
907 }
908 
910 #undef TAO_SYSTEM_EXCEPTION
911 
912 #define TAO_SYSTEM_EXCEPTION(name) \
913 CORBA::Exception * \
914 CORBA::name ::_tao_duplicate (void) const \
915 { \
916  CORBA::Exception * result = 0; \
917  ACE_ALLOCATOR_NEW (result, CORBA::name (*this), 0); \
918  return result; \
919 }
920 
922 #undef TAO_SYSTEM_EXCEPTION
923 
924 #define TAO_SYSTEM_EXCEPTION(name) \
925 CORBA::SystemException * \
926 CORBA::name ::_tao_create (void) \
927 { \
928  CORBA::name *result = 0; \
929  ACE_ALLOCATOR_NEW (result, CORBA::name, 0); \
930  return result; \
931 }
932 
934 #undef TAO_SYSTEM_EXCEPTION
935 
const CORBA::ULong TAO_ENFILE_MINOR_CODE
const CORBA::ULong TAO_EPIPE_MINOR_CODE
virtual ~SystemException(void)
void _tao_print_system_exception(FILE *f=stdout) const
const CORBA::ULong TAO_ACCEPTOR_REGISTRY_OPEN_LOCATION_CODE
#define ACE_ERROR(X)
#define TAO_BEGIN_VERSIONED_NAMESPACE_DECL
const ULong OMGVMCID
#define EAFNOSUPPORT
#define ENOTSUP
const CORBA::ULong TAO_POA_BEING_DESTROYED
virtual const char * _rep_id(void) const
Definition: Exception.cpp:70
#define STANDARD_EXCEPTION_LIST
const CORBA::ULong TAO_POA_INACTIVE
const CORBA::ULong TAO_ENOTSUP_MINOR_CODE
static const char * _tao_get_omg_exception_description(const CORBA::SystemException &exc, CORBA::ULong minor_code)
const CORBA::ULong TAO_TIMEOUT_SEND_MINOR_CODE
char * strerror(int errnum)
#define ENFILE
int snprintf(char *buf, size_t maxlen, const char *format,...) ACE_GCC_FORMAT_ATTRIBUTE(printf
const CORBA::ULong TAO_INVOCATION_LOCATION_FORWARD_MINOR_CODE
const CORBA::ULong TAO_POA_HOLDING
static CORBA::ULong _tao_minor_code(u_int location, int errno_value)
COMPLETED_MAYBE
const CORBA::ULong TAO_EBADF_MINOR_CODE
Christopher Diggins *renamed files *fixing compilation errors *adding Visual C project file *removed make Max Lybbert *removed references to missing and unused as reported by Andy Elvey and Dan Kosecki *resynced with Christopher Diggins s branch as it exists in tree building code is back Christopher Diggins *resynced codebase with Chris s branch *removed tree building code
Definition: CHANGELOG.txt:8
Exception & operator=(const Exception &src)
Definition: Exception.cpp:58
virtual void _tao_encode(TAO_OutputCDR &cdr) const
const CORBA::ULong TAO_EMFILE_MINOR_CODE
TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO::excp_factory excp_array[]
const CORBA::ULong TAO_EBUSY_MINOR_CODE
CORBA::CompletionStatus completed_
#define EPERM
const CORBA::ULong TAO_EEXIST_MINOR_CODE
#define ECOMM
static const CORBA::ULong array_sz
const CORBA::ULong TAO_POLICY_NARROW_CODE
#define ECONNREFUSED
ULong minor(void) const
virtual void _tao_decode(TAO_InputCDR &cdr)
const CORBA::ULong TAO_IMPLREPO_MINOR_CODE
const CORBA::ULong TAO_EFAULT_MINOR_CODE
const CORBA::ULong TAO_RTCORBA_THREAD_CREATION_LOCATION_CODE
ACE_CDR::ULong ULong
const CORBA::ULong TAO_CONNECTOR_REGISTRY_NO_USABLE_PROTOCOL
const CORBA::ULong TAO_AMH_REPLY_LOCATION_CODE
const CORBA::ULong TAO_ENOENT_MINOR_CODE
const CORBA::ULong TAO_ECOMM_MINOR_CODE
#define EBUSY
CORBA::CompletionStatus completed(void) const
#define ENOSYS
const CORBA::ULong TAO_ENOMEM_MINOR_CODE
const CORBA::ULong TAO_ETIMEDOUT_MINOR_CODE
const CORBA::ULong TAO_INVOCATION_SEND_REQUEST_MINOR_CODE
const CORBA::ULong TAO_TIMEOUT_RECV_MINOR_CODE
CORBA::SystemException *(* excp_factory)(void)
#define ETIMEDOUT
CORBA::SystemException * create_system_exception(const char *id)
const CORBA::ULong TAO_ECONNREFUSED_MINOR_CODE
COMPLETED_NO
SystemException & operator=(const SystemException &src)
int strcmp(const char *s, const char *t)
const CORBA::ULong TAO_EPERM_MINOR_CODE
ACE_TEXT("TCP_Factory")
const CORBA::ULong TAO_EACCES_MINOR_CODE
const CORBA::ULong TAO_EINVAL_MINOR_CODE
const CORBA::ULong TAO_ECONNRESET_MINOR_CODE
const CORBA::ULong TAO_EAFNOSUPPORT_MINOR_CODE
static CORBA::ULong _tao_errno(int errno_value)
CompletionStatus
const CORBA::ULong TAO_EAGAIN_MINOR_CODE
const CORBA::ULong TAO_ORB_CORE_INIT_LOCATION_CODE
virtual ACE_CString _info(void) const
virtual CORBA::Exception * _tao_duplicate(void) const
static const char * repo_id_array[]
const CORBA::ULong VMCID
const CORBA::ULong TAO_INVOCATION_RECV_REQUEST_MINOR_CODE
const CORBA::ULong TAO_POA_DISCARDING
const CORBA::ULong TAO_GUARD_FAILURE
#define TAO_END_VERSIONED_NAMESPACE_DECL
const CORBA::ULong TAO_MPROFILE_CREATION_ERROR
LM_ERROR
#define ECONNRESET
const CORBA::ULong TAO_TIMEOUT_CONNECT_MINOR_CODE
const CORBA::ULong TAO_UNHANDLED_SERVER_CXX_EXCEPTION
const CORBA::ULong TAO_UNSPECIFIED_MINOR_CODE
const CORBA::ULong TAO_ENOSYS_MINOR_CODE