2 //=============================================================================
4 * @file FT_FaultEventDescriptor.cpp
6 * This file is part of TAO's implementation of Fault Tolerant CORBA.
7 * This file provides the implementation of the
8 * TAO::FT_FaultEventDescriptor structure. The
9 * TAO::FT_FaultEventDescriptor is a helper type used during
10 * analysis of fault events.
12 * @author Steve Totten <totten_s@ociweb.com>
14 //=============================================================================
16 #include "orbsvcs/Log_Macros.h"
17 #include "FT_FaultEventDescriptor.h"
19 #include "ace/SString.h"
21 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
23 // Default constructor.
24 TAO::FT_FaultEventDescriptor::FT_FaultEventDescriptor ()
25 : all_at_location_failed (0)
26 , all_of_type_at_location_failed (0)
27 , object_at_location_failed (0)
28 , object_is_primary (0)
29 , type_id (CORBA::string_dup (""))
30 , object_group_id (PortableGroup::ObjectGroupId (0))
35 void TAO::FT_FaultEventDescriptor::dump ()
37 // Get the location as a string.
38 ACE_CString loc_as_string
;
39 for (CORBA::ULong li
= 0; li
< this->location
->length(); ++li
)
41 if (li
> 0) loc_as_string
+= "/";
42 // Assume only the "id" field of the CosNaming::Name is used.
43 loc_as_string
+= CORBA::string_dup (this->location
[li
].id
);
46 if (this->all_at_location_failed
== 1)
48 ORBSVCS_DEBUG ((LM_DEBUG
,
49 ACE_TEXT ("TAO::FT_FaultEventDescriptor::dump: ")
50 ACE_TEXT ("All objects at location <%s> failed.\n"),
55 if (this->all_of_type_at_location_failed
== 1)
57 ORBSVCS_DEBUG ((LM_DEBUG
,
58 ACE_TEXT ("TAO::FT_FaultEventDescriptor::dump: ")
59 ACE_TEXT ("All objects of type <%s> at location <%s> failed.\n"),
65 if (this->object_at_location_failed
== 1)
67 ORBSVCS_DEBUG ((LM_DEBUG
,
68 ACE_TEXT ("TAO::FT_FaultEventDescriptor::dump: ")
69 ACE_TEXT ("Replica of type <%s> with ObjectGroupId <%Q> ")
70 ACE_TEXT ("at location <%s> failed.\n"),
72 this->object_group_id
,
77 if (this->object_is_primary
== 1)
79 ORBSVCS_DEBUG ((LM_DEBUG
,
80 ACE_TEXT ("TAO::FT_FaultEventDescriptor::dump: ")
81 ACE_TEXT ("Primary replica of ObjectGroupId <%Q> failed.\n"),
87 TAO_END_VERSIONED_NAMESPACE_DECL