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;
72 ReplicationManagerFaultConsumerAdapter (
73 const ReplicationManagerFaultConsumerAdapter
& rhs
);
74 ReplicationManagerFaultConsumerAdapter
& operator =
75 (const ReplicationManagerFaultConsumerAdapter
& rhs
);
77 /////////////////////////
78 // Implementation methods
89 * A human-readable string to distinguish this from other FaultConsumers.
91 ACE_CString identity_
;
94 * boolean: request quit
99 * a file to write to to signal "ready"
101 const ACE_TCHAR
* readyFile_
;
106 const ACE_TCHAR
* detector_ior_
;
109 * The FaultDetectorFactory object reference.
111 ::FT::FaultDetectorFactory_var factory_
;
114 * A collection of replica IORs
116 ACE_Vector
< const char * > replica_iors_
;
119 * A collection of replica references.
121 ACE_Vector
< FT::PullMonitorable_var
> replicas_
;
124 * A file from which the notifier's IOR should be read.
126 const ACE_TCHAR
* notifier_ior_
;
131 ::FT::FaultNotifier_var notifier_
;
134 * consumer id assigned by the notifier
136 ::FT::FaultNotifier::ConsumerId consumerId_
;
139 * the real fault consumer
141 TAO::FT_FaultConsumer
* p_fault_consumer_
;
142 PortableServer::ServantBase_var consumer_servant_
;
144 #include /**/ <ace/post.h>
146 #endif /* REPLICATION_MANAGER_FAULT_CONSUMER_ADAPTER_H */