Merge pull request #1551 from DOCGroup/plm_jira_333
[ACE_TAO.git] / TAO / orbsvcs / tests / FT_App / ReplicationManagerFaultConsumerAdapter.h
blob68a21e1c5eff2bfed7d50cc904f04f4e25bd61e8
1 // -*- C++ -*-
2 #ifndef REPLICATION_MANAGER_FAULT_CONSUMER_ADAPTER_H
3 #define REPLICATION_MANAGER_FAULT_CONSUMER_ADAPTER_H
4 #include /**/ <ace/pre.h>
5 #include <ace/ACE.h>
6 #if !defined (ACE_LACKS_PRAGMA_ONCE)
7 #pragma once
8 #endif /* ACE_LACKS_PRAGMA_ONCE */
10 #include <orbsvcs/FT_ReplicationManager/FT_FaultConsumer.h>
11 #include <orbsvcs/FT_NotifierC.h>
12 #include <orbsvcs/FT_FaultDetectorFactoryC.h>
13 #include <ace/Vector_T.h>
14 #include <ace/SString.h>
16 /////////////////////
17 // Class declarations
19 /**
20 * An adapter to the Replication Manager's fault consumer
21 * for use in unit testing Fault Notifier and Fault Consumer.
23 class ReplicationManagerFaultConsumerAdapter
25 public:
26 /**
27 * Default constructor.
29 ReplicationManagerFaultConsumerAdapter ();
31 /**
32 * virtual destructor.
34 virtual ~ReplicationManagerFaultConsumerAdapter ();
36 /**
37 * Parse command line arguments.
39 int parse_args (int argc, ACE_TCHAR * argv[]);
41 /**
42 * Initialize this object
44 int init (CORBA::ORB_ptr orb);
46 /**
47 * Return a string to identify this object for logging/console message purposes.
49 const char * identity () const;
51 /**
52 * idle time activity.
53 * @param result [out] status code to return from process
54 * @returns 0 to continue; nonzero to quit
56 int idle(int &result);
58 /**
59 * Clean house for process shut down.
61 int fini (void);
64 size_t notifications() const;
66 /////////////////
67 // Implementation
68 private:
70 ////////////////////
71 // Forbidden methods
72 private:
73 ReplicationManagerFaultConsumerAdapter (
74 const ReplicationManagerFaultConsumerAdapter & rhs);
75 ReplicationManagerFaultConsumerAdapter & operator =
76 (const ReplicationManagerFaultConsumerAdapter & rhs);
78 /////////////////////////
79 // Implementation methods
80 private:
82 ///////////////
83 // Data Members
84 private:
85 /**
86 * The orb
88 CORBA::ORB_var orb_;
90 /**
91 * A human-readable string to distinguish this from other FaultConsumers.
93 ACE_CString identity_;
95 /**
96 * boolean: request quit
98 int quit_;
101 * a file to write to to signal "ready"
103 const ACE_TCHAR * readyFile_;
106 * Detector's IOR
108 const ACE_TCHAR * detector_ior_;
111 * The FaultDetectorFactory object reference.
113 ::FT::FaultDetectorFactory_var factory_;
116 * A collection of replica IORs
118 ACE_Vector < const char * > replica_iors_;
121 * A collection of replica references.
123 ACE_Vector < FT::PullMonitorable_var > replicas_;
126 * A file from which the notifier's IOR should be read.
128 const ACE_TCHAR * notifier_ior_;
131 * the fault notifier
133 ::FT::FaultNotifier_var notifier_;
136 * consumer id assigned by the notifier
138 ::FT::FaultNotifier::ConsumerId consumerId_;
141 * the real fault consumer
143 TAO::FT_FaultConsumer* p_fault_consumer_;
144 PortableServer::ServantBase_var consumer_servant_;
147 #include /**/ <ace/post.h>
149 #endif /* REPLICATION_MANAGER_FAULT_CONSUMER_ADAPTER_H */