2 #ifndef REPLICATION_MANAGER_FAULT_CONSUMER_ADAPTER_H
3 #define REPLICATION_MANAGER_FAULT_CONSUMER_ADAPTER_H
4 #include /**/ <ace/pre.h>
6 #if !defined (ACE_LACKS_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>
20 * An adapter to the Replication Manager's fault consumer
21 * for use in unit testing Fault Notifier and Fault Consumer.
23 class ReplicationManagerFaultConsumerAdapter
27 * Default constructor.
29 ReplicationManagerFaultConsumerAdapter ();
34 virtual ~ReplicationManagerFaultConsumerAdapter ();
37 * Parse command line arguments.
39 int parse_args (int argc
, ACE_TCHAR
* argv
[]);
42 * Initialize this object
44 int init (CORBA::ORB_ptr orb
);
47 * Return a string to identify this object for logging/console message purposes.
49 const char * identity () const;
53 * @param result [out] status code to return from process
54 * @returns 0 to continue; nonzero to quit
56 int idle(int &result
);
59 * Clean house for process shut down.
64 size_t notifications() const;
73 ReplicationManagerFaultConsumerAdapter (
74 const ReplicationManagerFaultConsumerAdapter
& rhs
);
75 ReplicationManagerFaultConsumerAdapter
& operator =
76 (const ReplicationManagerFaultConsumerAdapter
& rhs
);
78 /////////////////////////
79 // Implementation methods
91 * A human-readable string to distinguish this from other FaultConsumers.
93 ACE_CString identity_
;
96 * boolean: request quit
101 * a file to write to to signal "ready"
103 const ACE_TCHAR
* readyFile_
;
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_
;
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 */