blob: ee2635f7fce766294a489dd2a413ca0ea8e1287c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
|
// -*- C++ -*-
//
// $Id$
#ifndef STUBFAULTANALYZER_H
#define STUBFAULTANALYZER_H
#if !defined (ACE_LACKS_PRAGMA_ONCE)
#pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
#include "StubFaultConsumer.h"
#include "StubBatchConsumer.h"
#include <orbsvcs/FT_NotifierC.h>
#include <orbsvcs/FT_FaultDetectorFactoryC.h>
#include "ace/Vector_T.h"
//////////////////////
// Forward references
class TAO_ORB_Manager;
/////////////////////
// Class declarations
/**
* A stub fault analyzer for use in unit testing.
*/
class StubFaultAnalyzer
{
public:
/**
* Default constructor.
*/
StubFaultAnalyzer ();
/**
* destructor.
*/
~StubFaultAnalyzer ();
/**
* Parse command line arguments.
*/
int parse_args (int argc, char * argv[]);
/**
* Initialize this object
*/
int init (TAO_ORB_Manager & orbManager);
/**
* Return a string to identify this object for logging/console message purposes.
*/
const char * identity () const;
/**
* idle time activity.
* @param result [out] status code to return from process
* @returns 0 to continue; nonzero to quit
*/
int idle(int &result);
/**
* Prepare to exit.
* @return zero for success; nonzero is process return code for failure.
*/
int fini (ACE_ENV_SINGLE_ARG_DECL);
/////////////////
// Implementation
private:
int readIORFile(const char * fileName, CORBA::String_var & ior);
///////////////
// Data Members
private:
/**
* The orb
*/
CORBA::ORB_var orb_;
/**
* IOR of this object as assigned by orb.
*/
CORBA::String_var ior_;
/**
* A human-readable string to distinguish this from other Notifiers.
*/
ACE_CString identity_;
/**
* a file to write to to signal "ready"
*/
const char * readyFile_;
/**
* A file from which the detecor's IOR should be read.
*/
const char * iorDetectorFile_;
::FT::FaultDetectorFactory_var factory_;
/**
* A file from which the notifier's IOR should be read.
*/
const char * iorNotifierFile_;
::FT::FaultNotifier_var notifier_;
/**
* A collection of files containing replica IORs
*/
ACE_Vector < const char * > iorReplicaFiles_;
char * replicaIorBuffer_;
ACE_Vector < FT::PullMonitorable_var > replicas_;
StubFaultConsumer faultConsumer_;
StubBatchConsumer batchConsumer_;
};
#endif /* STUBFAULTANALYZER_H */
|