2 //=============================================================================
4 * @file FT_ReplicationManager.cpp
6 * This file is part of Fault Tolerant CORBA.
7 * This file implements the FT_ReplicationManager class as declared in
8 * FT_Replication_Manager.h.
10 * @author Curt Hibbs <hibbs_c@ociweb.com>
12 //=============================================================================
13 #include "orbsvcs/Log_Macros.h"
14 #include "FT_ReplicationManager.h"
15 #include "FT_Property_Validator.h"
17 #include "ace/Get_Opt.h"
18 #include "ace/OS_NS_stdio.h"
19 #include "ace/OS_NS_unistd.h"
20 #include "tao/Messaging/Messaging.h"
21 #include "tao/IORTable/IORTable.h"
22 #include "tao/debug.h"
23 #include "tao/ORB_Constants.h"
24 #include "orbsvcs/PortableGroup/PG_Object_Group.h"
25 #include "orbsvcs/PortableGroup/PG_Property_Set.h"
26 #include "orbsvcs/PortableGroup/PG_Properties_Encoder.h"
27 #include "orbsvcs/PortableGroup/PG_Property_Utils.h"
28 #include "orbsvcs/PortableGroup/PG_conf.h"
30 #include "orbsvcs/FaultTolerance/FT_IOGR_Property.h"
31 #include "orbsvcs/FT_ReplicationManager/FT_ReplicationManagerFaultAnalyzer.h"
33 // Use this macro at the beginning of CORBA methods
34 // to aid in debugging.
35 #define METHOD_ENTRY(name) \
36 if (TAO_debug_level > 6) \
38 ORBSVCS_DEBUG (( LM_DEBUG, \
43 // Use this macro to return from CORBA methods
44 // to aid in debugging. Note that you can specify
45 // the return value after the macro, for example:
46 // METHOD_RETURN(Plugh::plover) xyzzy; is equivalent
48 // METHOD_RETURN(Plugh::troll); is equivalent to
50 // WARNING: THIS GENERATES TWO STATEMENTS!!! THE FOLLOWING
51 // will not do what you want it to:
52 // if (cave_is_closing) METHOD_RETURN(Plugh::pirate) aarrggh;
53 // Moral: Always use braces.
54 #define METHOD_RETURN(name) \
55 if (TAO_debug_level > 6) \
57 ORBSVCS_DEBUG (( LM_DEBUG, \
61 return /* value goes here */
64 //#define TODO int todo; // warn on todos
66 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
68 TAO::FT_ReplicationManager::FT_ReplicationManager ()
69 : orb_ (CORBA::ORB::_nil ())
70 , poa_ (PortableServer::POA::_nil ())
71 , ior_output_file_ (0)
73 , naming_context_ (CosNaming::NamingContext::_nil ())
74 , replication_manager_ref_ (FT::ReplicationManager::_nil ())
75 , fault_notifier_ (FT::FaultNotifier::_nil ())
76 , fault_notifier_ior_string_ (0)
78 , factory_registry_ ("ReplicationManager::FactoryRegistry")
81 // init must be called before using this object.
84 TAO::FT_ReplicationManager::~FT_ReplicationManager ()
86 // cleanup happens in fini
90 int TAO::FT_ReplicationManager::parse_args (int argc
, ACE_TCHAR
* argv
[])
92 ACE_Get_Opt
get_opts (argc
, argv
, ACE_TEXT("n:o:f:"));
95 while ( (c
= get_opts ()) != -1)
100 this->ior_output_file_
= get_opts
.opt_arg ();
104 this->ns_name_
= ACE_TEXT_ALWAYS_CHAR(get_opts
.opt_arg ());
108 this->fault_notifier_ior_string_
= get_opts
.opt_arg ();
114 ORBSVCS_ERROR_RETURN ( (LM_ERROR
,
115 ACE_TEXT ("%T %n (%P|%t) - usage: %s")
116 ACE_TEXT (" -o <iorfile (for testing)>")
117 ACE_TEXT (" -f <fault notifier IOR (for testing)>")
118 ACE_TEXT (" -n <name-to-bind-in-NameService (for testing)>")
125 // Indicates successful parsing of the command line
130 const char * TAO::FT_ReplicationManager::identity () const
132 return this->identity_
.c_str ();
136 int TAO::FT_ReplicationManager::init (CORBA::ORB_ptr orb
)
140 if (TAO_debug_level
> 1)
142 ORBSVCS_DEBUG ( (LM_DEBUG
,
144 "%T %n (%P|%t) - Enter TAO::FT_ReplicationManager::init.\n")
149 this->orb_
= CORBA::ORB::_duplicate (orb
);
152 CORBA::Object_var poa_obj
= this->orb_
->resolve_initial_references (
154 this->poa_
= PortableServer::POA::_narrow (
158 // initialize the FactoryRegistry
159 this->factory_registry_
.init (this->orb_
.in (), this->poa_
.in ());
161 PortableGroup::FactoryRegistry_var factory_registry
= this->factory_registry_
.reference ();
163 // @@: do we want to use the same poa to create object groups?
164 this->group_factory_
.init (
167 factory_registry
.in ());
169 // Activate ourself in the POA.
170 PortableServer::ObjectId_var oid
= this->poa_
->activate_object (
173 CORBA::Object_var this_obj
= this->poa_
->id_to_reference (
175 this->replication_manager_ref_
= FT::ReplicationManager::_narrow (
178 // If we were given an initial IOR string for a Fault Notifier on the
179 // command line, convert it to an IOR, then register the fault
181 if (this->fault_notifier_ior_string_
!= 0)
183 CORBA::Object_var notifier_obj
= this->orb_
->string_to_object (
184 this->fault_notifier_ior_string_
);
185 FT::FaultNotifier_var notifier
= FT::FaultNotifier::_narrow (
187 if (! CORBA::is_nil (notifier
.in ()))
189 this->register_fault_notifier_i (notifier
.in ());
193 ORBSVCS_ERROR_RETURN ( (LM_ERROR
,
195 "%T %n (%P|%t) - Could not resolve notifier IOR.\n")),
200 // Activate the RootPOA.
201 PortableServer::POAManager_var poa_mgr
=
202 this->poa_
->the_POAManager ();
203 poa_mgr
->activate ();
205 // Register our IOR in the IORTable with the key-string
206 // "ReplicationManager".
207 CORBA::Object_var ior_table_obj
=
208 this->orb_
->resolve_initial_references (
211 IORTable::Table_var ior_table
=
212 IORTable::Table::_narrow (ior_table_obj
.in ());
213 if (CORBA::is_nil (ior_table
.in ()))
215 ORBSVCS_ERROR_RETURN ( (LM_ERROR
,
216 ACE_TEXT ("%T %n (%P|%t) - Unable to resolve the IORTable.\n")),
221 CORBA::String_var rm_ior_str
= this->orb_
->object_to_string (
222 this->replication_manager_ref_
.in ());
223 ior_table
->bind ("ReplicationManager", rm_ior_str
.in ());
226 // Publish our IOR, either to a file or the Naming Service.
227 if (this->ior_output_file_
!= 0)
229 this->identity_
= "file:";
230 this->identity_
+= ACE_TEXT_ALWAYS_CHAR(this->ior_output_file_
);
231 result
= this->write_ior ();
234 if (result
== 0 && this->ns_name_
.length () != 0)
236 this->identity_
= "name:";
237 this->identity_
+= this->ns_name_
;
239 CORBA::Object_var naming_obj
= this->orb_
->resolve_initial_references (
240 TAO_OBJID_NAMESERVICE
);
242 this->naming_context_
=
243 CosNaming::NamingContext::_narrow (
246 if (CORBA::is_nil (this->naming_context_
.in ()))
248 ORBSVCS_ERROR_RETURN ( (LM_ERROR
,
249 ACE_TEXT ("%T %n (%P|%t) - Unable to find the Naming Service.\n")),
253 this->this_name_
.length (1);
254 this->this_name_
[0].id
= CORBA::string_dup (this->ns_name_
.c_str ());
256 this->naming_context_
->rebind (
258 this->replication_manager_ref_
.in ());
261 if (TAO_debug_level
> 1)
265 ORBSVCS_DEBUG ( (LM_DEBUG
,
267 "%T %n (%P|%t) - Leave TAO::FT_ReplicationManager::init.\n")
272 ORBSVCS_DEBUG ( (LM_DEBUG
,
274 "%T %n (%P|%t) - FT_ReplicationManager::init failed.\n")
279 ////////////////////////////////
280 // Initialize default properties
281 PortableGroup::Value value
;
282 value
<<= TAO_PG_MEMBERSHIP_STYLE
;
283 this->properties_support_
.set_default_property (PortableGroup::PG_MEMBERSHIP_STYLE
, value
);
285 value
<<= TAO_PG_INITIAL_NUMBER_MEMBERS
;
286 this->properties_support_
.set_default_property (PortableGroup::PG_INITIAL_NUMBER_MEMBERS
, value
);
288 value
<<= TAO_PG_MINIMUM_NUMBER_MEMBERS
;
289 this->properties_support_
.set_default_property (PortableGroup::PG_MINIMUM_NUMBER_MEMBERS
, value
);
291 value
<<= FT::SEMI_ACTIVE
;
292 this->properties_support_
.set_default_property (FT::FT_REPLICATION_STYLE
, value
);
294 value
<<= FT::CONS_APP_CTRL
;
295 this->properties_support_
.set_default_property ( FT::FT_CONSISTENCY_STYLE
, value
);
298 this->properties_support_
.set_default_property (FT::FT_FAULT_MONITORING_STYLE
, value
);
301 this->properties_support_
.set_default_property (FT::FT_FAULT_MONITORING_GRANULARITY
, value
);
304 FaultMonitoringIntervalAndTimeoutValue times
;
306 this->properties_support_
.set_default_property (FT::FT_FAULT_MONITORING_INTERVAL_AND_TIMEOUT
, value
);
311 this->properties_support_
.set_default_property (FT::FT_CHECKPOINT_INTERVAL
, value
);
319 int TAO::FT_ReplicationManager::idle (int & result
)
321 ACE_UNUSED_ARG (result
);
327 int TAO::FT_ReplicationManager::fini ()
331 result
= this->fault_consumer_
.fini ();
333 if (this->ior_output_file_
!= 0)
335 ACE_OS::unlink (this->ior_output_file_
);
336 this->ior_output_file_
= 0;
338 if (this->ns_name_
.length () != 0)
340 this->naming_context_
->unbind (this->this_name_
);
341 this->ns_name_
.clear ();
349 TAO::FT_ReplicationManager::register_fault_notifier (
350 FT::FaultNotifier_ptr fault_notifier
)
352 this->register_fault_notifier_i (fault_notifier
);
357 TAO::FT_ReplicationManager::register_fault_notifier_i (
358 FT::FaultNotifier_ptr fault_notifier
)
360 if (CORBA::is_nil (fault_notifier
))
362 ORBSVCS_ERROR ( (LM_ERROR
,
364 "%T %n (%P|%t) - Bad Fault Notifier object reference provided.\n")
366 throw CORBA::BAD_PARAM (
367 CORBA::SystemException::_tao_minor_code (
370 CORBA::COMPLETED_NO
);
373 // Cache new Fault Notifier object reference.
374 this->fault_notifier_
= FT::FaultNotifier::_duplicate (fault_notifier
);
376 // Re-initialize our consumer.
377 // Swallow any exception.
381 //@@ should we check to see if a notifier is already registered, rather than
382 // simply "unregistering"?
383 result
= this->fault_consumer_
.fini ();
385 // Note if the fini failed, we ignore it. It may not have been registered
386 // in the first place.
388 // Create a fault analyzer.
389 TAO::FT_FaultAnalyzer
* analyzer
= 0;
392 TAO::FT_ReplicationManagerFaultAnalyzer (this));
395 ORBSVCS_ERROR ( (LM_ERROR
,
397 "%T %n (%P|%t) - Error creating FaultAnalyzer.\n"
404 result
= this->fault_consumer_
.init (
406 this->fault_notifier_
.in (),
410 catch (const CORBA::Exception
& ex
)
412 ex
._tao_print_exception (
413 ACE_TEXT ("TAO::FT_ReplicationManager::register_fault_notifier_i: ")
414 ACE_TEXT ("Error reinitializing FT_FaultConsumer.\n"));
420 ORBSVCS_ERROR ( (LM_ERROR
,
422 "%T %n (%P|%t) - Could not re-initialize FT_FaultConsumer.\n")
425 throw CORBA::INTERNAL (
426 CORBA::SystemException::_tao_minor_code (
429 CORBA::COMPLETED_NO
);
434 // Returns the reference of the Fault Notifier.
436 FT::FaultNotifier_ptr
437 TAO::FT_ReplicationManager::get_fault_notifier ()
439 if (CORBA::is_nil (this->fault_notifier_
.in ()))
441 throw FT::InterfaceNotFound ();
443 return FT::FaultNotifier::_duplicate (this->fault_notifier_
.in ());
447 // TAO-specific find factory registry
449 ::PortableGroup::FactoryRegistry_ptr
450 TAO::FT_ReplicationManager::get_factory_registry (
451 const PortableGroup::Criteria
& selection_criteria
)
453 ACE_UNUSED_ARG (selection_criteria
);
454 return this->factory_registry_
.reference ();
457 // TAO-specific shutdown operation.
459 void TAO::FT_ReplicationManager::shutdown ()
464 // Get the type_id associated with an object group.
466 char * TAO::FT_ReplicationManager::type_id (
467 PortableGroup::ObjectGroup_ptr object_group
)
470 TAO::PG_Object_Group
* group
= 0;
471 if (this->group_factory_
.find_group (object_group
, group
))
473 result
= group
->get_type_id ();
477 throw PortableGroup::ObjectGroupNotFound ();
482 //////////////////////////////////////////////////////
483 // PortableGroup::PropertyManager methods
487 TAO::FT_ReplicationManager::set_default_properties (
488 const PortableGroup::Properties
& props
)
490 this->properties_support_
.set_default_properties (props
);
491 //@@ validate properties?
495 PortableGroup::Properties
*
496 TAO::FT_ReplicationManager::get_default_properties ()
498 return this->properties_support_
.get_default_properties ();
503 TAO::FT_ReplicationManager::remove_default_properties (
504 const PortableGroup::Properties
& props
)
506 this->properties_support_
.remove_default_properties (props
);
511 TAO::FT_ReplicationManager::set_type_properties (
513 const PortableGroup::Properties
& overrides
)
515 this->properties_support_
.set_type_properties (
521 PortableGroup::Properties
*
522 TAO::FT_ReplicationManager::get_type_properties (
525 return this->properties_support_
.get_type_properties (type_id
);
530 TAO::FT_ReplicationManager::remove_type_properties (
532 const PortableGroup::Properties
& props
)
534 this->properties_support_
.remove_type_properties (
541 TAO::FT_ReplicationManager::set_properties_dynamically (
542 PortableGroup::ObjectGroup_ptr object_group
,
543 const PortableGroup::Properties
& overrides
)
545 TAO::PG_Object_Group
* group
= 0;
546 if (this->group_factory_
.find_group (object_group
, group
))
548 group
->set_properties_dynamically (overrides
);
552 throw PortableGroup::ObjectGroupNotFound ();
557 PortableGroup::Properties
*
558 TAO::FT_ReplicationManager::get_properties (
559 PortableGroup::ObjectGroup_ptr object_group
)
561 PortableGroup::Properties_var result
;
562 ACE_NEW_THROW_EX (result
, PortableGroup::Properties(), CORBA::NO_MEMORY ());
564 TAO::PG_Object_Group
* group
= 0;
565 if (this->group_factory_
.find_group (object_group
, group
))
567 group
->get_properties (result
);
571 throw PortableGroup::ObjectGroupNotFound ();
573 return result
._retn();
577 //////////////////////////////////////////////////////
578 // FT::FTObjectGroupManager methods
580 /// Sets the primary member of a group.
582 PortableGroup::ObjectGroup_ptr
583 TAO::FT_ReplicationManager::set_primary_member (
584 PortableGroup::ObjectGroup_ptr object_group
,
585 const PortableGroup::Location
& the_location
)
587 METHOD_ENTRY (TAO::FT_ReplicationManager::set_primary_member
);
588 PortableGroup::ObjectGroup_var result
= PortableGroup::ObjectGroup::_nil();
589 TAO::PG_Object_Group
* group
= 0;
590 if (this->group_factory_
.find_group (object_group
, group
))
592 PortableGroup::TagGroupTaggedComponent tag_component
;
593 TAO_FT_IOGR_Property
prop (tag_component
);
595 int sts
= group
->set_primary_member (&prop
, the_location
);
598 result
= group
->reference ();
602 throw FT::PrimaryNotSet ();
607 throw PortableGroup::ObjectGroupNotFound ();
609 METHOD_RETURN (TAO::FT_ReplicationManager::set_primary_member
) result
._retn ();
613 PortableGroup::ObjectGroup_ptr
614 TAO::FT_ReplicationManager::create_member (
615 PortableGroup::ObjectGroup_ptr object_group
,
616 const PortableGroup::Location
& the_location
,
617 const char * type_id
,
618 const PortableGroup::Criteria
& the_criteria
)
620 PortableGroup::ObjectGroup_var result
= PortableGroup::ObjectGroup::_nil();
621 TAO::PG_Object_Group
* group
= 0;
622 if (this->group_factory_
.find_group (object_group
, group
))
624 group
->create_member (the_location
, type_id
, the_criteria
);
625 result
= group
->reference ();
629 if (TAO_debug_level
> 0)
631 ORBSVCS_ERROR ( (LM_ERROR
,
632 ACE_TEXT ("%T %n (%P|%t) - FT_ReplicationManager::create_member: unknown group\n")
635 throw PortableGroup::ObjectGroupNotFound ();
637 return result
._retn();
642 PortableGroup::ObjectGroup_ptr
643 TAO::FT_ReplicationManager::add_member (
644 PortableGroup::ObjectGroup_ptr object_group
,
645 const PortableGroup::Location
& the_location
,
646 CORBA::Object_ptr member
)
648 METHOD_ENTRY (TAO::FT_ReplicationManager::add_member
);
649 PortableGroup::ObjectGroup_var result
= PortableGroup::ObjectGroup::_nil ();
651 // Find the object group corresponding to this IOGR
652 TAO::PG_Object_Group
* group
= 0;
653 if (this->group_factory_
.find_group (object_group
, group
))
659 result
= group
->reference ();
663 if (TAO_debug_level
> 0)
665 ORBSVCS_ERROR ( (LM_ERROR
,
666 ACE_TEXT ("%T %n (%P|%t) - FT_ReplicationManager::add_member to unknown group\n")
669 throw PortableGroup::ObjectGroupNotFound ();
671 METHOD_RETURN (TAO::FT_ReplicationManager::add_member
) result
._retn ();
675 PortableGroup::ObjectGroup_ptr
676 TAO::FT_ReplicationManager::remove_member (
677 PortableGroup::ObjectGroup_ptr object_group
,
678 const PortableGroup::Location
& the_location
)
680 PortableGroup::ObjectGroup_var result
= PortableGroup::ObjectGroup::_nil ();
682 // Find the object group corresponding to this IOGR
683 TAO::PG_Object_Group
* group
= 0;
684 if (this->group_factory_
.find_group (object_group
, group
))
686 group
->remove_member (the_location
);
688 group
->minimum_populate ();
689 //@@ how about the case where the member was removed successfully,
690 // but for one reason or another we were unable to bring the group
691 // back up to minimum_number_of_replicas?
693 result
= group
->reference ();
697 throw PortableGroup::ObjectGroupNotFound ();
699 return result
._retn ();
703 PortableGroup::Locations
*
704 TAO::FT_ReplicationManager::locations_of_members (
705 PortableGroup::ObjectGroup_ptr object_group
)
707 PortableGroup::Locations
* result
= 0;
709 // Find the object group corresponding to this IOGR
710 TAO::PG_Object_Group
* group
= 0;
711 if (this->group_factory_
.find_group (object_group
, group
))
713 result
= group
->locations_of_members ();
717 if (TAO_debug_level
> 0)
719 ORBSVCS_ERROR ( (LM_ERROR
,
720 ACE_TEXT ("%T %n (%P|%t) - FT_ReplicationManager::locations_of_members: unknown group\n")
723 throw PortableGroup::ObjectGroupNotFound ();
729 PortableGroup::ObjectGroups
*
730 TAO::FT_ReplicationManager::groups_at_location (
731 const PortableGroup::Location
& the_location
)
733 return this->group_factory_
.groups_at_location (the_location
);
737 PortableGroup::ObjectGroupId
738 TAO::FT_ReplicationManager::get_object_group_id (
739 PortableGroup::ObjectGroup_ptr object_group
)
741 PortableGroup::ObjectGroupId result
= 0;
742 TAO::PG_Object_Group
* group
= 0;
743 if (this->group_factory_
.find_group (object_group
, group
))
745 group
->get_object_group_id ();
746 result
= group
->get_object_group_id ();
750 if (TAO_debug_level
> 0)
752 ORBSVCS_ERROR ( (LM_ERROR
,
753 ACE_TEXT ("%T %n (%P|%t) - FT_ReplicationManager::get_object_group_id: unknown group\n")
756 throw PortableGroup::ObjectGroupNotFound ();
762 PortableGroup::ObjectGroup_ptr
763 TAO::FT_ReplicationManager::get_object_group_ref (
764 PortableGroup::ObjectGroup_ptr object_group
)
766 PortableGroup::ObjectGroup_var result
= PortableGroup::ObjectGroup::_nil ();
768 // Find the object group corresponding to this IOGR
769 TAO::PG_Object_Group
* group
= 0;
770 if (this->group_factory_
.find_group (object_group
, group
))
772 result
= group
->reference ();
776 if (TAO_debug_level
> 0)
778 ORBSVCS_ERROR ( (LM_ERROR
,
779 ACE_TEXT ("%T %n (%P|%t) - FT_ReplicationManager::get_object_group_ref: unknown group\n")
782 throw PortableGroup::ObjectGroupNotFound ();
784 return result
._retn();
787 //CORBA, TAO specific
788 PortableGroup::ObjectGroup_ptr
789 TAO::FT_ReplicationManager::get_object_group_ref_from_id (
790 PortableGroup::ObjectGroupId group_id
)
792 PortableGroup::ObjectGroup_var result
= PortableGroup::ObjectGroup::_nil ();
794 // Find the object group corresponding to this IOGR
795 TAO::PG_Object_Group
* group
= 0;
796 if (this->group_factory_
.find_group (group_id
, group
))
798 result
= group
->reference ();
802 if (TAO_debug_level
> 0)
804 ORBSVCS_ERROR ( (LM_ERROR
,
805 ACE_TEXT ("%T %n (%P|%t) - FT_ReplicationManager::get_object_group_ref_from_id: unknown group\n")
808 throw PortableGroup::ObjectGroupNotFound ();
810 return result
._retn();
815 TAO::FT_ReplicationManager::get_member_ref (
816 PortableGroup::ObjectGroup_ptr object_group
,
817 const PortableGroup::Location
& the_location
)
819 CORBA::Object_var result
= CORBA::Object::_nil();
821 // Find the object group corresponding to this IOGR
822 TAO::PG_Object_Group
* group
= 0;
823 if (this->group_factory_
.find_group (object_group
, group
))
825 result
= group
->get_member_reference (the_location
);
829 if (TAO_debug_level
> 0)
831 ORBSVCS_ERROR ( (LM_ERROR
,
832 ACE_TEXT ("%T %n (%P|%t) - FT_ReplicationManager::get_member_ref: unknown group\n")
835 throw PortableGroup::ObjectGroupNotFound ();
837 return result
._retn();
841 //////////////////////////////////////////////////////
842 // PortableGroup::GenericFactory methods
846 TAO::FT_ReplicationManager::create_object (
847 const char * type_id
,
848 const PortableGroup::Criteria
& the_criteria
,
849 PortableGroup::GenericFactory::FactoryCreationId_out factory_creation_id
)
851 METHOD_ENTRY (TAO::FT_ReplicationManager::create_object
)
853 ////////////////////////////////
854 // find the properties for this
855 // type of object group
856 TAO::PG_Property_Set_var typeid_properties
857 = this->properties_support_
.find_typeid_properties (
860 TAO::PG_Object_Group
* group
861 = this->group_factory_
.create_group (
866 group
->initial_populate ();
867 //@@ on error we should remove the group from the Group_Factory
868 // doing this "right" will require a var-type pointer to the object group
869 // that knows about the factory, too.
871 // Allocate a new FactoryCreationId for use as an "out" parameter.
872 PortableGroup::GenericFactory::FactoryCreationId_ptr factory_id_ptr
= 0;
873 ACE_NEW_THROW_EX (factory_id_ptr
,
874 PortableGroup::GenericFactory::FactoryCreationId
,
876 CORBA::SystemException::_tao_minor_code (
879 CORBA::COMPLETED_NO
));
880 PortableGroup::GenericFactory::FactoryCreationId_var factory_id
= factory_id_ptr
;
881 PortableGroup::ObjectGroupId group_id
= group
->get_object_group_id ();
882 factory_id
<<= group_id
;
883 factory_creation_id
= factory_id
._retn();
885 METHOD_RETURN (TAO::FT_ReplicationManager::create_object
) group
->reference ();
890 TAO::FT_ReplicationManager::delete_object (
891 const PortableGroup::GenericFactory::FactoryCreationId
& factory_creation_id
)
893 PortableGroup::ObjectGroupId group_id
= 0;
894 if (factory_creation_id
>>= group_id
)
896 this->group_factory_
.delete_group (
901 throw PortableGroup::ObjectNotFound ();
906 int TAO::FT_ReplicationManager::write_ior ()
909 FILE* out
= ACE_OS::fopen (this->ior_output_file_
, "w");
912 CORBA::String_var ior_str
= this->orb_
->object_to_string (
913 this->replication_manager_ref_
.in ());
914 ACE_OS::fprintf (out
, "%s", ior_str
.in ());
915 ACE_OS::fclose (out
);
920 ORBSVCS_ERROR ( (LM_ERROR
,
921 ACE_TEXT ("%T %n (%P|%t) - Open failed for %s\n"), this->ior_output_file_
927 TAO_END_VERSIONED_NAMESPACE_DECL