Merge pull request #1551 from DOCGroup/plm_jira_333
[ACE_TAO.git] / TAO / orbsvcs / tests / FT_App / StubFaultAnalyzer.h
blob424ca9315b1952f2d7b60959fe712cad8defc4a7
1 // -*- C++ -*-
2 #ifndef STUBFAULTANALYZER_H
3 #define STUBFAULTANALYZER_H
4 #include /**/ <ace/pre.h>
5 #include <ace/ACE.h>
7 #if !defined (ACE_LACKS_PRAGMA_ONCE)
8 #pragma once
9 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 #include "StubFaultConsumer.h"
12 #include "StubBatchConsumer.h"
13 #include <orbsvcs/FT_NotifierC.h>
14 #include <orbsvcs/FT_FaultDetectorFactoryC.h>
16 #include "ace/Vector_T.h"
17 #include "ace/SString.h"
19 //////////////////////
20 // Forward references
22 /////////////////////
23 // Class declarations
25 /**
26 * A stub fault analyzer for use in unit testing.
28 class StubFaultAnalyzer
30 public:
31 /**
32 * Default constructor.
34 StubFaultAnalyzer ();
36 /**
37 * destructor.
39 ~StubFaultAnalyzer ();
41 /**
42 * Parse command line arguments.
44 int parse_args (int argc, ACE_TCHAR * argv[]);
46 /**
47 * Initialize this object
49 int init (CORBA::ORB_ptr orb);
51 /**
52 * Return a string to identify this object for logging/console message purposes.
54 const char * identity () const;
56 /**
57 * idle time activity.
58 * @param result [out] status code to return from process
59 * @returns 0 to continue; nonzero to quit
61 int idle(int &result);
63 /**
64 * Prepare to exit.
65 * @return zero for success; nonzero is process return code for failure.
67 int fini (void);
69 /////////////////
70 // Implementation
71 private:
72 int readIORFile(const ACE_TCHAR * fileName, CORBA::String_var & ior);
74 ///////////////
75 // Data Members
76 private:
77 /**
78 * The orb
80 CORBA::ORB_var orb_;
82 /**
83 * The POA used to activate this object.
85 PortableServer::POA_var poa_;
87 /**
88 * The CORBA object id assigned to this object.
90 PortableServer::ObjectId_var objectId_;
92 /**
93 * A human-readable string to distinguish this from other Notifiers.
95 ACE_CString identity_;
97 /**
98 * a file to write to to signal "ready"
100 const ACE_TCHAR * readyFile_;
103 * The detector's IOR (-d option)
105 const ACE_TCHAR * detector_ior_;
107 ::FT::FaultDetectorFactory_var factory_;
110 * The notifier's IOR (-n option)
112 const ACE_TCHAR * notifier_ior_;
114 ::FT::FaultNotifier_var notifier_;
117 * A collection of files containing replica IORs
119 ACE_Vector < const char * > replicaIORs;
121 ACE_Vector < FT::PullMonitorable_var > replicas_;
124 StubFaultConsumer faultConsumer_;
125 StubBatchConsumer batchConsumer_;
129 #include /**/ <ace/post.h>
131 #endif /* STUBFAULTANALYZER_H */