diff options
author | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-07-24 15:50:11 +0000 |
---|---|---|
committer | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-07-24 15:50:11 +0000 |
commit | 6b846cf03c0bcbd8c276cb0af61a181e5f98eaae (patch) | |
tree | da50d054f9c761c3f6a5923f6979e93306c56d68 /TAO/orbsvcs/FT_ReplicationManager | |
parent | 0e555b9150d38e3b3473ba325b56db2642e6352b (diff) | |
download | ATCD-6b846cf03c0bcbd8c276cb0af61a181e5f98eaae.tar.gz |
Repo restructuring
Diffstat (limited to 'TAO/orbsvcs/FT_ReplicationManager')
20 files changed, 0 insertions, 4560 deletions
diff --git a/TAO/orbsvcs/FT_ReplicationManager/.cvsignore b/TAO/orbsvcs/FT_ReplicationManager/.cvsignore deleted file mode 100644 index 0443905ee6a..00000000000 --- a/TAO/orbsvcs/FT_ReplicationManager/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -FT_ReplicationManager diff --git a/TAO/orbsvcs/FT_ReplicationManager/FT_DefaultFaultAnalyzer.cpp b/TAO/orbsvcs/FT_ReplicationManager/FT_DefaultFaultAnalyzer.cpp deleted file mode 100755 index 03fc838db47..00000000000 --- a/TAO/orbsvcs/FT_ReplicationManager/FT_DefaultFaultAnalyzer.cpp +++ /dev/null @@ -1,174 +0,0 @@ -/* -*- C++ -*- */ -//============================================================================= -/** - * @file FT_DefaultFaultAnalyzer.cpp - * - * $Id$ - * - * This file is part of TAO's implementation of Fault Tolerant CORBA. - * - * @author Steve Totten <totten_s@ociweb.com> - */ -//============================================================================= - -#include "FT_DefaultFaultAnalyzer.h" -#include "orbsvcs/CosNotifyCommC.h" -#include "orbsvcs/FT_NotifierC.h" -#include "orbsvcs/FT_FaultDetectorFactoryC.h" -#include "orbsvcs/FT_ReplicationManagerC.h" -#include "orbsvcs/FT_ReplicationManager/FT_FaultEventDescriptor.h" -#include "tao/debug.h" -#include "ace/OS_NS_string.h" - -ACE_RCSID (FT_DefaultFaultAnalyzer, - FT_DefaultFaultAnalyzer, - "$Id$") - - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -/// Default constructor. -TAO::FT_DefaultFaultAnalyzer::FT_DefaultFaultAnalyzer () -{ -} - -/// Destructor. -TAO::FT_DefaultFaultAnalyzer::~FT_DefaultFaultAnalyzer () -{ -} - -// Validate the event to make sure it is one we can handle. -// If it is not an event we can handle, this function logs the error -// and returns -1. -int TAO::FT_DefaultFaultAnalyzer::validate_event_type ( - const CosNotification::StructuredEvent & event) -{ - int result = 0; - - // CORBA 3.0.2, section 23.4.5.1 states: - // - // The fault management specification defines one event type: - // ObjectCrashFault. As the name suggests, this event is - // generated by a Fault Detector when it detects that an object - // has crashed. - - // So, the event header's event_type.domain_name must be "FT_CORBA" - // and the event header's event_type.type_name must be "ObjectCrashFault". - // @@ why make string dups just to do a strcmp? - CORBA::String_var domain_name = CORBA::string_dup ( - event.header.fixed_header.event_type.domain_name); - CORBA::String_var type_name = CORBA::string_dup ( - event.header.fixed_header.event_type.type_name); - CORBA::String_var event_name = CORBA::string_dup ( - event.header.fixed_header.event_name); - - if (result == 0) - { - if (ACE_OS::strcmp (domain_name.in(), FT::FT_EVENT_TYPE_DOMAIN) != 0 || - ACE_OS::strcmp (type_name.in(), FT::FT_EVENT_TYPE_NAME) != 0) - { - if (TAO_debug_level > 6) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ( - "TAO::FT_DefaultFaultAnalyzer::validate_event_type: " - "Received invalid event type.\n" - "EventType domain: <%s>\n" - "EventType type: <%s>\n" - "EventName: <%s>\n"), - domain_name.in(), - type_name.in(), - event_name.in() - )); - } - result = -1; - } - } - - // CORBA 3.0.2, section 23.4.5.1 also states: - // - // The filterable_data part of the event body contains the - // identity of the crashed object as four name-value pairs: the - // fault tolerance domain identifier, the member’s location - // identifier, the repository identifier and the object group - // identifier. The Fault Notifier filters events based on the - // domain_name, the type_name, and the four identifiers. All - // other fields of the structured event may be set to null. - // - // The Fault Detector always sets the following fault event - // fields: domain_name, type_name, FTDomainId, and Location. - // - // So, at least "FTDomainId" and "Location" must be present: - if (result == 0) - { - if (event.filterable_data.length () >= 2) - { - // Check for FTDomainId. - if (ACE_OS::strcmp ( - event.filterable_data[0].name.in(), FT::FT_DOMAIN_ID) != 0) - { - if (TAO_debug_level > 6) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ( - "TAO::FT_DefaultFaultAnalyzer::validate_event_type: " - "Received invalid structured event.\n" - "filterable_data[0] must be \"FTDomainId\", not \"%s\"\n"), - event.filterable_data[0].name.in() - )); - } - result = -1; - } - else if (ACE_OS::strcmp ( - event.filterable_data[1].name.in(), FT::FT_LOCATION) != 0) - { - if (TAO_debug_level > 6) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ( - "TAO::FT_DefaultFaultAnalyzer::validate_event_type: " - "Received invalid structured event.\n" - "filterable_data[1] must be \"Location\", not \"%s\"\n"), - event.filterable_data[1].name.in() - )); - } - result = -1; - } - } - else - { - if (TAO_debug_level > 6) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ( - "TAO::FT_DefaultFaultAnalyzer::validate_event_type: " - "Received invalid structured event.\n" - "There must be at least two name/value pairs in " - "the filterable_data field, for \"FTDomainId\" and \"Location\".\n") - )); - } - result = -1; - } - } - - return result; -} - -/// Analyze a fault event. -int TAO::FT_DefaultFaultAnalyzer::analyze_fault_event ( - const CosNotification::StructuredEvent & event) -{ - ACE_UNUSED_ARG (event); - if (TAO_debug_level > 6) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ( - "In TAO::FT_DefaultFaultAnalyzer::analyze_fault_event.\n") - )); - } - - // no-op - return 0; -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/orbsvcs/FT_ReplicationManager/FT_DefaultFaultAnalyzer.h b/TAO/orbsvcs/FT_ReplicationManager/FT_DefaultFaultAnalyzer.h deleted file mode 100755 index 0901c34e63b..00000000000 --- a/TAO/orbsvcs/FT_ReplicationManager/FT_DefaultFaultAnalyzer.h +++ /dev/null @@ -1,90 +0,0 @@ -/* -*- C++ -*- */ -//============================================================================= -/** - * @file FT_DefaultFaultAnalyzer.h - * - * $Id$ - * - * This file is part of TAO's implementation of Fault Tolerant CORBA. - * This is the default implementation of a fault analyzer that - * implements the interface of the abstract base class - * TAO::FT_FaultAnalyzer. - * - * @author Steve Totten <totten_s@ociweb.com> - */ -//============================================================================= - - -#ifndef FT_DEFAULT_FAULT_ANALYZER_H_ -#define FT_DEFAULT_FAULT_ANALYZER_H_ - -#include /**/ "ace/pre.h" -#include <ace/ACE.h> - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "FT_ReplicationManagerLib_export.h" -#include "FT_FaultAnalyzer.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - - /** - * Default fault analyzer. - * - */ - class TAO_ReplicationManagerLib_Export FT_DefaultFaultAnalyzer - : public ::TAO::FT_FaultAnalyzer - { - - public: - /** - * Default constructor. - */ - FT_DefaultFaultAnalyzer (); - - /** - * Destructor. - */ - virtual ~FT_DefaultFaultAnalyzer (); - - public: - - /** - * Validate event type to make sure it is one we can handle. - * @param event The structured fault event, as from the Fault Notifier. - * @return 0 if it is a valid event type, -1 otherwise. - */ - virtual int validate_event_type ( - const CosNotification::StructuredEvent & event); - - /** - * Analyze a fault event. - * @param event The structured fault event, as from the Fault Notifier. - * @return 0 on success, -1 on failure. - */ - virtual int analyze_fault_event ( - const CosNotification::StructuredEvent & event); - - //////////////////// - // Forbidden methods - private: - /// Copy constructor. - FT_DefaultFaultAnalyzer (const FT_DefaultFaultAnalyzer & rhs); - /// Assignment operator. - FT_DefaultFaultAnalyzer & operator = (const FT_DefaultFaultAnalyzer & rhs); - - }; - -} // namespace TAO - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* FT_DEFAULT_FAULT_ANALYZER_H_ */ - diff --git a/TAO/orbsvcs/FT_ReplicationManager/FT_FaultAnalyzer.cpp b/TAO/orbsvcs/FT_ReplicationManager/FT_FaultAnalyzer.cpp deleted file mode 100755 index bd2d2d8d059..00000000000 --- a/TAO/orbsvcs/FT_ReplicationManager/FT_FaultAnalyzer.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/* -*- C++ -*- */ -//============================================================================= -/** - * @file FT_FaultAnalyzer.cpp - * - * $Id$ - * - * This file is part of TAO's implementation of Fault Tolerant CORBA. - * - * @author Steve Totten <totten_s@ociweb.com> - */ -//============================================================================= - -#include "FT_FaultAnalyzer.h" - -ACE_RCSID (FT_FaultAnalyzer, - FT_FaultAnalyzer, - "$Id$") - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -/// Default constructor. -TAO::FT_FaultAnalyzer::FT_FaultAnalyzer () -{ -} - -/// Destructor. -TAO::FT_FaultAnalyzer::~FT_FaultAnalyzer () -{ -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/orbsvcs/FT_ReplicationManager/FT_FaultAnalyzer.h b/TAO/orbsvcs/FT_ReplicationManager/FT_FaultAnalyzer.h deleted file mode 100755 index 253421fe577..00000000000 --- a/TAO/orbsvcs/FT_ReplicationManager/FT_FaultAnalyzer.h +++ /dev/null @@ -1,89 +0,0 @@ -/* -*- C++ -*- */ -//============================================================================= -/** - * @file FT_FaultAnalyzer.h - * - * $Id$ - * - * This file is part of TAO's implementation of Fault Tolerant CORBA. - * - * @author Steve Totten <totten_s@ociweb.com> - */ -//============================================================================= - - -#ifndef FT_FAULT_ANALYZER_H_ -#define FT_FAULT_ANALYZER_H_ - -#include /**/ "ace/pre.h" -#include <ace/ACE.h> - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "FT_ReplicationManagerLib_export.h" -#include "orbsvcs/CosNotifyCommC.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - /** - * Abstract base class for application-defined fault analyzers. - * - */ - class TAO_ReplicationManagerLib_Export FT_FaultAnalyzer - { - - public: - /** - * Default constructor. - */ - FT_FaultAnalyzer (); - - /** - * Destructor. - */ - virtual ~FT_FaultAnalyzer (); - - public: - - /** - * Validate event type to make sure it is one we can handle. - * @param event The structured fault event, as from the Fault Notifier. - * @return 0 if it is a valid event type, -1 otherwise. - */ - virtual int validate_event_type ( - const CosNotification::StructuredEvent & event) = 0; - - /** - * Analyze a fault event. - * @param event The structured fault event, as from the Fault Notifier. - * @return 0 on success, -1 on failure. - */ - virtual int analyze_fault_event ( - const CosNotification::StructuredEvent & event) = 0; - - //////////////////// - // Forbidden methods - private: - /// Copy constructor. - FT_FaultAnalyzer (const FT_FaultAnalyzer & rhs); - /// Assignment operator. - FT_FaultAnalyzer & operator = (const FT_FaultAnalyzer & rhs); - - /////////////// - // Data Members - private: - - }; - -} // namespace TAO - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* FT_FAULT_ANALYZER_H_ */ - diff --git a/TAO/orbsvcs/FT_ReplicationManager/FT_FaultConsumer.cpp b/TAO/orbsvcs/FT_ReplicationManager/FT_FaultConsumer.cpp deleted file mode 100755 index 5a08f15d6d9..00000000000 --- a/TAO/orbsvcs/FT_ReplicationManager/FT_FaultConsumer.cpp +++ /dev/null @@ -1,303 +0,0 @@ -/* -*- C++ -*- */ -//============================================================================= -/** - * @file FT_FaultConsumer.cpp - * - * $Id$ - * - * This file is part of TAO's implementation of Fault Tolerant CORBA. - * This file provides the implementation of the TAO::FT_FaultConsumer - * class. The TAO::FT_FaultConsumer connects to the FaultNotifier to - * receive fault reports. It interacts with the ReplicationManager - * to process fault reports (e.g., to set a new primary on an object - * group or to create a new member of an object group). - * - * @author Steve Totten <totten_s@ociweb.com> - */ -//============================================================================= - -#include "FT_FaultConsumer.h" -#include "orbsvcs/FT_ReplicationManagerC.h" -#include "orbsvcs/FT_ReplicationManager/FT_FaultAnalyzer.h" -#include "tao/debug.h" - -ACE_RCSID (FT_FaultConsumer, - FT_FaultConsumer, - "$Id$") - - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -/// Default constructor. -TAO::FT_FaultConsumer::FT_FaultConsumer () - : poa_ (PortableServer::POA::_nil ()) - , fault_notifier_ (FT::FaultNotifier::_nil ()) - , fault_analyzer_ (0) - , consumer_id_ (0) - , consumer_ref_ (CosNotifyComm::StructuredPushConsumer::_nil ()) - , notifications_ (0) -{ -} - -/// Destructor. -TAO::FT_FaultConsumer::~FT_FaultConsumer () -{ -} - -/** -* Connect to the FT::FaultNotifier. -* Note: We make the following assumptions about what the -* application will do: -* - Create an instance of this consumer class. -* - Obtain the object reference of the FaultNotifier to which this -* consumer should connect. -* - Call this init() method, passing it the POA with which we -* have been activated, the FaultNotifier, and ReplicationManager -* object references. -*/ -int TAO::FT_FaultConsumer::init ( - PortableServer::POA_ptr poa, - FT::FaultNotifier_ptr fault_notifier, - TAO::FT_FaultAnalyzer * fault_analyzer - ACE_ENV_ARG_DECL) -{ - - if (TAO_debug_level > 1) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ( - "Enter TAO::FT_FaultConsumer::init.\n") - )); - } - - ACE_ASSERT (!CORBA::is_nil (poa)); - ACE_ASSERT (!CORBA::is_nil (fault_notifier)); - ACE_ASSERT (fault_analyzer != 0); - - // Duplicate the object references passed in. - this->poa_ = - PortableServer::POA::_duplicate (poa); - this->fault_notifier_ = - FT::FaultNotifier::_duplicate (fault_notifier); - - // We have no ownership responsibilities for the Fault Analyzer. - this->fault_analyzer_ = fault_analyzer; - - //@@ Should this init() method activate the consumer in the POA, or - // should the application do that? - // I don't think this object can activate itself because it doesn't - // know the policies on the POA. So, we assume the application has - // already activated us. - //@@ For now, let's try just activating it in the POA. - - // Activate this consumer in the POA. - this->object_id_ = this->poa_->activate_object (this ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - CORBA::Object_var obj = - this->poa_->id_to_reference (this->object_id_.in() ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - - // Narrow it to CosNotifyComm::StructuredPushConsumer. - this->consumer_ref_ = CosNotifyComm::StructuredPushConsumer::_narrow ( - obj.in() ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - - // Subscribe to the FaultNotifier. - CosNotifyFilter::Filter_var filter = CosNotifyFilter::Filter::_nil (); - this->consumer_id_ = fault_notifier_->connect_structured_fault_consumer ( - this->consumer_ref_.in(), filter.in () ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - - if (TAO_debug_level > 1) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ( - "Leave TAO::FT_FaultConsumer::init.\n") - )); - } - - // Success. - return 0; -} - -/** -* Clean house for process shut down. -* - Disconnect from FT::FaultNotifier. -* - Deactivate from the POA. -*/ -int TAO::FT_FaultConsumer::fini (ACE_ENV_SINGLE_ARG_DECL) -{ - - if (TAO_debug_level > 1) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("Enter TAO::FT_FaultConsumer::fini.\n") - )); - } - - // Disconnect from the FaultNotifier. - // Swallow any exception. - ACE_TRY_NEW_ENV - { - if (!CORBA::is_nil (this->fault_notifier_.in())) - { - - if (TAO_debug_level > 1) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ( - "TAO::FT_FaultConsumer::fini: " - "Disconnecting consumer from FaultNotifier.\n") - )); - } - - this->fault_notifier_->disconnect_consumer ( - this->consumer_id_ ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (TAO_debug_level > 1) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ( - "TAO::FT_FaultConsumer::fini: " - "Deactivating from POA.\n") - )); - } - - // Deactivate ourself from the POA. - this->poa_->deactivate_object ( - this->object_id_.in() ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - ACE_TEXT ( - "TAO::FT_FaultConsumer::fini: " - "Error disconnecting from notifier (ignored).\n") - ); - } - ACE_ENDTRY; - ACE_CHECK_RETURN(1); - - if (TAO_debug_level > 1) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ( - "TAO::FT_FaultConsumer::fini: " - "Setting our object reference to nil.\n") - )); - } - - this->consumer_ref_ = CosNotifyComm::StructuredPushConsumer::_nil (); - - if (TAO_debug_level > 1) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("Leave TAO::FT_FaultConsumer::fini.\n") - )); - } - - // Success. - return 0; -} - -CosNotifyComm::StructuredPushConsumer_ptr -TAO::FT_FaultConsumer::consumer_ref () -{ - return CosNotifyComm::StructuredPushConsumer::_duplicate ( - this->consumer_ref_.in ()); -} - -size_t TAO::FT_FaultConsumer::notifications () const -{ - return this->notifications_; -} - - -/////////////////// -// CORBA operations - -// Receive and process an incoming fault event from the Fault Notifier. -// First, we validate the event to make sure it is something we can -// handle. Then, we analyze it. If it is not an event we can handle, -// we simply log the error and drop the event. -void TAO::FT_FaultConsumer::push_structured_event ( - const CosNotification::StructuredEvent &event - ACE_ENV_ARG_DECL_NOT_USED - ) - ACE_THROW_SPEC ((CORBA::SystemException, CosEventComm::Disconnected)) -{ - // Debugging support. - this->notifications_ += 1; - if (TAO_debug_level > 1) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ( - "TAO::FT_FaultConsumer::push_structured_event: " - "Received Fault notification(%d):\n"), - static_cast<unsigned int> (this->notifications_) - )); - } - - int result = 0; - - // Make sure it is an event type we can handle. - if (result == 0) - { - result = this->fault_analyzer_->validate_event_type (event); - if (result != 0) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ( - "TAO::FT_FaultConsumer::push_structured_event: " - "Received invalid fault event type.\n") - )); - } - } - - // Analyze the event. - if (result == 0) - { - result = this->fault_analyzer_->analyze_fault_event (event); - if (result != 0) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ( - "TAO::FT_FaultConsumer::push_structured_event: " - "Could not analyze fault event.\n") - )); - } - } - - return; -} - -void TAO::FT_FaultConsumer::offer_change ( - const CosNotification::EventTypeSeq & added, - const CosNotification::EventTypeSeq & removed - ACE_ENV_ARG_DECL_NOT_USED - ) - ACE_THROW_SPEC ((CORBA::SystemException, CosNotifyComm::InvalidEventType)) -{ - ACE_UNUSED_ARG (added); - ACE_UNUSED_ARG (removed); - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT("TAO::FT_FaultConsumer::offer_change() call ignored.\n") - )); -} - -void TAO::FT_FaultConsumer::disconnect_structured_push_consumer ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED - ) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - //TODO: For now, we are just ignoring the disconnect callback. - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT("TAO::FT_FaultConsumer::disconnect_structured_push_consumer() " - "call ignored.\n") - )); -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/orbsvcs/FT_ReplicationManager/FT_FaultConsumer.h b/TAO/orbsvcs/FT_ReplicationManager/FT_FaultConsumer.h deleted file mode 100755 index 4ba96cdee31..00000000000 --- a/TAO/orbsvcs/FT_ReplicationManager/FT_FaultConsumer.h +++ /dev/null @@ -1,170 +0,0 @@ -/* -*- C++ -*- */ -//============================================================================= -/** - * @file FT_FaultConsumer.h - * - * $Id$ - * - * This file is part of TAO's implementation of Fault Tolerant CORBA. - * - * @author Steve Totten <totten_s@ociweb.com> - */ -//============================================================================= - - -#ifndef FT_FAULT_CONSUMER_H_ -#define FT_FAULT_CONSUMER_H_ - -#include /**/ "ace/pre.h" -#include <ace/ACE.h> - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "orbsvcs/CosNotifyCommS.h" -#include "orbsvcs/FT_NotifierC.h" -#include "FT_ReplicationManagerLib_export.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - - /////////////////////// - // Forward declarations - class FT_FaultAnalyzer; - - /** - * Implement the CosNotifyComm::StructuredPushConsumer interface. - * - */ - class TAO_ReplicationManagerLib_Export FT_FaultConsumer - : public virtual POA_CosNotifyComm::StructuredPushConsumer - { - - ////////////////////// - // non-CORBA interface - - public: - /** - * Default constructor. - */ - FT_FaultConsumer (); - - /** - * Destructor. - */ - virtual ~FT_FaultConsumer (); - - /** - * Connect to the FT::FaultNotifier. - * Note: We make the following assumptions about what the - * application will do: - * - Create an instance of this consumer class. - * - Obtain the object reference of the FaultNotifier to which this - * consumer should connect. - * - Call this init() method, passing it the POA with which we - * have been activated, the FaultNotifier, and ReplicationManager - * object references. - */ - int init ( - PortableServer::POA_ptr poa, - FT::FaultNotifier_ptr fault_notifier, - TAO::FT_FaultAnalyzer * fault_analyzer - ACE_ENV_ARG_DECL); - - /** - * Clean house for process shut down. - * - Disconnect from FT::FaultNotifier. - * - Deactivate from the POA. - */ - int fini (ACE_ENV_SINGLE_ARG_DECL); - - /** - * Accessor for a duplicate of this consumer's object reference. - */ - CosNotifyComm::StructuredPushConsumer_ptr consumer_ref (); - - //@@ For testing purposes only, will be removed later. - /** - * Accessor for the number of notifications we have received. - */ - size_t notifications () const; - - public: - - /** - * @name POA_CosNotifyComm::StructuredPushConsumer Methods - * - * Methods required by the POA_CosNotifyComm::StructuredPushConsumer - * interface. - */ - //@{ - - //////////////// - // CORBA methods - virtual void push_structured_event ( - const CosNotification::StructuredEvent ¬ification - ACE_ENV_ARG_DECL_WITH_DEFAULTS - ) - ACE_THROW_SPEC ((CORBA::SystemException, CosEventComm::Disconnected)); - - virtual void offer_change ( - const CosNotification::EventTypeSeq & added, - const CosNotification::EventTypeSeq & removed - ACE_ENV_ARG_DECL_WITH_DEFAULTS - ) - ACE_THROW_SPEC ((CORBA::SystemException, CosNotifyComm::InvalidEventType)); - - virtual void disconnect_structured_push_consumer ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS - ) - ACE_THROW_SPEC ((CORBA::SystemException)); - - //@} - - //////////////////// - // Forbidden methods - private: - /// Copy constructor. - FT_FaultConsumer (const FT_FaultConsumer & rhs); - /// Assignment operator. - FT_FaultConsumer & operator = (const FT_FaultConsumer & rhs); - - /////////////// - // Data Members - private: - - /// The POA with which we are activated. - PortableServer::POA_var poa_; - - /// The ObjectId from our activation in the POA. - PortableServer::ObjectId_var object_id_; - - /// The FaultNotifier's object reference. - FT::FaultNotifier_var fault_notifier_; - - /// Application-specific Fault Analyzer. - TAO::FT_FaultAnalyzer * fault_analyzer_; - - /// ConsumerId assigned by the notifier. - FT::FaultNotifier::ConsumerId consumer_id_; - - /// Our consumer object reference. - CosNotifyComm::StructuredPushConsumer_var consumer_ref_; - - ///TODO: Remove this later, it is just for testing. - // Keep track of how many notifications we have received. - size_t notifications_; - - }; - -} // namespace TAO - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* FT_FAULT_CONSUMER_H_ */ - diff --git a/TAO/orbsvcs/FT_ReplicationManager/FT_FaultEventDescriptor.cpp b/TAO/orbsvcs/FT_ReplicationManager/FT_FaultEventDescriptor.cpp deleted file mode 100755 index 3f101f27dea..00000000000 --- a/TAO/orbsvcs/FT_ReplicationManager/FT_FaultEventDescriptor.cpp +++ /dev/null @@ -1,96 +0,0 @@ -/* -*- C++ -*- */ -//============================================================================= -/** - * @file FT_FaultEventDescriptor.cpp - * - * $Id$ - * - * This file is part of TAO's implementation of Fault Tolerant CORBA. - * This file provides the implementation of the - * TAO::FT_FaultEventDescriptor structure. The - * TAO::FT_FaultEventDescriptor is a helper type used during - * analysis of fault events. - * - * @author Steve Totten <totten_s@ociweb.com> - */ -//============================================================================= - -#include "FT_FaultEventDescriptor.h" - -#include "ace/SString.h" - -ACE_RCSID (FT_FaultEventDescriptor, - FT_FaultEventDescriptor, - "$Id$") - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -// Default constructor. -TAO::FT_FaultEventDescriptor::FT_FaultEventDescriptor () - : all_at_location_failed (0) - , all_of_type_at_location_failed (0) - , object_at_location_failed (0) - , object_is_primary (0) - , type_id (CORBA::string_dup ("")) - , object_group_id (PortableGroup::ObjectGroupId (0)) -{ -} - -// Debugging support. -void TAO::FT_FaultEventDescriptor::dump () -{ - // Get the location as a string. - ACE_CString loc_as_string; - for (CORBA::ULong li = 0; li < this->location->length(); ++li) - { - if (li > 0) loc_as_string += "/"; - // Assume only the "id" field of the CosNaming::Name is used. - loc_as_string += CORBA::string_dup (this->location[li].id); - } - - if (this->all_at_location_failed == 1) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ( - "TAO::FT_FaultEventDescriptor::dump: " - "All objects at location <%s> failed.\n"), - loc_as_string.c_str() - )); - } - - if (this->all_of_type_at_location_failed == 1) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ( - "TAO::FT_FaultEventDescriptor::dump: " - "All objects of type <%s> at location <%s> failed.\n"), - this->type_id.in(), - loc_as_string.c_str() - )); - } - - if (this->object_at_location_failed == 1) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ( - "TAO::FT_FaultEventDescriptor::dump: " - "Replica of type <%s> with ObjectGroupId <%Q> " - "at location <%s> failed.\n"), - this->type_id.in(), - this->object_group_id, - loc_as_string.c_str() - )); - } - - if (this->object_is_primary == 1) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ( - "TAO::FT_FaultEventDescriptor::dump: " - "Primary replica of ObjectGroupId <%Q> failed.\n"), - this->object_group_id - )); - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/orbsvcs/FT_ReplicationManager/FT_FaultEventDescriptor.h b/TAO/orbsvcs/FT_ReplicationManager/FT_FaultEventDescriptor.h deleted file mode 100755 index fe174448fb2..00000000000 --- a/TAO/orbsvcs/FT_ReplicationManager/FT_FaultEventDescriptor.h +++ /dev/null @@ -1,80 +0,0 @@ -/* -*- C++ -*- */ -//============================================================================= -/** - * @file FT_FaultEventDescriptor.h - * - * $Id$ - * - * This file is part of TAO's implementation of Fault Tolerant CORBA. - * - * @author Steve Totten <totten_s@ociweb.com> - */ -//============================================================================= - - -#ifndef FT_FAULT_EVENT_DESCRIPTOR_H_ -#define FT_FAULT_EVENT_DESCRIPTOR_H_ - -#include /**/ "ace/pre.h" -#include <ace/ACE.h> - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "orbsvcs/FT_CORBAC.h" -#include "orbsvcs/PortableGroupC.h" -#include "FT_ReplicationManagerLib_export.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - /// Helper class for describing the properties in a fault event. - struct TAO_ReplicationManagerLib_Export FT_FaultEventDescriptor - { - public: - - /// Default constructor. - FT_FaultEventDescriptor (); - - /// Debugging support. - void dump (); - - ///////////////// - /// Data members. - - /// Flags indicating the "extent" of the fault. - int all_at_location_failed; - int all_of_type_at_location_failed; - int object_at_location_failed; - int object_is_primary; - - /// The location of the fault. - PortableGroup::Location_var location; - - /// The TypeId of the object that faulted. - PortableGroup::TypeId_var type_id; - - /// The ObjectGroupId of the faulted object. - PortableGroup::ObjectGroupId object_group_id; - - /// Other properties of the object group to which the fault relates. - PortableGroup::MembershipStyleValue membership_style; - FT::ReplicationStyleValue replication_style; - PortableGroup::MinimumNumberMembersValue minimum_number_members; - PortableGroup::InitialNumberMembersValue initial_number_members; - - /// The object group's factories. - PortableGroup::FactoryInfos_var factories; - - }; - -} // namespace TAO - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* FT_FAULT_EVENT_DESCRIPTOR_H_ */ - diff --git a/TAO/orbsvcs/FT_ReplicationManager/FT_Property_Validator.cpp b/TAO/orbsvcs/FT_ReplicationManager/FT_Property_Validator.cpp deleted file mode 100644 index 0268c527fbb..00000000000 --- a/TAO/orbsvcs/FT_ReplicationManager/FT_Property_Validator.cpp +++ /dev/null @@ -1,246 +0,0 @@ -#include "FT_Property_Validator.h" -#include "orbsvcs/PortableGroup/PG_Operators.h" -#include "orbsvcs/FT_ReplicationManagerC.h" - - -ACE_RCSID (PortableGroup, - FT_Property_Validator, - "$Id$") - - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -TAO::FT_Property_Validator::FT_Property_Validator (void) - : replication_style_ (1), - membership_style_ (1), - consistency_style_ (1), - fault_monitoring_style_ (1), - fault_monitoring_granularity_ (1), - factories_ (1) -{ - this->replication_style_.length (1); - this->replication_style_[0].id = CORBA::string_dup (::FT::FT_REPLICATION_STYLE); - - this->membership_style_.length (1); - this->membership_style_[0].id = CORBA::string_dup (::FT::FT_MEMBERSHIP_STYLE); - - this->consistency_style_.length (1); - this->consistency_style_[0].id = CORBA::string_dup (::FT::FT_CONSISTENCY_STYLE); - - this->fault_monitoring_style_.length (1); - this->fault_monitoring_style_[0].id = CORBA::string_dup (::FT::FT_FAULT_MONITORING_STYLE); - - this->fault_monitoring_granularity_.length (1); - this->fault_monitoring_granularity_[0].id = CORBA::string_dup (::FT::FT_FAULT_MONITORING_GRANULARITY); - - this->factories_.length (1); - this->factories_[0].id = CORBA::string_dup (::FT::FT_FACTORIES); -} - - -TAO::FT_Property_Validator::~FT_Property_Validator (void) -{ -} - - -void -TAO::FT_Property_Validator::validate_property ( - const PortableGroup::Properties & props - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableGroup::InvalidProperty, - PortableGroup::UnsupportedProperty)) -{ - const CORBA::ULong len = props.length (); - - for (CORBA::ULong i = 0; i < len; ++i) - { - const PortableGroup::Property & property = props[i]; - - if (property.nam == this->replication_style_) - { - FT::ReplicationStyleValue value; - if (!(property.val >>= value) - || (value != FT::STATELESS - && value != FT::COLD_PASSIVE - && value != FT::WARM_PASSIVE - && value != FT::ACTIVE - && value != FT::ACTIVE_WITH_VOTING - && value != FT::SEMI_ACTIVE)) - ACE_THROW (PortableGroup::InvalidProperty (property.nam, - property.val)); - } - else if (property.nam == this->membership_style_) - { - PortableGroup::MembershipStyleValue value; - if (!(property.val >>= value) - || (value != PortableGroup::MEMB_APP_CTRL - && value != PortableGroup::MEMB_INF_CTRL)) - ACE_THROW (PortableGroup::InvalidProperty (property.nam, - property.val)); - } - else if (property.nam == this->consistency_style_) - { - FT::ConsistencyStyleValue value; - if (!(property.val >>= value) - || (value != FT::CONS_APP_CTRL - && value != FT::CONS_INF_CTRL)) - ACE_THROW (PortableGroup::InvalidProperty (property.nam, - property.val)); - } - else if (property.nam == this->fault_monitoring_style_) - { - FT::FaultMonitoringStyleValue value; - if (!(property.val >>= value) - || (value != FT::PULL - && value != FT::PUSH - && value != FT::NOT_MONITORED)) - ACE_THROW (PortableGroup::InvalidProperty (property.nam, - property.val)); - } - else if (property.nam == this->fault_monitoring_granularity_) - { - FT::FaultMonitoringGranularityValue value; - if (!(property.val >>= value) - || (value != FT::MEMB - && value != FT::LOC - && value != FT::LOC_AND_TYPE)) - ACE_THROW (PortableGroup::InvalidProperty (property.nam, - property.val)); - } - else if (property.nam == this->factories_) - { - const PortableGroup::FactoriesValue * factories; - if (!(property.val >>= factories)) - ACE_THROW (PortableGroup::InvalidProperty (property.nam, - property.val)); - else - { - const CORBA::ULong flen = factories->length (); - - if (flen == 0) - ACE_THROW (PortableGroup::InvalidProperty (property.nam, - property.val)); - - for (CORBA::ULong j = 0; j < flen; ++j) - { - const PortableGroup::FactoryInfo & factory_info = - (*factories)[j]; - - if (CORBA::is_nil (factory_info.the_factory.in ()) - || factory_info.the_location.length () == 0) - ACE_THROW (PortableGroup::InvalidProperty (property.nam, - property.val)); - } - } - } - } -} - -void -TAO::FT_Property_Validator::validate_criteria ( - const PortableGroup::Properties & props - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableGroup::InvalidCriteria, - PortableGroup::CannotMeetCriteria)) -{ - const CORBA::ULong len = props.length (); - PortableGroup::Criteria invalid_criteria; - - // Optimize for the worst case scenario where all properties are - // invalid. - invalid_criteria.length (len); - - /// The invalid criteria index. - CORBA::ULong p = 0; - - for (CORBA::ULong i = 0; i < len; ++i) - { - const PortableGroup::Property & property = props[i]; - CORBA::Long value; - - if (!(property.val >>= value)) - invalid_criteria[p++] = property; - else - { - if (property.nam == this->replication_style_) - { - if ( value != FT::STATELESS - && value != FT::COLD_PASSIVE - && value != FT::WARM_PASSIVE - && value != FT::ACTIVE - && value != FT::ACTIVE_WITH_VOTING - && value != FT::SEMI_ACTIVE ) - invalid_criteria[p++] = property; - } - else if (property.nam == this->membership_style_) - { - if ( value != PortableGroup::MEMB_APP_CTRL - && value != PortableGroup::MEMB_INF_CTRL ) - invalid_criteria[p++] = property; - } - else if (property.nam == this->consistency_style_) - { - if ( value != FT::CONS_APP_CTRL - && value != FT::CONS_INF_CTRL ) - invalid_criteria[p++] = property; - } - else if (property.nam == this->fault_monitoring_style_) - { - if ( value != FT::PULL - && value != FT::PUSH - && value != FT::NOT_MONITORED ) - invalid_criteria[p++] = property; - } - else if (property.nam == this->fault_monitoring_granularity_) - { - if ( value != FT::MEMB - && value != FT::LOC - && value != FT::LOC_AND_TYPE ) - invalid_criteria[p++] = property; - } - else if (property.nam == this->factories_) - { - PortableGroup::FactoriesValue * factories; - if (!(property.val >>= factories)) - invalid_criteria[p++] = property; - else - { - const CORBA::ULong flen = factories->length (); - - if (flen == 0) - invalid_criteria[p++] = property; - else - { - for (CORBA::ULong j = 0; j < flen; ++j) - { - const PortableGroup::FactoryInfo & factory_info = - (*factories)[j]; - - if (CORBA::is_nil (factory_info.the_factory.in ()) - || factory_info.the_location.length () == 0) - { - invalid_criteria[p++] = property; - break; - } - } - } - } - } - } - } - - if (p > 0) - { - // Reduce the length of the invalid criteria sequence in an - // effort to optimize the copying that will occur when the below - // exception is thrown. Reducing the length is fast since no - // deallocations should occur. - invalid_criteria.length (p); - - ACE_THROW (PortableGroup::InvalidCriteria (invalid_criteria)); - } -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/orbsvcs/FT_ReplicationManager/FT_Property_Validator.h b/TAO/orbsvcs/FT_ReplicationManager/FT_Property_Validator.h deleted file mode 100644 index 954d7f29ded..00000000000 --- a/TAO/orbsvcs/FT_ReplicationManager/FT_Property_Validator.h +++ /dev/null @@ -1,97 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file FT_Property_Validator.h - * - * $Id$ - * - * @author Curt Hibbs <hibbs_c@ociweb.com> - */ -//============================================================================= - -#ifndef FT_PROPERTY_VALIDATOR_H -#define FT_PROPERTY_VALIDATOR_H - -#include /**/ "ace/pre.h" - -#include "orbsvcs/PortableGroup/PG_Default_Property_Validator.h" -#include "orbsvcs/PortableGroupC.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - /** - * @class FT_Property_Validator - * - * @brief Default property validator implementation. - * - * This Property_Validator verifies that all properties defined in the - * FT CORBA IDL are valid. - */ - class FT_Property_Validator : public TAO_PG_Default_Property_Validator - { - public: - - /// Constructor. - FT_Property_Validator (void); - - /// Destructor. - virtual ~FT_Property_Validator (void); - - /// Validate the given properties. Throw an exception when the - /// first invalid property is encountered. The remaining properties - /// will not be validated. - virtual - void validate_property (const PortableGroup::Properties & props - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableGroup::InvalidProperty, - PortableGroup::UnsupportedProperty)); - - /// Validate the given properties/criteria. All criteria - /// will be validated regardless of whether or not an invalid - /// property was encountered. - virtual - void validate_criteria (const PortableGroup::Properties & criteria - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableGroup::InvalidCriteria, - PortableGroup::CannotMeetCriteria)); - - private: - - /** - * @name Pre-initialize property Names. - * - * These properties are pre-initialized once to reduce property - * validation overhead. Note that the following properties are - * not validated since there are no restrictions for these values: - * InitialNumberMembers - * MinimumNumberMembers - * FaultMonitoringInterval - * CheckpointInterval - */ - //@{ - PortableGroup::Name replication_style_; - PortableGroup::Name membership_style_; - PortableGroup::Name consistency_style_; - PortableGroup::Name fault_monitoring_style_; - PortableGroup::Name fault_monitoring_granularity_; - PortableGroup::Name factories_; - //@} - - }; - -} // namespace TAO - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* FT_PROPERTY_VALIDATOR_H */ diff --git a/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager.cpp b/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager.cpp deleted file mode 100644 index bfc77eb5a46..00000000000 --- a/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager.cpp +++ /dev/null @@ -1,1097 +0,0 @@ -/* -*- C++ -*- */ -//============================================================================= -/** - * @file FT_ReplicationManager.cpp - * - * $Id$ - * - * This file is part of Fault Tolerant CORBA. - * This file implements the FT_ReplicationManager class as declared in - * FT_Replication_Manager.h. - * - * @author Curt Hibbs <hibbs_c@ociweb.com> - */ -//============================================================================= -#include "FT_ReplicationManager.h" -#include "FT_Property_Validator.h" - -#include "ace/Get_Opt.h" -#include "ace/OS_NS_stdio.h" -#include "ace/OS_NS_unistd.h" -#include "tao/Messaging/Messaging.h" -#include "tao/IORTable/IORTable.h" -#include "tao/debug.h" -#include "tao/ORB_Constants.h" -#include "orbsvcs/PortableGroup/PG_Object_Group.h" -#include "orbsvcs/PortableGroup/PG_Property_Set.h" -#include "orbsvcs/PortableGroup/PG_Properties_Encoder.h" -#include "orbsvcs/PortableGroup/PG_Property_Utils.h" -#include "orbsvcs/PortableGroup/PG_conf.h" - -#include "orbsvcs/FaultTolerance/FT_IOGR_Property.h" -#include "orbsvcs/FT_ReplicationManager/FT_ReplicationManagerFaultAnalyzer.h" - -ACE_RCSID (FT_ReplicationManager, - FT_ReplicationManager, - "$Id$") - - -// Use this macro at the beginning of CORBA methods -// to aid in debugging. -#define METHOD_ENTRY(name) \ - if (TAO_debug_level > 6) \ - { \ - ACE_DEBUG (( LM_DEBUG, \ - "Enter %s\n", #name \ - )); \ - } - -// Use this macro to return from CORBA methods -// to aid in debugging. Note that you can specify -// the return value after the macro, for example: -// METHOD_RETURN(Plugh::plover) xyzzy; is equivalent -// to return xyzzy; -// METHOD_RETURN(Plugh::troll); is equivalent to -// return; -// WARNING: THIS GENERATES TWO STATEMENTS!!! THE FOLLOWING -// will not do what you want it to: -// if (cave_is_closing) METHOD_RETURN(Plugh::pirate) aarrggh; -// Moral: Always use braces. -#define METHOD_RETURN(name) \ - if (TAO_debug_level > 6) \ - { \ - ACE_DEBUG (( LM_DEBUG, \ - "Leave %s\n", #name \ - )); \ - } \ - return /* value goes here */ - -#define TODO -//#define TODO int todo; // warn on todos - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -TAO::FT_ReplicationManager::FT_ReplicationManager () - : orb_ (CORBA::ORB::_nil ()) - , poa_ (PortableServer::POA::_nil ()) - , ior_output_file_ (0) - , ns_name_ (0) - , naming_context_ (CosNaming::NamingContext::_nil ()) - , replication_manager_ref_ (FT::ReplicationManager::_nil ()) - , fault_notifier_ (FT::FaultNotifier::_nil ()) - , fault_notifier_ior_string_ (0) - , fault_consumer_ () - , factory_registry_ ("ReplicationManager::FactoryRegistry") - , quit_ (0) -{ - // init must be called before using this object. -} - -TAO::FT_ReplicationManager::~FT_ReplicationManager (void) -{ - // cleanup happens in fini -} - -//public -int TAO::FT_ReplicationManager::parse_args (int argc, char * argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, "n:o:f:"); - int c; - - while ( (c = get_opts ()) != -1) - { - switch (c) - { - case 'o': - this->ior_output_file_ = get_opts.opt_arg (); - break; - - case 'n': - this->ns_name_ = get_opts.opt_arg (); - break; - - case 'f': - this->fault_notifier_ior_string_ = get_opts.opt_arg (); - break; - - case '?': - // fall thru - default: - ACE_ERROR_RETURN ( (LM_ERROR, - ACE_TEXT ("%T %n (%P|%t) - usage: %s") - ACE_TEXT (" -o <iorfile (for testing)>") - ACE_TEXT (" -f <fault notifier IOR (for testing)>") - ACE_TEXT (" -n <name-to-bind-in-NameService (for testing)>") - ACE_TEXT ("\n"), - argv [0]), - -1); - break; - } - } - // Indicates sucessful parsing of the command line - return 0; -} - -//public -const char * TAO::FT_ReplicationManager::identity () const -{ - return this->identity_.c_str (); -} - -//public -int TAO::FT_ReplicationManager::init (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL) -{ - int result = 0; - - if (TAO_debug_level > 1) - { - ACE_DEBUG ( (LM_DEBUG, - ACE_TEXT ( - "%T %n (%P|%t) - Enter TAO::FT_ReplicationManager::init.\n") - )); - } - - - this->orb_ = CORBA::ORB::_duplicate (orb); - - // Get the RootPOA. - CORBA::Object_var poa_obj = this->orb_->resolve_initial_references ( - TAO_OBJID_ROOTPOA ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - this->poa_ = PortableServer::POA::_narrow ( - poa_obj.in () ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - - - // initialize the FactoryRegistry - this->factory_registry_.init (this->orb_.in (), this->poa_.in () ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - - PortableGroup::FactoryRegistry_var factory_registry = this->factory_registry_.reference (); - - // @@: do we want to use the same poa to create object groups? - this->group_factory_.init ( - this->orb_.in (), - this->poa_.in (), - factory_registry.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - - // Activate ourself in the POA. - PortableServer::ObjectId_var oid = this->poa_->activate_object ( - this ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - - CORBA::Object_var this_obj = this->poa_->id_to_reference ( - oid.in () ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - this->replication_manager_ref_ = FT::ReplicationManager::_narrow ( - this_obj.in () ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - - // If we were given an initial IOR string for a Fault Notifier on the - // command line, convert it to an IOR, then register the fault - // notifier. - if (this->fault_notifier_ior_string_ != 0) - { - CORBA::Object_var notifier_obj = this->orb_->string_to_object ( - this->fault_notifier_ior_string_ ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - FT::FaultNotifier_var notifier = FT::FaultNotifier::_narrow ( - notifier_obj.in () ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - if (! CORBA::is_nil (notifier.in ())) - { - this->register_fault_notifier_i (notifier.in () ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - } - else - { - ACE_ERROR_RETURN ( (LM_ERROR, - ACE_TEXT ( - "%T %n (%P|%t) - " - "Could not resolve notifier IOR.\n")), - -1); - } - } - - // Activate the RootPOA. - PortableServer::POAManager_var poa_mgr = - this->poa_->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - poa_mgr->activate (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - - // Register our IOR in the IORTable with the key-string - // "ReplicationManager". - CORBA::Object_var ior_table_obj = - this->orb_->resolve_initial_references ( - TAO_OBJID_IORTABLE ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - - IORTable::Table_var ior_table = - IORTable::Table::_narrow (ior_table_obj.in () ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - if (CORBA::is_nil (ior_table.in ())) - { - ACE_ERROR_RETURN ( (LM_ERROR, - ACE_TEXT ("%T %n (%P|%t) - Unable to resolve the IORTable.\n")), - -1); - } - else - { - CORBA::String_var rm_ior_str = this->orb_->object_to_string ( - this->replication_manager_ref_.in () ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - ior_table->bind ("ReplicationManager", rm_ior_str.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - } - - // Publish our IOR, either to a file or the Naming Service. - if (this->ior_output_file_ != 0) - { - this->identity_ = "file:"; - this->identity_ += this->ior_output_file_; - result = this->write_ior (); - } - - if (result == 0 && this->ns_name_ != 0) - { - this->identity_ = "name:"; - this->identity_ += this->ns_name_; - - CORBA::Object_var naming_obj = this->orb_->resolve_initial_references ( - TAO_OBJID_NAMESERVICE ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - - this->naming_context_ = - CosNaming::NamingContext::_narrow ( - naming_obj.in () ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - - if (CORBA::is_nil (this->naming_context_.in ())) - { - ACE_ERROR_RETURN ( (LM_ERROR, - ACE_TEXT ("%T %n (%P|%t) - Unable to find the Naming Service.\n")), - -1); - } - - this->this_name_.length (1); - this->this_name_[0].id = CORBA::string_dup (this->ns_name_); - - this->naming_context_->rebind ( - this->this_name_, - this->replication_manager_ref_.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - } - - if (TAO_debug_level > 1) - { - if (result == 0) - { - ACE_DEBUG ( (LM_DEBUG, - ACE_TEXT ( - "%T %n (%P|%t) - Leave TAO::FT_ReplicationManager::init.\n") - )); - } - else - { - ACE_DEBUG ( (LM_DEBUG, - ACE_TEXT ( - "%T %n (%P|%t) - FT_ReplicationManager::init failed.\n") - )); - } - } - - //////////////////////////////// - // Initialize default properties - PortableGroup::Value value; - value <<= TAO_PG_MEMBERSHIP_STYLE; - this->properties_support_.set_default_property (PortableGroup::PG_MEMBERSHIP_STYLE, value ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN(-1); - - value <<= TAO_PG_INITIAL_NUMBER_MEMBERS; - this->properties_support_.set_default_property (PortableGroup::PG_INITIAL_NUMBER_MEMBERS, value ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN(-1); - - value <<= TAO_PG_MINIMUM_NUMBER_MEMBERS; - this->properties_support_.set_default_property (PortableGroup::PG_MINIMUM_NUMBER_MEMBERS, value ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN(-1); - - value <<= FT::SEMI_ACTIVE; - this->properties_support_.set_default_property (FT::FT_REPLICATION_STYLE, value ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN(-1); - - value <<= FT::CONS_APP_CTRL; - this->properties_support_.set_default_property ( FT::FT_CONSISTENCY_STYLE, value ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN(-1); - - value <<= FT::PULL; - this->properties_support_.set_default_property (FT::FT_FAULT_MONITORING_STYLE, value ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN(-1); - - value <<= FT::MEMB; - this->properties_support_.set_default_property (FT::FT_FAULT_MONITORING_GRANULARITY, value ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN(-1); - -#if 0 - FaultMonitoringIntervalAndTimeoutValue times; - value <<= times; - this->properties_support_.set_default_property (FT::FT_FAULT_MONITORING_INTERVAL_AND_TIMEOUT, value ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN(-1); -#endif - -#if 0 - value << interval; - this->properties_support_.set_default_property (FT::FT_CHECKPOINT_INTERVAL, value); -#endif - - - return result; -} - -//public -int TAO::FT_ReplicationManager::idle (int & result ACE_ENV_ARG_DECL_NOT_USED) -{ - ACE_UNUSED_ARG (result); - return this->quit_; -} - - -//public -int TAO::FT_ReplicationManager::fini (ACE_ENV_SINGLE_ARG_DECL) -{ - int result = 0; - - result = this->fault_consumer_.fini (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - - if (this->ior_output_file_ != 0) - { - ACE_OS::unlink (this->ior_output_file_); - this->ior_output_file_ = 0; - } - if (this->ns_name_ != 0) - { - this->naming_context_->unbind (this->this_name_ ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - this->ns_name_ = 0; - } - - return result; -} - -//CORBA -void -TAO::FT_ReplicationManager::register_fault_notifier ( - FT::FaultNotifier_ptr fault_notifier - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ( (CORBA::SystemException)) -{ - this->register_fault_notifier_i (fault_notifier ACE_ENV_ARG_PARAMETER); -} - -//private -void -TAO::FT_ReplicationManager::register_fault_notifier_i ( - FT::FaultNotifier_ptr fault_notifier - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ( (CORBA::SystemException)) -{ - if (CORBA::is_nil (fault_notifier)) - { - ACE_ERROR ( (LM_ERROR, - ACE_TEXT ( - "%T %n (%P|%t) - " - "Bad Fault Notifier object reference provided.\n") - )); - ACE_THROW (CORBA::BAD_PARAM ( - CORBA::SystemException::_tao_minor_code ( - TAO::VMCID, - EINVAL), - CORBA::COMPLETED_NO)); - } - - // Cache new Fault Notifier object reference. - this->fault_notifier_ = FT::FaultNotifier::_duplicate (fault_notifier); - - // Re-initialize our consumer. - // Swallow any exception. - int result = 0; - ACE_TRY_NEW_ENV - { - //@@ should we check to see if a notifier is already registered, rather than - // simply "unregistering"? - result = this->fault_consumer_.fini (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - // Note if the fini failed, we ignore it. It may not have been registered in the first place. - - // Create a fault analyzer. - TAO::FT_FaultAnalyzer * analyzer = 0; - ACE_NEW_NORETURN ( - analyzer, - TAO::FT_ReplicationManagerFaultAnalyzer (this)); - if (analyzer == 0) - { - ACE_ERROR ( (LM_ERROR, - ACE_TEXT ( - "%T %n (%P|%t) - " - "Error creating FaultAnalyzer.\n" - ) - )); - result = -1; - } - if (result == 0) - { - result = this->fault_consumer_.init ( - this->poa_.in (), - this->fault_notifier_.in (), - analyzer - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - ACE_TEXT ( - "TAO::FT_ReplicationManager::register_fault_notifier_i: " - "Error reinitializing FT_FaultConsumer.\n") - ); - result = -1; - } - ACE_ENDTRY; - - if (result != 0) - { - ACE_ERROR ( (LM_ERROR, - ACE_TEXT ( - "%T %n (%P|%t) - " - "Could not re-initialize FT_FaultConsumer.\n") - )); - - ACE_THROW (CORBA::INTERNAL ( - CORBA::SystemException::_tao_minor_code ( - TAO::VMCID, - EINVAL), - CORBA::COMPLETED_NO)); - } -} - - -// Returns the reference of the Fault Notifier. -//CORBA -FT::FaultNotifier_ptr -TAO::FT_ReplicationManager::get_fault_notifier ( - ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ( (CORBA::SystemException, FT::InterfaceNotFound)) -{ - if (CORBA::is_nil (this->fault_notifier_.in ())) - { - ACE_THROW_RETURN ( FT::InterfaceNotFound () , FT::FaultNotifier::_nil ()); - } - return FT::FaultNotifier::_duplicate (this->fault_notifier_.in ()); -} - - -// TAO-specific find factory registry -//CORBA -::PortableGroup::FactoryRegistry_ptr -TAO::FT_ReplicationManager::get_factory_registry ( - const PortableGroup::Criteria & selection_criteria - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ( (CORBA::SystemException)) -{ - ACE_UNUSED_ARG (selection_criteria); - return this->factory_registry_.reference (); -} - -// TAO-specific shutdown operation. -//public -void TAO::FT_ReplicationManager::shutdown ( - ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ( (CORBA::SystemException)) -{ - this->quit_ = 1; -} - -// Get the type_id associated with an object group. -//CORBA -char * TAO::FT_ReplicationManager::type_id ( - PortableGroup::ObjectGroup_ptr object_group - ACE_ENV_ARG_DECL) -{ - char * result = 0; - TAO::PG_Object_Group * group = 0; - if (this->group_factory_.find_group (object_group, group)) - { - result = group->get_type_id (); - } - else - { - ACE_THROW_RETURN (PortableGroup::ObjectGroupNotFound (), 0); - } - return result; -} - -////////////////////////////////////////////////////// -// PortableGroup::PropertyManager methods - -//CORBA -void -TAO::FT_ReplicationManager::set_default_properties ( - const PortableGroup::Properties & props - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableGroup::InvalidProperty, - PortableGroup::UnsupportedProperty)) -{ - - this->properties_support_.set_default_properties (props ACE_ENV_ARG_PARAMETER); - //@@ validate properties? -} - -//CORBA -PortableGroup::Properties * -TAO::FT_ReplicationManager::get_default_properties ( - ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ( (CORBA::SystemException)) -{ - return this->properties_support_.get_default_properties ( - ACE_ENV_SINGLE_ARG_PARAMETER); -} - -//CORBA -void -TAO::FT_ReplicationManager::remove_default_properties ( - const PortableGroup::Properties & props - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ( (CORBA::SystemException, - PortableGroup::InvalidProperty, - PortableGroup::UnsupportedProperty)) -{ - this->properties_support_.remove_default_properties (props - ACE_ENV_ARG_PARAMETER); -} - -//CORBA -void -TAO::FT_ReplicationManager::set_type_properties ( - const char *type_id, - const PortableGroup::Properties & overrides - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ( (CORBA::SystemException, - PortableGroup::InvalidProperty, - PortableGroup::UnsupportedProperty)) -{ - this->properties_support_.set_type_properties ( - type_id, - overrides - ACE_ENV_ARG_PARAMETER); -} - -//CORBA -PortableGroup::Properties * -TAO::FT_ReplicationManager::get_type_properties ( - const char *type_id - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ( (CORBA::SystemException)) -{ - return this->properties_support_.get_type_properties (type_id - ACE_ENV_ARG_PARAMETER); -} - -//CORBA -void -TAO::FT_ReplicationManager::remove_type_properties ( - const char *type_id, - const PortableGroup::Properties & props - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ( (CORBA::SystemException, - PortableGroup::InvalidProperty, - PortableGroup::UnsupportedProperty)) -{ - this->properties_support_.remove_type_properties ( - type_id, - props - ACE_ENV_ARG_PARAMETER); -} - -//CORBA -void -TAO::FT_ReplicationManager::set_properties_dynamically ( - PortableGroup::ObjectGroup_ptr object_group, - const PortableGroup::Properties & overrides - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ( (CORBA::SystemException, - PortableGroup::ObjectGroupNotFound, - PortableGroup::InvalidProperty, - PortableGroup::UnsupportedProperty)) -{ - - TAO::PG_Object_Group * group = 0; - if (this->group_factory_.find_group (object_group, group)) - { - group->set_properties_dynamically (overrides ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - else - { - ACE_THROW (PortableGroup::ObjectGroupNotFound ()); - } -} - -//CORBA -PortableGroup::Properties * -TAO::FT_ReplicationManager::get_properties ( - PortableGroup::ObjectGroup_ptr object_group - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ( (CORBA::SystemException, - PortableGroup::ObjectGroupNotFound)) -{ - PortableGroup::Properties_var result; - ACE_NEW_THROW_EX (result, PortableGroup::Properties(), CORBA::NO_MEMORY ()); - - TAO::PG_Object_Group * group = 0; - if (this->group_factory_.find_group (object_group, group)) - { - group->get_properties (result); - } - else - { - ACE_THROW_RETURN (PortableGroup::ObjectGroupNotFound (), 0); - } - return result._retn(); -} - - -////////////////////////////////////////////////////// -// FT::FTObjectGroupManager methods - -/// Sets the primary member of a group. -//CORBA -PortableGroup::ObjectGroup_ptr -TAO::FT_ReplicationManager::set_primary_member ( - PortableGroup::ObjectGroup_ptr object_group, - const PortableGroup::Location & the_location - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ( ( - CORBA::SystemException - , PortableGroup::ObjectGroupNotFound - , PortableGroup::MemberNotFound - , FT::PrimaryNotSet - , FT::BadReplicationStyle - )) -{ - METHOD_ENTRY (TAO::FT_ReplicationManager::set_primary_member); - PortableGroup::ObjectGroup_var result = PortableGroup::ObjectGroup::_nil(); - TAO::PG_Object_Group * group = 0; - if (this->group_factory_.find_group (object_group, group)) - { - - PortableGroup::TagGroupTaggedComponent tag_component; - TAO_FT_IOGR_Property prop (tag_component); - - int sts = group->set_primary_member (&prop, the_location ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (PortableGroup::ObjectGroup::_nil ()); - if (sts) - { - result = group->reference (); - } - else - { - ACE_THROW_RETURN (FT::PrimaryNotSet (), PortableGroup::ObjectGroup::_nil ()); - } - } - else - { - ACE_THROW_RETURN (PortableGroup::ObjectGroupNotFound (), PortableGroup::ObjectGroup::_nil ()); - } - METHOD_RETURN (TAO::FT_ReplicationManager::set_primary_member) result._retn (); -} - -//CORBA -PortableGroup::ObjectGroup_ptr -TAO::FT_ReplicationManager::create_member ( - PortableGroup::ObjectGroup_ptr object_group, - const PortableGroup::Location & the_location, - const char * type_id, - const PortableGroup::Criteria & the_criteria - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ( (CORBA::SystemException, - PortableGroup::ObjectGroupNotFound, - PortableGroup::MemberAlreadyPresent, - PortableGroup::NoFactory, - PortableGroup::ObjectNotCreated, - PortableGroup::InvalidCriteria, - PortableGroup::CannotMeetCriteria)) -{ - PortableGroup::ObjectGroup_var result = PortableGroup::ObjectGroup::_nil(); - TAO::PG_Object_Group * group = 0; - if (this->group_factory_.find_group (object_group, group)) - { - group->create_member (the_location, type_id, the_criteria ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (PortableGroup::ObjectGroup::_nil ()); - result = group->reference (); - } - else - { - if (TAO_debug_level > 0) - { - ACE_ERROR ( (LM_ERROR, - ACE_TEXT ("%T %n (%P|%t) - FT_ReplicationManager::create_member: unknown group\n") - )); - } - ACE_THROW_RETURN (PortableGroup::ObjectGroupNotFound (), result._retn ()); - } - return result._retn(); -} - - -//CORBA -PortableGroup::ObjectGroup_ptr -TAO::FT_ReplicationManager::add_member ( - PortableGroup::ObjectGroup_ptr object_group, - const PortableGroup::Location & the_location, - CORBA::Object_ptr member - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ( (CORBA::SystemException, - PortableGroup::ObjectGroupNotFound, - PortableGroup::MemberAlreadyPresent, - PortableGroup::ObjectNotAdded)) -{ - METHOD_ENTRY (TAO::FT_ReplicationManager::add_member); - PortableGroup::ObjectGroup_var result = PortableGroup::ObjectGroup::_nil (); - - // Find the object group corresponding to this IOGR - TAO::PG_Object_Group * group = 0; - if (this->group_factory_.find_group (object_group, group)) - { - group->add_member ( - the_location, - member - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (CORBA::Object::_nil ()); - - result = group->reference (); - - } - else - { - if (TAO_debug_level > 0) - { - ACE_ERROR ( (LM_ERROR, - ACE_TEXT ("%T %n (%P|%t) - FT_ReplicationManager::add_member to unknown group\n") - )); - } - ACE_THROW_RETURN (PortableGroup::ObjectGroupNotFound (), result._retn ()); - } - METHOD_RETURN (TAO::FT_ReplicationManager::add_member) result._retn (); -} - -//CORBA -PortableGroup::ObjectGroup_ptr -TAO::FT_ReplicationManager::remove_member ( - PortableGroup::ObjectGroup_ptr object_group, - const PortableGroup::Location & the_location - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ( (CORBA::SystemException, - PortableGroup::ObjectGroupNotFound, - PortableGroup::MemberNotFound)) -{ - PortableGroup::ObjectGroup_var result = PortableGroup::ObjectGroup::_nil (); - - // Find the object group corresponding to this IOGR - TAO::PG_Object_Group * group = 0; - if (this->group_factory_.find_group (object_group, group)) - { - group->remove_member (the_location ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (result._retn ()); - - group->minimum_populate (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (result._retn ()); - //@@ how about the case where the member was removed successfully, - // but for one reason or another we were unable to bring the group - // back up to minimum_number_of_replicas? - - result = group->reference (); - } - else - { - ACE_THROW_RETURN (PortableGroup::ObjectGroupNotFound (), result._retn ()); - } - return result._retn (); -} - -//CORBA -PortableGroup::Locations * -TAO::FT_ReplicationManager::locations_of_members ( - PortableGroup::ObjectGroup_ptr object_group - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ( (CORBA::SystemException, - PortableGroup::ObjectGroupNotFound)) -{ - PortableGroup::Locations * result = 0; - - // Find the object group corresponding to this IOGR - TAO::PG_Object_Group * group = 0; - if (this->group_factory_.find_group (object_group, group)) - { - result = group->locations_of_members ( - ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - } - else - { - if (TAO_debug_level > 0) - { - ACE_ERROR ( (LM_ERROR, - ACE_TEXT ("%T %n (%P|%t) - FT_ReplicationManager::locations_of_members: unknown group\n") - )); - } - ACE_THROW_RETURN (PortableGroup::ObjectGroupNotFound (), 0); - } - return result; -} - -//CORBA -PortableGroup::ObjectGroups * -TAO::FT_ReplicationManager::groups_at_location ( - const PortableGroup::Location & the_location - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ( (CORBA::SystemException)) -{ - return this->group_factory_.groups_at_location (the_location ACE_ENV_ARG_PARAMETER); -} - -//CORBA -PortableGroup::ObjectGroupId -TAO::FT_ReplicationManager::get_object_group_id ( - PortableGroup::ObjectGroup_ptr object_group - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ( (CORBA::SystemException, - PortableGroup::ObjectGroupNotFound)) -{ - PortableGroup::ObjectGroupId result = 0; - TAO::PG_Object_Group * group = 0; - if (this->group_factory_.find_group (object_group, group)) - { - group->get_object_group_id (); - ACE_CHECK_RETURN (result); - result = group->get_object_group_id (); - } - else - { - if (TAO_debug_level > 0) - { - ACE_ERROR ( (LM_ERROR, - ACE_TEXT ("%T %n (%P|%t) - FT_ReplicationManager::get_object_group_id: unknown group\n") - )); - } - ACE_THROW_RETURN (PortableGroup::ObjectGroupNotFound (), result); - } - return result; -} - -//CORBA -PortableGroup::ObjectGroup_ptr -TAO::FT_ReplicationManager::get_object_group_ref ( - PortableGroup::ObjectGroup_ptr object_group - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ( (CORBA::SystemException, - PortableGroup::ObjectGroupNotFound)) -{ - PortableGroup::ObjectGroup_var result = PortableGroup::ObjectGroup::_nil (); - - // Find the object group corresponding to this IOGR - TAO::PG_Object_Group * group = 0; - if (this->group_factory_.find_group (object_group, group)) - { - result = group->reference (); - } - else - { - if (TAO_debug_level > 0) - { - ACE_ERROR ( (LM_ERROR, - ACE_TEXT ("%T %n (%P|%t) - FT_ReplicationManager::get_object_group_ref: unknown group\n") - )); - } - ACE_THROW_RETURN (PortableGroup::ObjectGroupNotFound (), result._retn ()); - } - return result._retn(); -} - -//CORBA, TAO specific -PortableGroup::ObjectGroup_ptr -TAO::FT_ReplicationManager::get_object_group_ref_from_id ( - PortableGroup::ObjectGroupId group_id - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ( ( - CORBA::SystemException - , PortableGroup::ObjectGroupNotFound - )) -{ - PortableGroup::ObjectGroup_var result = PortableGroup::ObjectGroup::_nil (); - - // Find the object group corresponding to this IOGR - TAO::PG_Object_Group * group = 0; - if (this->group_factory_.find_group (group_id, group)) - { - result = group->reference (); - } - else - { - if (TAO_debug_level > 0) - { - ACE_ERROR ( (LM_ERROR, - ACE_TEXT ("%T %n (%P|%t) - FT_ReplicationManager::get_object_group_ref_from_id: unknown group\n") - )); - } - ACE_THROW_RETURN (PortableGroup::ObjectGroupNotFound (), result._retn ()); - } - return result._retn(); -} - -//CORBA -CORBA::Object_ptr -TAO::FT_ReplicationManager::get_member_ref ( - PortableGroup::ObjectGroup_ptr object_group, - const PortableGroup::Location & the_location - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ( (CORBA::SystemException, - PortableGroup::ObjectGroupNotFound, - PortableGroup::MemberNotFound)) -{ - CORBA::Object_var result = CORBA::Object::_nil(); - - // Find the object group corresponding to this IOGR - TAO::PG_Object_Group * group = 0; - if (this->group_factory_.find_group (object_group, group)) - { - result = group->get_member_reference (the_location ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (CORBA::Object::_nil()); - } - else - { - if (TAO_debug_level > 0) - { - ACE_ERROR ( (LM_ERROR, - ACE_TEXT ("%T %n (%P|%t) - FT_ReplicationManager::get_member_ref: unknown group\n") - )); - } - ACE_THROW_RETURN (PortableGroup::ObjectGroupNotFound (), result._retn ()); - } - return result._retn(); -} - - -////////////////////////////////////////////////////// -// PortableGroup::GenericFactory methods - -//CORBA -CORBA::Object_ptr -TAO::FT_ReplicationManager::create_object ( - const char * type_id, - const PortableGroup::Criteria & the_criteria, - PortableGroup::GenericFactory::FactoryCreationId_out factory_creation_id - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ( (CORBA::SystemException, - PortableGroup::NoFactory, - PortableGroup::ObjectNotCreated, - PortableGroup::InvalidCriteria, - PortableGroup::InvalidProperty, - PortableGroup::CannotMeetCriteria)) -{ - METHOD_ENTRY (TAO::FT_ReplicationManager::create_object) - - //////////////////////////////// - // find the properties for this - // type of object group - TAO::PG_Property_Set * typeid_properties - = this->properties_support_.find_typeid_properties ( - type_id - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (CORBA::Object::_nil ()); - - TAO::PG_Object_Group * group - = this->group_factory_.create_group ( - type_id, - the_criteria, - typeid_properties - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (CORBA::Object::_nil ()); - - group->initial_populate (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (CORBA::Object::_nil ()); - //@@ on error we should remove the group from the Group_Factory - // doing this "right" will require a var-type pointer to the object group - // that knows about the factory, too. - - // Allocate a new FactoryCreationId for use as an "out" parameter. - PortableGroup::GenericFactory::FactoryCreationId_ptr factory_id_ptr = 0; - ACE_NEW_THROW_EX (factory_id_ptr, - PortableGroup::GenericFactory::FactoryCreationId, - CORBA::NO_MEMORY ( - CORBA::SystemException::_tao_minor_code ( - TAO::VMCID, - ENOMEM), - CORBA::COMPLETED_NO)); - ACE_CHECK_RETURN (CORBA::Object::_nil ()); - PortableGroup::GenericFactory::FactoryCreationId_var factory_id = factory_id_ptr; - PortableGroup::ObjectGroupId group_id = group->get_object_group_id (); - factory_id <<= group_id; - factory_creation_id = factory_id._retn(); - - METHOD_RETURN (TAO::FT_ReplicationManager::create_object) group->reference (); -} - -//CORBA -void -TAO::FT_ReplicationManager::delete_object ( - const PortableGroup::GenericFactory::FactoryCreationId & factory_creation_id - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ( (CORBA::SystemException, - PortableGroup::ObjectNotFound)) -{ - - PortableGroup::ObjectGroupId group_id = 0; - if (factory_creation_id >>= group_id) - { - this->group_factory_.delete_group ( - group_id - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - } - else - { - ACE_THROW (PortableGroup::ObjectNotFound ()); - } -} - -//private -int TAO::FT_ReplicationManager::write_ior () -{ - int result = -1; - FILE* out = ACE_OS::fopen (this->ior_output_file_, "w"); - if (out) - { - CORBA::String_var ior_str = this->orb_->object_to_string ( - this->replication_manager_ref_.in ()); - ACE_OS::fprintf (out, "%s", ior_str.in ()); - ACE_OS::fclose (out); - result = 0; - } - else - { - ACE_ERROR ( (LM_ERROR, - ACE_TEXT ("%T %n (%P|%t) - Open failed for %s\n"), this->ior_output_file_ - )); - } - return result; -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager.h b/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager.h deleted file mode 100644 index a38ed1ec911..00000000000 --- a/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager.h +++ /dev/null @@ -1,527 +0,0 @@ -/* -*- C++ -*- */ -//============================================================================= -/** - * @file FT_ReplicationManager.h - * - * $Id$ - * - * This file is part of Fault Tolerant CORBA. - * - * @author Curt Hibbs <hibbs_c@ociweb.com> - */ -//============================================================================= - - -#ifndef FT_REPLICATION_MANAGER_H_ -#define FT_REPLICATION_MANAGER_H_ - -#include /**/ "ace/pre.h" -#include <ace/ACE.h> - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include <orbsvcs/FT_ReplicationManagerS.h> -//#include <orbsvcs/PortableGroup/PG_PropertyManager.h> -//#include <orbsvcs/PortableGroup/PG_GenericFactory.h> -//#include <orbsvcs/PortableGroup/PG_ObjectGroupManager.h> -// Note: the new, improved versions... -//#include <orbsvcs/PortableGroup/PG_Object_Group_Map.h> -#include <orbsvcs/PortableGroup/PG_Properties_Support.h> -#include <orbsvcs/PortableGroup/PG_Group_Factory.h> - -#include <orbsvcs/PortableGroup/PG_FactoryRegistry.h> -#include <orbsvcs/FT_ReplicationManager/FT_FaultConsumer.h> - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - /** - * Implement the ReplicationManager interfaces. - * - * The ReplicationManager does most of its work by delegating to - * support objects. These include: - * - * TAO::PG_Group_Factory group_factory_; - * The group factory contains a collection of TAO::PG_Object_Groups - * It provides methods to create new groups, destroy old groups and - * find existing groups. - * - * TAO::PG_Object_Group - * These objects which can be found through the group factory provde - * methods to create and add group members, remove and delete group - * members and set group properties. - * - * TAO::PG_Properties_Support properties_support_; - * This object maintains sets of properties(TAO::PG_Property_Set). - * In particular it has one default property set, and a collection of - * property sets indexed by type_id. - * The default property set acts as a parent to the type_id property - * sets and the type_id property sets act as parents to the property - * sets contained in PG_Object_Group. - * - * FT::FaultNotifier_var fault_notifier_; - * This notification channel is "the" source of fault notifications. - * - * TAO::FT_FaultConsumer fault_consumer_; - * This object subscribes to the fault_notifier_as a fault consumer. It - * analyzes incoming fault notifications and calls appropriate ReplicationManager - * methods to respond to the fault. - * - * TAO::PG_FactoryRegistry factory_registry_; - * This object maintains a collection of factory registrations. When a factory - * is started it registeres itself with the ReplicationManager (delegated to this - * object). When a member needs to be created in an object group this factory - * registry is queried to find factories that can create the member. - */ - class FT_ReplicationManager - : public virtual POA_FT::ReplicationManager - { - - ////////////////////// - // non-CORBA interface - - public: - /** - * Default constructor. - * Call init after constructing the object to prepare it for use. - */ - FT_ReplicationManager (); - - /** - * Destructor. - * Actual cleanup happens in the fini function. - */ - virtual ~FT_ReplicationManager (); - - public: - - /** - * Parse command line arguments. - * @param argc traditional C argc - * @param argv traditional C argv - * @return zero for success; nonzero is process return code for failure. - */ - int parse_args (int argc, char * argv[]); - - /** - * Initialize this object. - * @param orb Our CORBA::ORB -- we keep var to it. - * @return zero for success; nonzero is process return code for failure. - */ - int init (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL); - - /** - * Prepare to exit. - * @return zero for success; nonzero is process return code for failure. - */ - int fini (ACE_ENV_SINGLE_ARG_DECL); - - /** - * Idle-time activity. - * - * @param result is set to process return code if return value is non-zero. - * @return zero to continue; nonzero to exit - */ - int idle (int & result ACE_ENV_ARG_DECL); - - - /** - * Identify this fault detector factory. - * @return a string to identify this object for logging/console message purposes. - */ - const char * identity () const; - - /** - * Get the type_id associated with an object group. - * @param object_group The ObjectGroup. - * @return String identifying the type id associated with the ObjectGroup. - */ - char * type_id (PortableGroup::ObjectGroup_ptr object_group - ACE_ENV_ARG_DECL); - - - ////////////////////// - // CORBA interface(s) - - public: - - /** - * @name POA_FT::ReplicationManager Methods - * - * Methods required by the POA_FT::ReplicationManager interface. - */ - //@{ - - /// Registers the Fault Notifier with the Replication Manager. - virtual void register_fault_notifier ( - FT::FaultNotifier_ptr fault_notifier - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC (( - CORBA::SystemException - )); - - /// Returns the reference of the Fault Notifier. - virtual FT::FaultNotifier_ptr get_fault_notifier ( - ACE_ENV_SINGLE_ARG_DECL - ) - ACE_THROW_SPEC (( - CORBA::SystemException - , FT::InterfaceNotFound - )); - - /// TAO-specific find factory registry - virtual ::PortableGroup::FactoryRegistry_ptr get_factory_registry ( - const PortableGroup::Criteria & selection_criteria - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC (( - CORBA::SystemException - )); - - /// TAO-specific shutdown operation. - virtual void shutdown ( - ACE_ENV_SINGLE_ARG_DECL - ) - ACE_THROW_SPEC (( - CORBA::SystemException - )); - - //@} - - /** - * @name PortableGroup::PropertyManager Methods - * - * Methods required by the PortableGroup::PropertyManager interface. - */ - //@{ - - /// Set the default properties to be used by all object groups. - virtual void set_default_properties ( - const PortableGroup::Properties & props - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableGroup::InvalidProperty, - PortableGroup::UnsupportedProperty)); - - /// Get the default properties used by all object groups. - virtual PortableGroup::Properties * get_default_properties ( - ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Remove default properties. - virtual void remove_default_properties ( - const PortableGroup::Properties & props - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableGroup::InvalidProperty, - PortableGroup::UnsupportedProperty)); - - /** - * Set properties associated with a given Replica type. These - * properties override the default properties on a name-by-name basis. - */ - virtual void set_type_properties ( - const char * type_id, - const PortableGroup::Properties & overrides - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableGroup::InvalidProperty, - PortableGroup::UnsupportedProperty)); - - /** - * Return the properties associated with a given Replica type. These - * properties include the type-specific properties in use, in - * addition to the default properties that were not overridden. - */ - virtual PortableGroup::Properties * get_type_properties ( - const char * type_id - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Remove the given properties associated with the Replica type ID. - virtual void remove_type_properties ( - const char * type_id, - const PortableGroup::Properties & props - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableGroup::InvalidProperty, - PortableGroup::UnsupportedProperty)); - - /** - * Dynamically set the properties associated with a given object - * group as the replication manager and replicas are being executed. - * These properties override the type-specific and default - * properties. - */ - virtual void set_properties_dynamically ( - PortableGroup::ObjectGroup_ptr object_group, - const PortableGroup::Properties & overrides - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableGroup::ObjectGroupNotFound, - PortableGroup::InvalidProperty, - PortableGroup::UnsupportedProperty)); - - /** - * Return the properties currently in use by the given object - * group. These properties include those that were set dynamically, - * type-specific properties that weren't overridden, properties that - * were used when the Replica was created, and default properties - * that weren't overridden. - */ - virtual PortableGroup::Properties * get_properties ( - PortableGroup::ObjectGroup_ptr object_group - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableGroup::ObjectGroupNotFound)); - - //@} - - /** - * @name FT::FTObjectGroupManager methods - * - * Methods required by the FT::FTObjectGroupManager - * interface. - */ - //@{ - - /// Create a member in an object group. - virtual PortableGroup::ObjectGroup_ptr create_member ( - PortableGroup::ObjectGroup_ptr object_group, - const PortableGroup::Location & the_location, - const char * type_id, - const PortableGroup::Criteria & the_criteria - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableGroup::ObjectGroupNotFound, - PortableGroup::MemberAlreadyPresent, - PortableGroup::NoFactory, - PortableGroup::ObjectNotCreated, - PortableGroup::InvalidCriteria, - PortableGroup::CannotMeetCriteria)); - - /// Add an existing object to the ObjectGroup. - virtual PortableGroup::ObjectGroup_ptr add_member ( - PortableGroup::ObjectGroup_ptr object_group, - const PortableGroup::Location & the_location, - CORBA::Object_ptr member - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableGroup::ObjectGroupNotFound, - PortableGroup::MemberAlreadyPresent, - PortableGroup::ObjectNotAdded)); - - /** - * Remove the member at a specific location from an - * ObjectGroup. Application created objects must be - * deleted by the application. Objects created by the - * infrastructure (replication manager) will be deleted by the - * infrastructure. - * For infrastructure-controlled membership: After the member - * is removed from the group the minumum number of members - * parameter will be checked and new members will be created - * as necessary (if possible.) - */ - virtual PortableGroup::ObjectGroup_ptr remove_member ( - PortableGroup::ObjectGroup_ptr object_group, - const PortableGroup::Location & the_location - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableGroup::ObjectGroupNotFound, - PortableGroup::MemberNotFound)); - - /// Return the locations of the members in the given ObjectGroup. - virtual PortableGroup::Locations * locations_of_members ( - PortableGroup::ObjectGroup_ptr object_group - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableGroup::ObjectGroupNotFound)); - - /// Return the locations of the members in the given ObjectGroup. - virtual PortableGroup::ObjectGroups * groups_at_location ( - const PortableGroup::Location & the_location - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - - /// Return the ObjectGroupId for the given ObjectGroup. - virtual PortableGroup::ObjectGroupId get_object_group_id ( - PortableGroup::ObjectGroup_ptr object_group - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableGroup::ObjectGroupNotFound)); - - /** - * Return an update the IOGR for an object group. If no changes have - * been made in the group the return value will be the same as the object_group - * parameter. - */ - virtual PortableGroup::ObjectGroup_ptr get_object_group_ref ( - PortableGroup::ObjectGroup_ptr object_group - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableGroup::ObjectGroupNotFound)); - - /** - * TAO-specific extension. - * Return the ObjectGroup reference for the given ObjectGroupId. - */ - virtual PortableGroup::ObjectGroup_ptr get_object_group_ref_from_id ( - PortableGroup::ObjectGroupId group_id - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC (( - CORBA::SystemException - , PortableGroup::ObjectGroupNotFound - )); - - /** - * Return the reference corresponding to the Replica of a given - * ObjectGroup at the given location. - */ - virtual CORBA::Object_ptr get_member_ref ( - PortableGroup::ObjectGroup_ptr object_group, - const PortableGroup::Location & loc - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableGroup::ObjectGroupNotFound, - PortableGroup::MemberNotFound)); - - /// Sets the primary member of a group. - virtual PortableGroup::ObjectGroup_ptr set_primary_member ( - PortableGroup::ObjectGroup_ptr object_group, - const PortableGroup::Location & the_location - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC (( - CORBA::SystemException - , PortableGroup::ObjectGroupNotFound - , PortableGroup::MemberNotFound - , FT::PrimaryNotSet - , FT::BadReplicationStyle - )); - - //@} - - /** - * @name PortableGroup::GenericFactory methods - * - * Methods required by the PortableGroup::GenericFactory interface. - */ - //@{ - - /** - * Create an object of the specified type that adheres to the - * restrictions defined by the provided Criteria. The out - * FactoryCreationId parameter may be passed to the delete_object() - * method to delete the object. - * - * Infrastructure controlled membership: The initial number of members - * property will be honored by creating new members and adding them to - * the group. - */ - virtual CORBA::Object_ptr create_object ( - const char * type_id, - const PortableGroup::Criteria & the_criteria, - PortableGroup::GenericFactory::FactoryCreationId_out - factory_creation_id - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableGroup::NoFactory, - PortableGroup::ObjectNotCreated, - PortableGroup::InvalidCriteria, - PortableGroup::InvalidProperty, - PortableGroup::CannotMeetCriteria)); - - /** - * Delete the object group corresponding to the provided - * FactoryCreationId. For infratructure-controlled membership - * all members will be deleted. For application-controlled membership - * the application is responsible for deleting group members. - */ - virtual void delete_object ( - const PortableGroup::GenericFactory::FactoryCreationId & - factory_creation_id - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - PortableGroup::ObjectNotFound)); - - //@} - - ///////////////////////// - // Implementation methods - private: - /** - * Write this factory's IOR to a file - */ - int write_ior (void); - - /// Registers the Fault Notifier with the Replication Manager. - void register_fault_notifier_i ( - FT::FaultNotifier_ptr fault_notifier - ACE_ENV_ARG_DECL - ) - ACE_THROW_SPEC (( - CORBA::SystemException - )); - - //////////////// - // Forbidden methods - FT_ReplicationManager (const FT_ReplicationManager & rhs); - FT_ReplicationManager & operator = (const FT_ReplicationManager & rhs); - - /////////////// - // Data Members - private: - - /// The orb - CORBA::ORB_var orb_; - - /// The POA. - PortableServer::POA_var poa_; - - /// A file to which the factory's IOR should be written. - const char * ior_output_file_; - - /// A name to be used to register the factory with the name service. - const char * ns_name_; - CosNaming::NamingContext_var naming_context_; - CosNaming::Name this_name_; - - /// Our object reference. - FT::ReplicationManager_var replication_manager_ref_; - - /// A human-readable string to identify this Replication Manager. - ACE_CString identity_; - - /// an object that manages a collection of object groups - TAO::PG_Group_Factory group_factory_; - - /// an object that manages default and type_id related properties - TAO::PG_Properties_Support properties_support_; - - /// The fault notifier. - FT::FaultNotifier_var fault_notifier_; - /// set by command line -f option - const char * fault_notifier_ior_string_; - - /// The fault consumer. - TAO::FT_FaultConsumer fault_consumer_; - - /// The factory registry - TAO::PG_FactoryRegistry factory_registry_; - - /// Quit flag. - int quit_; - }; - -} // namespace TAO - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* FT_REPLICATION_MANAGER_H_ */ diff --git a/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager.mpc b/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager.mpc deleted file mode 100644 index c34f71456b1..00000000000 --- a/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager.mpc +++ /dev/null @@ -1,25 +0,0 @@ -// $Id$ -project(*Lib): orbsvcslib, conv_lib, fault_tolerance, notification_skel, ftorb, portablegroup, minimum_corba { - sharedname = TAO_ReplicationManagerLib - dynamicflags = TAO_REPLICATIONMANAGERLIB_BUILD_DLL - - Source_Files { - FT_FaultAnalyzer.cpp - FT_DefaultFaultAnalyzer.cpp - FT_FaultEventDescriptor.cpp - FT_FaultConsumer.cpp - } -} - -project : taoserver, orbsvcsexe, fault_tolerance, notification_skel, iormanip, iortable, ftorb, core { - exename = FT_ReplicationManager - libs += TAO_ReplicationManagerLib - after += FT_ReplicationManager_Lib - Source_Files { - FT_ReplicationManager.cpp - FT_ReplicationManager_Main.cpp - FT_Property_Validator.cpp - FT_ReplicationManagerFaultAnalyzer.cpp - } -} - diff --git a/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManagerFaultAnalyzer.cpp b/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManagerFaultAnalyzer.cpp deleted file mode 100755 index 4606008727c..00000000000 --- a/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManagerFaultAnalyzer.cpp +++ /dev/null @@ -1,1118 +0,0 @@ -/* -*- C++ -*- */ -//============================================================================= -/** - * @file FT_ReplicationManagerFaultAnalyzer.cpp - * - * $Id$ - * - * This file is part of TAO's implementation of Fault Tolerant CORBA. - * - * @author Steve Totten <totten_s@ociweb.com> - */ -//============================================================================= - -#include "FT_ReplicationManagerFaultAnalyzer.h" -#include "orbsvcs/CosNotifyCommC.h" -#include "orbsvcs/FT_NotifierC.h" -#include "orbsvcs/FT_ReplicationManager/FT_ReplicationManager.h" -#include "orbsvcs/FT_ReplicationManager/FT_FaultEventDescriptor.h" -#include "orbsvcs/PortableGroup/PG_Property_Utils.h" -#include "orbsvcs/PortableGroup/PG_Operators.h" -#include "orbsvcs/FaultTolerance/FT_IOGR_Property.h" -#include "tao/debug.h" -#include <iostream> - -ACE_RCSID (FT_ReplicationManagerFaultAnalyzer, - FT_ReplicationManagerFaultAnalyzer, - "$Id$") - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -/// Constructor. -TAO::FT_ReplicationManagerFaultAnalyzer::FT_ReplicationManagerFaultAnalyzer ( - const TAO::FT_ReplicationManager * replication_manager) - : replication_manager_ ( - const_cast<TAO::FT_ReplicationManager *> (replication_manager)) -{ -} - -/// Destructor. -TAO::FT_ReplicationManagerFaultAnalyzer::~FT_ReplicationManagerFaultAnalyzer () -{ -} - -// Validate the event to make sure it is one we can handle. -// If it is not an event we can handle, this function logs the error -// and returns -1. -int TAO::FT_ReplicationManagerFaultAnalyzer::validate_event_type ( - const CosNotification::StructuredEvent & event) -{ - // Delegate to base class. - //@@ Visual C++ 6.0 won't compile this if I include the namespace name - // on the base class. - // return TAO::FT_DefaultFaultAnalyzer::validate_event_type (event); - return FT_DefaultFaultAnalyzer::validate_event_type (event); -} - -/// Analyze a fault event. -int TAO::FT_ReplicationManagerFaultAnalyzer::analyze_fault_event ( - const CosNotification::StructuredEvent & event) -{ - int result = 0; - - const CosNotification::FilterableEventBody & filterable = - event.filterable_data; - CORBA::ULong item_count = filterable.length (); - if (TAO_debug_level > 6) - { - for (CORBA::ULong n_prop = 0; n_prop < item_count; ++n_prop) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT( - "TAO::FT_ReplicationManagerFaultAnalyzer::analyze_fault_event: " - "Property Name: <%s>\n"), - filterable[n_prop].name.in() - )); - } - } - - // Populate a TAO::FT_FaultEventDescriptor structure from the - // properties in the event. - TAO::FT_FaultEventDescriptor fault_event_desc; - - // Extract the location. - if (result == 0) - { - result = this->get_location ( - filterable[1].value, fault_event_desc.location.out()); - } - - // CORBA 3.0.2, section 23.4.5.1 states: - // - // The fault detector may or may not set the TypeId and - // ObjectGroupId fields with the following interpretations: - // - Neither is set if all objects at the given location have failed. - // - TypeId is set and ObjectGroupId is not set if all objects at - // the given location with the given type have failed. - // - Both are set if the member with the given ObjectGroupId at the - // given location has failed. - - if ((result == 0) && (item_count == 2)) - { - // All objects at location failed. - fault_event_desc.all_at_location_failed = 1; - } - - if ((result == 0) && (item_count == 3)) - { - // All objects of type at location failed. - fault_event_desc.all_of_type_at_location_failed = 1; - result = this->get_type_id ( - filterable[2].value, fault_event_desc.type_id.out()); - } - - if ((result == 0) && (item_count == 4)) - { - // An object (replica) at a location failed. - fault_event_desc.object_at_location_failed = 1; - result = this->get_type_id ( - filterable[2].value, fault_event_desc.type_id.out()); - if (result == 0) - { - result = this->get_object_group_id ( - filterable[3].value, fault_event_desc.object_group_id); - } - } - - // A specific object at a location failed. - if ((result == 0) && (fault_event_desc.object_at_location_failed == 1)) - { - result = this->single_replica_failure (fault_event_desc); - } - - // All objects at location failed. - if ((result == 0) && (fault_event_desc.all_at_location_failed == 1)) - { - result = this->location_failure (fault_event_desc); - } - - // All objects of type at location failed. - if ((result == 0) && (fault_event_desc.all_of_type_at_location_failed == 1)) - { - result = this->type_failure (fault_event_desc); - } - - // Debugging support. - if (TAO_debug_level > 6) - { - fault_event_desc.dump (); - } - - return result; -} - -// Extract a string type_id from CORBA::Any. -// Caller owns the string returned via <type_id>. -int TAO::FT_ReplicationManagerFaultAnalyzer::get_type_id ( - const CORBA::Any& val, PortableGroup::TypeId_out type_id) -{ - const char* type_id_value; - if ((val >>= type_id_value) == 0) - { - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ( - "TAO::FT_ReplicationManagerFaultAnalyzer::get_type_id: " - "Could not extract TypeId value from any.\n")), - -1); - } - - // Make a deep copy of the TypeId string. - type_id = CORBA::string_dup (type_id_value); - return 0; -} - -// Extract the ObjectGroupId from CORBA::Any. -int TAO::FT_ReplicationManagerFaultAnalyzer::get_object_group_id ( - const CORBA::Any& val, PortableGroup::ObjectGroupId& id) -{ - PortableGroup::ObjectGroupId temp_id = (PortableGroup::ObjectGroupId)0; - if ((val >>= temp_id) == 0) - { - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ( - "TAO::FT_ReplicationManagerFaultAnalyzer::get_object_group_id: " - "Could not extract ObjectGroupId value from any.\n")), - -1); - } - id = temp_id; - return 0; -} - -int TAO::FT_ReplicationManagerFaultAnalyzer::get_location ( - const CORBA::Any& val, PortableGroup::Location_out location) -{ - const PortableGroup::Location* temp_loc; - if ((val >>= temp_loc) == 0) - { - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ( - "TAO::FT_ReplicationManagerFaultAnalyzer::get_location: " - "Could not extract Location value from fault event.\n")), - -1); - } - // Make a deep copy of the Location. - ACE_NEW_RETURN (location, PortableGroup::Location (*temp_loc), -1); - return 0; -} - -// -//TODO: Use TAO::PG_Property_Set to get property values from properties -// instead of all these specific "get" functions. -// - -// Get the MembershipStyle property. -int TAO::FT_ReplicationManagerFaultAnalyzer::get_membership_style ( - const PortableGroup::Properties & properties, - PortableGroup::MembershipStyleValue & membership_style) -{ - PortableGroup::Name prop_name (1); - prop_name.length (1); - prop_name[0].id = CORBA::string_dup (FT::FT_MEMBERSHIP_STYLE); - int result = 0; - - PortableGroup::Value value; - if (TAO_PG::get_property_value (prop_name, properties, value) - && ((value >>= membership_style) == 1)) - { - if (TAO_debug_level > 6) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ( - "TAO::FT_ReplicationManagerFaultAnalyzer::get_membership_style: " - "MembershipStyle is <%d>:\n"), - membership_style - )); - } - } - else - { - result = -1; - } - - return result; -} - -int TAO::FT_ReplicationManagerFaultAnalyzer::get_replication_style ( - const PortableGroup::Properties & properties, - FT::ReplicationStyleValue & replication_style) -{ - PortableGroup::Name prop_name (1); - prop_name.length (1); - prop_name[0].id = CORBA::string_dup (FT::FT_REPLICATION_STYLE); - int result = 0; - - PortableGroup::Value value; - if (TAO_PG::get_property_value (prop_name, properties, value) - && ((value >>= replication_style) == 1)) - { - if (TAO_debug_level > 6) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ( - "TAO::FT_ReplicationManagerFaultAnalyzer::get_replication_style: " - "ReplicationStyle is <%d>:\n"), - replication_style - )); - } - } - else - { - result = -1; - } - - return result; -} - -int TAO::FT_ReplicationManagerFaultAnalyzer::get_minimum_number_members ( - const PortableGroup::Properties & properties, - PortableGroup::MinimumNumberMembersValue & minimum_number_members) -{ - PortableGroup::Name prop_name (1); - prop_name.length (1); - prop_name[0].id = CORBA::string_dup (FT::FT_MINIMUM_NUMBER_MEMBERS); - int result = 0; - - PortableGroup::Value value; - if (TAO_PG::get_property_value (prop_name, properties, value) - && ((value >>= minimum_number_members) == 1)) - { - if (TAO_debug_level > 6) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ( - "TAO::FT_ReplicationManagerFaultAnalyzer::get_minimum_number_members: " - "MinimumNumberMembers is <%d>:\n"), - minimum_number_members - )); - } - } - else - { - result = -1; - } - - return result; -} - -int TAO::FT_ReplicationManagerFaultAnalyzer::get_initial_number_members ( - const PortableGroup::Properties & properties, - PortableGroup::InitialNumberMembersValue & initial_number_members) -{ - PortableGroup::Name prop_name (1); - prop_name.length (1); - prop_name[0].id = CORBA::string_dup (FT::FT_INITIAL_NUMBER_MEMBERS); - int result = 0; - - PortableGroup::Value value; - if (TAO_PG::get_property_value (prop_name, properties, value) - && ((value >>= initial_number_members) == 1)) - { - if (TAO_debug_level > 6) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ( - "TAO::FT_ReplicationManagerFaultAnalyzer::get_initial_number_members: " - "InitialNumberMembers is <%d>:\n"), - initial_number_members - )); - } - } - else - { - result = -1; - } - - return result; -} - -int TAO::FT_ReplicationManagerFaultAnalyzer::get_factories ( - const PortableGroup::Properties & properties, - PortableGroup::FactoryInfos_out factories) -{ - PortableGroup::Name prop_name (1); - prop_name.length (1); - prop_name[0].id = CORBA::string_dup (FT::FT_FACTORIES); - int result = 0; - - PortableGroup::FactoryInfos_var temp_factories; - PortableGroup::Value value; - if (TAO_PG::get_property_value (prop_name, properties, value) == 1) - { - if ((value >>= temp_factories) == 0) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ( - "TAO::FT_ReplicationManagerFaultAnalyzer::get_factories: " - "Could not extract Factories from properties.\n") - )); - result = -1; - } - else - { - // Make a deep copy of the Factories. - ACE_NEW_RETURN (factories, PortableGroup::FactoryInfos (temp_factories.in()), -1); - result = 0; - } - } - else - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ( - "TAO::FT_ReplicationManagerFaultAnalyzer::get_factories: " - "Could not find Factories property.\n") - )); - result = -1; - } - return result; -} - -int TAO::FT_ReplicationManagerFaultAnalyzer::is_primary_member ( - const PortableGroup::ObjectGroup_ptr iogr, - const PortableGroup::Location & location, - int & object_is_primary) -{ - - // To determine if this was a primary that faulted: - // Get the TagFTGroupTaggedComponent from the IOGR and search - // for the primary, using the TAO_FT_IOGR_Property helper class. - // Then, compare the TypeId and Location of the failed object with - // those of the primary. If they match, it was a primary fault. - - int result = 0; - object_is_primary = 0; - - ACE_TRY_NEW_ENV - { - // Create an "empty" TAO_FT_IOGR_Property and use it to get the - // tagged component. - TAO_FT_IOGR_Property temp_ft_prop; - FT::TagFTGroupTaggedComponent ft_group_tagged_component; - CORBA::Boolean got_tagged_component = - temp_ft_prop.get_tagged_component ( - iogr, ft_group_tagged_component ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - if (got_tagged_component) - { - // Create a new TAO_FT_IOGR_Property with the tagged - // component. - TAO_FT_IOGR_Property ft_prop (ft_group_tagged_component); - - // Check to see if a primary is set. - CORBA::Boolean primary_is_set = ft_prop.is_primary_set ( - iogr ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - if (primary_is_set) - { - // Get the primary object. - CORBA::Object_var primary_obj = ft_prop.get_primary ( - iogr ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - if (CORBA::is_nil (primary_obj.in())) - { - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ( - "TAO::FT_ReplicationManagerFaultAnalyzer::is_primary_member: " - "Could not get primary IOR from IOGR.\n")), - -1); - } - - // Get the object reference of the failed member. - CORBA::Object_var failed_obj = - this->replication_manager_->get_member_ref ( - iogr, location ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - if (CORBA::is_nil (failed_obj.in())) - { - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ( - "TAO::FT_ReplicationManagerFaultAnalyzer::is_primary_member: " - "Could not get IOR of failed member from IOGR.\n")), - -1); - } - - // Are the two object refs (primary and failed) equivalent? - CORBA::Boolean equiv = primary_obj->_is_equivalent ( - failed_obj.in() ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - if (equiv) - { - object_is_primary = 1; - result = 0; - } - } - else // primary is not set - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ( - "TAO::FT_ReplicationManagerFaultAnalyzer::is_primary_member: " - "Primary is not set on IOGR.\n") - )); - result = -1; - } - } - else // could not get tagged component - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ( - "TAO::FT_ReplicationManagerFaultAnalyzer::is_primary_member: " - "Could not get tagged component from IOGR.\n") - )); - result = -1; - } - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION ( - ACE_ANY_EXCEPTION, - ACE_TEXT ( - "TAO::FT_ReplicationManagerFaultAnalyzer::is_primary_member: ") - ); - result = -1; - } - ACE_ENDTRY; - - return result; -} - -// Handle a single replica failure. -int TAO::FT_ReplicationManagerFaultAnalyzer::single_replica_failure ( - TAO::FT_FaultEventDescriptor & fault_event_desc) -{ - int result = 0; - PortableGroup::ObjectGroup_var the_object_group = PortableGroup::ObjectGroup::_nil(); - PortableGroup::Properties_var properties; - - ACE_TRY_NEW_ENV - { - // Get the object group reference based on the ObjectGroupId. - the_object_group = - this->replication_manager_->get_object_group_ref_from_id ( - fault_event_desc.object_group_id - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // This should not happen, but let us be safe. - if (CORBA::is_nil (the_object_group.in())) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ( - "TAO::FT_ReplicationManagerFaultAnalyzer::single_replica_failure: " - "Could not get ObjectGroup reference from ObjectGroupId: <%Q>.\n"), - fault_event_desc.object_group_id - )); - ACE_TRY_THROW (PortableGroup::ObjectGroupNotFound ()); - } - - // Get the properties associated with this ObjectGroup. - properties = this->replication_manager_->get_properties ( - the_object_group.in() - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION ( - ACE_ANY_EXCEPTION, - ACE_TEXT ( - "TAO::FT_ReplicationManagerFaultAnalyzer::single_replica_failure: ") - ); - result = -1; - } - ACE_ENDTRY; - - if (result == 0) - { - // Get the MembershipStyle property. - PortableGroup::MembershipStyleValue membership_style; - result = this->get_membership_style (properties.in(), membership_style); - if (result != 0) - { - //@@ it seems a shame to fail here. We should at least remove the failed replica from the group. - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ( - "TAO::FT_ReplicationManagerFaultAnalyzer::single_replica_failure: " - "Could not extract MembershipStyle from properties on " - "ObjectGroup with id <%Q>.\n"), - fault_event_desc.object_group_id), - -1); - } - else - { - fault_event_desc.membership_style = membership_style; - if (TAO_debug_level > 6) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ( - "TAO::FT_ReplicationManagerFaultAnalyzer::single_replica_failure: " - "MembershipStyleValue = <%d>"), - fault_event_desc.membership_style - )); - } - } - - // Get the ReplicationStyle property. - FT::ReplicationStyleValue replication_style; - result = this->get_replication_style (properties.in(), replication_style); - if (result != 0) - { - //@@ it seems a shame to fail here. We should at least remove the failed replica from the group. - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ( - "TAO::FT_ReplicationManagerFaultAnalyzer::single_replica_failure: " - "Could not extract ReplicationStyle from properties on " - "ObjectGroup with id <%Q>.\n"), - fault_event_desc.object_group_id), - -1); - } - else - { - fault_event_desc.replication_style = replication_style; - if (TAO_debug_level > 6) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ( - "TAO::FT_ReplicationManagerFaultAnalyzer::single_replica_failure: " - "ReplicationStyleValue = <%d>"), - fault_event_desc.replication_style - )); - } - } - - // Get the MinimumNumberMembers property. - PortableGroup::MinimumNumberMembersValue minimum_number_members; - result = this->get_minimum_number_members ( - properties.in(), minimum_number_members); - if (result != 0) - { - // This is not a fatal error. It may be App Controlled. - result = 0; - if (TAO_debug_level > 3) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ( - "TAO::FT_ReplicationManagerFaultAnalyzer::single_replica_failure: " - "Could not extract MinimumNumberMembers from properties on " - "ObjectGroup with id <%Q>.\n"), - fault_event_desc.object_group_id)); - } - } - else - { - fault_event_desc.minimum_number_members = minimum_number_members; - if (TAO_debug_level > 6) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ( - "TAO::FT_ReplicationManagerFaultAnalyzer::single_replica_failure: " - "MinimumNumberMembers = <%d>"), - fault_event_desc.minimum_number_members - )); - } - } - - // Get the InitialNumberMembers property. - PortableGroup::InitialNumberMembersValue initial_number_members; - result = this->get_initial_number_members ( - properties.in(), initial_number_members); - if (result != 0) - { - // This is not a fatal error. It may be App Controlled. - result = 0; - if (TAO_debug_level > 3) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ( - "TAO::FT_ReplicationManagerFaultAnalyzer::single_replica_failure: " - "Could not extract InitialNumberMembers from properties on " - "ObjectGroup with id <%Q>.\n"), - fault_event_desc.object_group_id)); - } - } - else - { - fault_event_desc.initial_number_members = initial_number_members; - if (TAO_debug_level > 6) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ( - "TAO::FT_ReplicationManagerFaultAnalyzer::single_replica_failure: " - "InitialNumberMembers = <%d>"), - fault_event_desc.initial_number_members - )); - } - } - - // Get the Factories property. - result = this->get_factories ( - properties.in(), - fault_event_desc.factories.out()); - if (result != 0) - { - // This is not a fatal error. It may be App Controlled. - result = 0; - if (TAO_debug_level > 3) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ( - "TAO::FT_ReplicationManagerFaultAnalyzer::single_replica_failure: " - "Could not extract Factories from properties on " - "ObjectGroup with id <%Q>.\n"), - fault_event_desc.object_group_id)); - } - } - else - { - if (TAO_debug_level > 6) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ( - "TAO::FT_ReplicationManagerFaultAnalyzer::single_replica_failure: " - "Got Factories from properties on " - "ObjectGroup with id <%Q>.\n"), - fault_event_desc.object_group_id - )); - } - } - - } - - // If the ReplicationStyle is COLD_PASSIVE, WARM_PASSIVE, or - // SEMI_ACTIVE, we can see if it was the primary replica that - // failed. - if ((result == 0) && - (fault_event_desc.replication_style == FT::COLD_PASSIVE || - fault_event_desc.replication_style == FT::WARM_PASSIVE || - fault_event_desc.replication_style == FT::SEMI_ACTIVE)) - { - if (TAO_debug_level > 6) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ( - "TAO::FT_ReplicationManagerFaultAnalyzer::single_replica_failure: " - "Checking to see if failed replica was the primary for " - "ObjectGroup with id <%Q>.\n"), - fault_event_desc.object_group_id - )); - } - result = this->is_primary_member ( - the_object_group.in(), - fault_event_desc.location.in(), - fault_event_desc.object_is_primary); - } - - // If the MembershipStyle is FT::MEMB_INF_CTRL (infrastructure - // controlled) and the primary has faulted, establish a new primary. - // We get back a new object group. - if ((result == 0) && - (fault_event_desc.membership_style == FT::MEMB_INF_CTRL)) - { - - PortableGroup::ObjectGroup_var new_object_group; - result = this->remove_failed_member ( - the_object_group.in(), - fault_event_desc, - new_object_group.out()); - if (result == 0) - { - the_object_group = new_object_group; - } - - if (fault_event_desc.object_is_primary == 1) - { - if (TAO_debug_level > 6) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ( - "TAO::FT_ReplicationManagerFaultAnalyzer::single_replica_failure: " - "Setting new primary for " - "ObjectGroup with id <%Q>.\n"), - fault_event_desc.object_group_id - )); - } - result = this->set_new_primary ( - the_object_group.in(), - fault_event_desc, - new_object_group.out()); - if (result == 0) - { - the_object_group = new_object_group; - } - } - } - -#if 0 // According to the FT CORBA specification, this will be handled by the ObjectGroupManager::remove_member method - // If the MembershipStyle is FT::MEMB_INF_CTRL (infrastructure - // controlled) and the number of remaining members is less than - // the MinimumNumberMembers property, add new members. - // We get back a new object group. - if ((result == 0) && - (fault_event_desc.membership_style == FT::MEMB_INF_CTRL)) - { - if (TAO_debug_level > 6) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ( - "TAO::FT_ReplicationManagerFaultAnalyzer::single_replica_failure: " - "Potentially adding new members to " - "ObjectGroup with id <%Q>.\n"), - fault_event_desc.object_group_id - )); - } - result = this->add_members ( - the_object_group.in(), - fault_event_desc, - new_object_group.out()); - the_object_group = new_object_group; - } -#endif - return result; -} - -int TAO::FT_ReplicationManagerFaultAnalyzer::remove_failed_member ( - PortableGroup::ObjectGroup_ptr iogr, - TAO::FT_FaultEventDescriptor & fault_event_desc, - PortableGroup::ObjectGroup_out new_iogr) -{ - int result = 0; - new_iogr = PortableGroup::ObjectGroup::_nil (); - - ACE_TRY_NEW_ENV - { - // Remove the old primary member from the object group. - PortableGroup::ObjectGroup_var temp_iogr = - this->replication_manager_->remove_member ( - iogr, - fault_event_desc.location.in() - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - new_iogr = temp_iogr._retn (); - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION ( - ACE_ANY_EXCEPTION, - "TAO::FT_ReplicationManagerFaultAnalyzer::remove_failed_member: "); - result = -1; - } - ACE_ENDTRY; - return result; -} - - -// Choose a new primary member for the ObjectGroup. -// Sets <new_iogr> and returns 0 on success. -// Returns -1 on failure. -int TAO::FT_ReplicationManagerFaultAnalyzer::set_new_primary ( - PortableGroup::ObjectGroup_ptr iogr, - TAO::FT_FaultEventDescriptor & fault_event_desc, - PortableGroup::ObjectGroup_out new_iogr) -{ - int result = 0; - new_iogr = PortableGroup::ObjectGroup::_nil (); - - ACE_TRY_NEW_ENV - { - // Get the locations of the remaining members of the object group. - PortableGroup::Locations_var locations = - this->replication_manager_->locations_of_members ( - iogr - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // Choose the first location as our new primary location. - if (locations->length() >= 1) - { - new_iogr = this->replication_manager_->set_primary_member ( - iogr, - (*locations)[0] - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - else - { - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ( - "TAO::FT_ReplicationManagerFaultAnalyzer::set_new_primary: " - "No locations remaining in ObjectGroup with id <%Q>.\n"), - fault_event_desc.object_group_id), - -1); - } - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION ( - ACE_ANY_EXCEPTION, - "TAO::FT_ReplicationManagerFaultAnalyzer::set_new_primary: "); - result = -1; - } - ACE_ENDTRY; - - return result; -} - -#if 0 // this is handled by the remove_member method -// While the number of members in the object group is less than -// the MinimumNumberMembers property, add new members. -// Sets <new_iogr> and returns 0 on success. -// Returns -1 on failure. -int TAO::FT_ReplicationManagerFaultAnalyzer::add_members ( - PortableGroup::ObjectGroup_ptr iogr, - TAO::FT_FaultEventDescriptor & fault_event_desc, - PortableGroup::ObjectGroup_out new_iogr) -{ - int result = 0; - new_iogr = PortableGroup::ObjectGroup::_nil (); - - ACE_TRY_NEW_ENV - { - // Get current number of members in object group - // (same as number of locations). - PortableGroup::Locations_var locations = - this->replication_manager_->locations_of_members ( - iogr - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - CORBA::ULong num_members = locations->length(); - - // If it is less than the MinimumNumberMembers property, add - // new members. - if (num_members < fault_event_desc.minimum_number_members) - { - //@@ To create a member, we need to know the ObjectGroup, - // Location, TypeId, and Criteria. - - // Get the factory registry from the Replication Manager. - PortableGroup::Criteria fake_criteria; - PortableGroup::FactoryRegistry_var factory_registry = - this->replication_manager_->get_factory_registry ( - fake_criteria ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - - // @@ DLW SAYS: we need to find out the role played by this object - // group so we can use the correct set of factories. - // Get the list of factories for the type of the failed replica. - CORBA::String_var type_id; - PortableGroup::FactoryInfos_var factories_by_type = - factory_registry->list_factories_by_role ( - fault_event_desc.type_id.in(), type_id ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // - // Build a set of locations of factories for this type that we - // can use to create new members (i.e., at locations where - // members do not currently exist). - // - FT_Location_Set valid_locations; - - // For each factory that can be used for this type... - for (CORBA::ULong f=0; f<factories_by_type->length(); ++f) - { - // ...insert its location into valid_locations set. - valid_locations.insert (factories_by_type[f].the_location); - } - - // Now remove any locations where members already exist. - for (CORBA::ULong m=0; m<num_members; ++m) - { - if (valid_locations.find (locations[m])) - valid_locations.remove (locations[m]); - } - - // The valid_locations set now contains all the factory - // locations we can use to add members to this object group. - // So, now we add new members until we reach - // the value of the MinimumNumberMembers property. - PortableGroup::Location_var good_location; - for (FT_Location_Set::iterator iter (valid_locations); - iter.next (good_location.out()) && - fault_event_desc.minimum_number_members > num_members; - iter.advance(), ++num_members) - { - // Create a new member of the object group at this location. - new_iogr = this->replication_manager_->create_member ( - iogr, - good_location.in(), - fault_event_desc.type_id.in(), - fake_criteria - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // Stop adding members when we reach the value of the - // MinimumNumberMembers property. - // if (num_members++ >= fault_event_desc.minimum_number_members) - // break; - } - - } - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION ( - ACE_ANY_EXCEPTION, - "TAO::FT_ReplicationManagerFaultAnalyzer::add_members: "); - result = -1; - } - ACE_ENDTRY; - - return result; -} -#endif // 0 - -// Handle a location failure. -int TAO::FT_ReplicationManagerFaultAnalyzer::location_failure ( - TAO::FT_FaultEventDescriptor & fault_event_desc) -{ - int result = 0; - - // To handle a location failure, we should: - // - Unregister all the factories at that location. - // (We do this first so that we don't try to create a new replica - // at that location for any of the affected object groups.) - // - Determine all the object groups that had members at that - // location. - // - Handle each one of them as a single replica failure. - - ACE_TRY_NEW_ENV - { - // Get the factory registry from the Replication Manager. - PortableGroup::Criteria fake_criteria; - PortableGroup::FactoryRegistry_var factory_registry = - this->replication_manager_->get_factory_registry ( - fake_criteria ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // Unregister all factories at the failed location. - factory_registry->unregister_factory_by_location ( - fault_event_desc.location.in() ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // Determine all the object groups that had members at that - // location. - PortableGroup::ObjectGroups_var object_groups_at_location = - this->replication_manager_->groups_at_location ( - fault_event_desc.location.in() ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // Handle each one of them as a single replica failure. - for (CORBA::ULong i=0; - result==0 && i<object_groups_at_location->length(); - ++i) - { - // Get the object group id. - fault_event_desc.object_group_id = - this->replication_manager_->get_object_group_id ( - object_groups_at_location[i] ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // Get type id of this object group. - fault_event_desc.type_id = - this->replication_manager_->type_id ( - object_groups_at_location[i] ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // Handle it as a single replica failure. - result = this->single_replica_failure (fault_event_desc); - } - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION ( - ACE_ANY_EXCEPTION, - "TAO::FT_ReplicationManagerFaultAnalyzer::location_failure: "); - result = -1; - } - ACE_ENDTRY; - - return result; -} - -// Handle a type failure. -int TAO::FT_ReplicationManagerFaultAnalyzer::type_failure ( - TAO::FT_FaultEventDescriptor & fault_event_desc) -{ - int result = 0; - - // To handle a type failure, we should: - // - Unregister the factory at the location of the failure - // that is associated with the failed type. - // (We do this first so that we don't try to create a new replica - // with that factory for any of the affected object groups.) - // - Determine all the object groups that had members at that - // location of that type. - // - Handle each one of them as a single replica failure. - - ACE_TRY_NEW_ENV - { - // Get the factory registry from the Replication Manager. - PortableGroup::Criteria fake_criteria; - PortableGroup::FactoryRegistry_var factory_registry = - this->replication_manager_->get_factory_registry ( - fake_criteria ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // Unregister the factory at the failed location associated with - // the role. - //@@ Using type_id as the role for now. - factory_registry->unregister_factory ( - fault_event_desc.type_id.in(), - fault_event_desc.location.in() - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // Get all the object groups that had members at that - // location. - PortableGroup::ObjectGroups_var object_groups_at_location = - this->replication_manager_->groups_at_location ( - fault_event_desc.location.in() ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // For each one, if it was of the same type as the failed type, - // handle it as a single replica failure. - for (CORBA::ULong i=0; - result==0 && i<object_groups_at_location->length(); - ++i) - { - // Get the object group id. - fault_event_desc.object_group_id = - this->replication_manager_->get_object_group_id ( - object_groups_at_location[i] ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // Get type id of this object group. - PortableGroup::TypeId_var type_id = - this->replication_manager_->type_id ( - object_groups_at_location[i] ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // If the type id is the same as the failed type id... - if (ACE_OS::strcmp (type_id.in(), fault_event_desc.type_id.in()) == 0) - { - // Handle it as a single replica failure. - result = this->single_replica_failure (fault_event_desc); - } - } - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION ( - ACE_ANY_EXCEPTION, - "TAO::FT_ReplicationManagerFaultAnalyzer::type_failure: "); - result = -1; - } - ACE_ENDTRY; - - return result; -} - -TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManagerFaultAnalyzer.h b/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManagerFaultAnalyzer.h deleted file mode 100755 index 6b2e263ee85..00000000000 --- a/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManagerFaultAnalyzer.h +++ /dev/null @@ -1,200 +0,0 @@ -/* -*- C++ -*- */ -//============================================================================= -/** - * @file FT_ReplicationManagerFaultAnalyzer.h - * - * $Id$ - * - * This file is part of TAO's implementation of Fault Tolerant CORBA. - * This is the Replication Manager's implementation of a fault analyzer. - * - * @author Steve Totten <totten_s@ociweb.com> - */ -//============================================================================= - - -#ifndef FT_REPLICATION_MANAGER_FAULT_ANALYZER_H_ -#define FT_REPLICATION_MANAGER_FAULT_ANALYZER_H_ - -#include /**/ "ace/pre.h" -#include <ace/ACE.h> - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -#pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "orbsvcs/FT_ReplicationManager/FT_DefaultFaultAnalyzer.h" -#include "orbsvcs/FT_CORBAC.h" - -// Forward declarations. -ACE_BEGIN_VERSIONED_NAMESPACE_DECL -template <class T> class ACE_Unbounded_Set; -template <class T> class ACE_Unbounded_Set_Iterator; -ACE_END_VERSIONED_NAMESPACE_DECL - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -namespace TAO -{ - - /////////////////////// - // Forward declarations - class FT_ReplicationManager; - struct FT_FaultEventDescriptor; - - typedef ACE_Unbounded_Set<PortableGroup::Location> FT_Location_Set; - - /** - * Replication Manager's fault analyzer. - * - */ - class FT_ReplicationManagerFaultAnalyzer - : public ::TAO::FT_DefaultFaultAnalyzer - { - - public: - /** - * Constructor. - * @param replication_manager Pointer to TAO::FT_ReplicationManager. - */ - FT_ReplicationManagerFaultAnalyzer ( - const TAO::FT_ReplicationManager * replication_manager); - - /** - * Destructor. - */ - virtual ~FT_ReplicationManagerFaultAnalyzer (); - - public: - - /** - * Validate event type to make sure it is one we can handle. - * @param event The structured fault event, as from the Fault Notifier. - * @return 0 if it is a valid event type, -1 otherwise. - */ - virtual int validate_event_type ( - const CosNotification::StructuredEvent & event); - - /** - * Analyze a fault event. - * @param event The structured fault event, as from the Fault Notifier. - * @return 0 on success, -1 on failure. - */ - virtual int analyze_fault_event ( - const CosNotification::StructuredEvent & event); - - //////////////////// - // Forbidden methods - private: - /// Default constructor. - FT_ReplicationManagerFaultAnalyzer (); - - /// Copy constructor. - FT_ReplicationManagerFaultAnalyzer ( - const FT_ReplicationManagerFaultAnalyzer & rhs); - - /// Assignment operator. - FT_ReplicationManagerFaultAnalyzer & operator = ( - const FT_ReplicationManagerFaultAnalyzer & rhs); - - ///////////////////////// - // Implementation methods - protected: - - /// Helper functions for fault analysis. - - // Extract the type id from a CORBA any. - int get_type_id (const CORBA::Any& val, PortableGroup::TypeId_out type_id); - - // Extract the ObjectGroupId from a CORBA any. - int get_object_group_id (const CORBA::Any& val, PortableGroup::ObjectGroupId& id); - - // Extract the PortableGroup::Location from a CORBA any. - int get_location (const CORBA::Any& val, PortableGroup::Location_out location); - - // Get the MembershipStyle property. - int get_membership_style ( - const PortableGroup::Properties & properties, - PortableGroup::MembershipStyleValue & membership_style); - - // Get the ReplicationStyle property. - int get_replication_style ( - const PortableGroup::Properties & properties, - FT::ReplicationStyleValue & replication_style); - - // Get the MinimumNumberMembers property. - int get_minimum_number_members ( - const PortableGroup::Properties & properties, - PortableGroup::MinimumNumberMembersValue & minimum_number_members); - - // Get the InitialNumberMembers property. - int get_initial_number_members ( - const PortableGroup::Properties & properties, - PortableGroup::InitialNumberMembersValue & initial_number_members); - - // Get the Factories property. - int get_factories ( - const PortableGroup::Properties & properties, - PortableGroup::FactoryInfos_out factories); - - // Handle a single replica failure. - int single_replica_failure ( - TAO::FT_FaultEventDescriptor & fault_event_desc); - - // Handle a location failure. - int location_failure ( - TAO::FT_FaultEventDescriptor & fault_event_desc); - - // Handle a type at location failure. - int type_failure ( - TAO::FT_FaultEventDescriptor & fault_event_desc); - - // Is the replica at location the primary member of its ObjectGroup? - // Sets <object_is_primary> and returns 0 on success. - // Returns -1 on failure. - int is_primary_member ( - const PortableGroup::ObjectGroup_ptr iogr, - const PortableGroup::Location & location, - int & object_is_primary); - - /// remove a failed member from a group - int remove_failed_member ( - PortableGroup::ObjectGroup_ptr iogr, - TAO::FT_FaultEventDescriptor & fault_event_desc, - PortableGroup::ObjectGroup_out new_iogr); - - - // Choose a new primary member for the ObjectGroup. - // Sets <new_iogr> and returns 0 on success. - // Returns -1 on failure. - int set_new_primary ( - PortableGroup::ObjectGroup_ptr iogr, - TAO::FT_FaultEventDescriptor & fault_event_desc, - PortableGroup::ObjectGroup_out new_iogr); - -#if 0 // this is handled by the remove_member method - // While the number of members in the object group is less than - // the MinimumNumberMembers property, add new members. - // Sets <new_iogr> and returns 0 on success. - // Returns -1 on failure. - int add_members ( - PortableGroup::ObjectGroup_ptr iogr, - TAO::FT_FaultEventDescriptor & fault_event_desc, - PortableGroup::ObjectGroup_out new_iogr); -#endif - - /////////////// - // Data Members - private: - FT_ReplicationManager * replication_manager_; - - }; - -} // namespace TAO - -TAO_END_VERSIONED_NAMESPACE_DECL - -#include /**/ "ace/post.h" - -#endif /* FT_REPLICATION_MANAGER_FAULT_ANALYZER_H_ */ - diff --git a/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManagerLib_export.h b/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManagerLib_export.h deleted file mode 100644 index b6a46c4cf8e..00000000000 --- a/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManagerLib_export.h +++ /dev/null @@ -1,60 +0,0 @@ - -// -*- C++ -*- -// $Id$ -// Definition for Win32 Export directives. -// This file is generated automatically by generate_export_file.pl TAO_ReplicationManagerLib -// ------------------------------ -#ifndef TAO_REPLICATIONMANAGERLIB_EXPORT_H -#define TAO_REPLICATIONMANAGERLIB_EXPORT_H - -#include "ace/config-all.h" - -#if defined (TAO_AS_STATIC_LIBS) -# if !defined (TAO_REPLICATIONMANAGERLIB_HAS_DLL) -# define TAO_REPLICATIONMANAGERLIB_HAS_DLL 0 -# endif /* ! TAO_REPLICATIONMANAGERLIB_HAS_DLL */ -#else -# if !defined (TAO_REPLICATIONMANAGERLIB_HAS_DLL) -# define TAO_REPLICATIONMANAGERLIB_HAS_DLL 1 -# endif /* ! TAO_REPLICATIONMANAGERLIB_HAS_DLL */ -#endif - -#if defined (TAO_REPLICATIONMANAGERLIB_HAS_DLL) && (TAO_REPLICATIONMANAGERLIB_HAS_DLL == 1) -# if defined (TAO_REPLICATIONMANAGERLIB_BUILD_DLL) -# define TAO_ReplicationManagerLib_Export ACE_Proper_Export_Flag -# define TAO_REPLICATIONMANAGERLIB_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) -# define TAO_REPLICATIONMANAGERLIB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# else /* TAO_REPLICATIONMANAGERLIB_BUILD_DLL */ -# define TAO_ReplicationManagerLib_Export ACE_Proper_Import_Flag -# define TAO_REPLICATIONMANAGERLIB_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) -# define TAO_REPLICATIONMANAGERLIB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# endif /* TAO_REPLICATIONMANAGERLIB_BUILD_DLL */ -#else /* TAO_REPLICATIONMANAGERLIB_HAS_DLL == 1 */ -# define TAO_ReplicationManagerLib_Export -# define TAO_REPLICATIONMANAGERLIB_SINGLETON_DECLARATION(T) -# define TAO_REPLICATIONMANAGERLIB_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -#endif /* TAO_REPLICATIONMANAGERLIB_HAS_DLL == 1 */ - -// Set TAO_REPLICATIONMANAGERLIB_NTRACE = 0 to turn on library specific tracing even if -// tracing is turned off for ACE. -#if !defined (TAO_REPLICATIONMANAGERLIB_NTRACE) -# if (ACE_NTRACE == 1) -# define TAO_REPLICATIONMANAGERLIB_NTRACE 1 -# else /* (ACE_NTRACE == 1) */ -# define TAO_REPLICATIONMANAGERLIB_NTRACE 0 -# endif /* (ACE_NTRACE == 1) */ -#endif /* !TAO_REPLICATIONMANAGERLIB_NTRACE */ - -#if (TAO_REPLICATIONMANAGERLIB_NTRACE == 1) -# define TAO_REPLICATIONMANAGERLIB_TRACE(X) -#else /* (TAO_REPLICATIONMANAGERLIB_NTRACE == 1) */ -# if !defined (ACE_HAS_TRACE) -# define ACE_HAS_TRACE -# endif /* ACE_HAS_TRACE */ -# define TAO_REPLICATIONMANAGERLIB_TRACE(X) ACE_TRACE_IMPL(X) -# include "ace/Trace.h" -#endif /* (TAO_REPLICATIONMANAGERLIB_NTRACE == 1) */ - -#endif /* TAO_REPLICATIONMANAGERLIB_EXPORT_H */ - -// End of auto generated file. diff --git a/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager_Main.cpp b/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager_Main.cpp deleted file mode 100644 index 4b1e493ba02..00000000000 --- a/TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager_Main.cpp +++ /dev/null @@ -1,24 +0,0 @@ -/* -*- C++ -*- */ -//============================================================================= -/** - * @file FT_ReplicationManager_Main.cpp - * - * $Id$ - * - * This file is part of Fault Tolerant CORBA. - * This file provides the main routine for a process that - * implements the FT_ReplicationManager interface. - * - * @author Curt Hibbs <hibbs_c@ociweb.com> - */ -//============================================================================= - -#include "FT_ReplicationManager.h" -#include "tao/Utils/Server_Main.h" - -int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) -{ - TAO::Utils::Server_Main<TAO::FT_ReplicationManager> - server_main("ReplicationManager"); - return server_main.run(argc, argv); -} diff --git a/TAO/orbsvcs/FT_ReplicationManager/Makefile.am b/TAO/orbsvcs/FT_ReplicationManager/Makefile.am deleted file mode 100644 index 1f7d9f4e065..00000000000 --- a/TAO/orbsvcs/FT_ReplicationManager/Makefile.am +++ /dev/null @@ -1,119 +0,0 @@ -## Process this file with automake to create Makefile.in -## -## $Id$ -## -## This file was generated by MPC. Any changes made directly to -## this file will be lost the next time it is generated. -## -## MPC Command: -## ../bin/mwc.pl -type automake -noreldefs TAO.mwc - -ACE_BUILDDIR = $(top_builddir)/.. -ACE_ROOT = $(top_srcdir)/.. -TAO_BUILDDIR = $(top_builddir) -TAO_ROOT = $(top_srcdir) - - -## Makefile.FT_ReplicationManager_Lib.am - -if BUILD_ACE_UUID -if BUILD_CORBA_MESSAGING -if BUILD_INTERCEPTORS -if !BUILD_ACE_FOR_TAO -if !BUILD_MINIMUM_CORBA - -noinst_LTLIBRARIES = libTAO_ReplicationManagerLib.la - -libTAO_ReplicationManagerLib_la_CPPFLAGS = \ - -I$(ACE_ROOT) \ - -I$(ACE_BUILDDIR) \ - -I$(TAO_ROOT) \ - -I$(TAO_BUILDDIR) \ - -I$(TAO_ROOT)/orbsvcs \ - -I$(TAO_BUILDDIR)/orbsvcs \ - -DTAO_HAS_TYPED_EVENT_CHANNEL \ - -DTAO_REPLICATIONMANAGERLIB_BUILD_DLL - -libTAO_ReplicationManagerLib_la_SOURCES = \ - FT_DefaultFaultAnalyzer.cpp \ - FT_FaultAnalyzer.cpp \ - FT_FaultConsumer.cpp \ - FT_FaultEventDescriptor.cpp - -noinst_HEADERS = \ - FT_DefaultFaultAnalyzer.h \ - FT_FaultAnalyzer.h \ - FT_FaultConsumer.h \ - FT_FaultEventDescriptor.h - -endif !BUILD_MINIMUM_CORBA -endif !BUILD_ACE_FOR_TAO -endif BUILD_INTERCEPTORS -endif BUILD_CORBA_MESSAGING -endif BUILD_ACE_UUID - -## Makefile.FT_ReplicationManager.am - -if BUILD_ACE_UUID -if BUILD_CORBA_MESSAGING -if BUILD_INTERCEPTORS -if !BUILD_ACE_FOR_TAO -if !BUILD_MINIMUM_CORBA - -bin_PROGRAMS = FT_ReplicationManager - -FT_ReplicationManager_CPPFLAGS = \ - -I$(ACE_ROOT) \ - -I$(ACE_BUILDDIR) \ - -I$(TAO_ROOT) \ - -I$(TAO_BUILDDIR) \ - -I$(TAO_ROOT)/orbsvcs \ - -I$(TAO_BUILDDIR)/orbsvcs \ - -DTAO_HAS_TYPED_EVENT_CHANNEL - -FT_ReplicationManager_SOURCES = \ - FT_Property_Validator.cpp \ - FT_ReplicationManager.cpp \ - FT_ReplicationManagerFaultAnalyzer.cpp \ - FT_ReplicationManager_Main.cpp \ - FT_Property_Validator.h \ - FT_ReplicationManager.h \ - FT_ReplicationManagerFaultAnalyzer.h - -FT_ReplicationManager_LDADD = \ - libTAO_ReplicationManagerLib.la \ - $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \ - $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification_Skel.la \ - $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent_Skel.la \ - $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FaultTolerance.la \ - $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FT_ServerORB.la \ - $(TAO_BUILDDIR)/tao/libTAO_PI_Server.la \ - $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FT_ClientORB.la \ - $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_FTORB_Utils.la \ - $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_PortableGroup.la \ - $(TAO_BUILDDIR)/tao/libTAO_IORManip.la \ - $(TAO_BUILDDIR)/tao/libTAO_Messaging.la \ - $(TAO_BUILDDIR)/tao/libTAO_PI.la \ - $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \ - $(TAO_BUILDDIR)/tao/libTAO_Valuetype.la \ - $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNotification.la \ - $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosEvent.la \ - $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \ - $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \ - $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \ - $(TAO_BUILDDIR)/tao/libTAO.la \ - $(ACE_BUILDDIR)/ace/libACE.la - -endif !BUILD_MINIMUM_CORBA -endif !BUILD_ACE_FOR_TAO -endif BUILD_INTERCEPTORS -endif BUILD_CORBA_MESSAGING -endif BUILD_ACE_UUID - -## Clean up template repositories, etc. -clean-local: - -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.* - -rm -f gcctemp.c gcctemp so_locations *.ics - -rm -rf cxx_repository ptrepository ti_files - -rm -rf templateregistry ir.out - -rm -rf ptrepository SunWS_cache Templates.DB diff --git a/TAO/orbsvcs/FT_ReplicationManager/README b/TAO/orbsvcs/FT_ReplicationManager/README deleted file mode 100644 index 6308eaea08d..00000000000 --- a/TAO/orbsvcs/FT_ReplicationManager/README +++ /dev/null @@ -1,12 +0,0 @@ - -Run FT_ReplicationManager as follows: - - FT_ReplicationManager -o <file1.ior> - Starts the replication manager and writes in ior - to the specified file. - - FT_ReplicationManager - Starts the replication manager and registers it - with the naming service. - -s
\ No newline at end of file |