2 #ifndef STUBFAULTNOTIFIER_H_
3 #define STUBFAULTNOTIFIER_H_
7 #if !defined (ACE_LACKS_PRAGMA_ONCE)
9 #endif /* ACE_LACKS_PRAGMA_ONCE */
10 #include /**/ <ace/pre.h>
12 #include <orbsvcs/FT_NotifierS.h>
13 #include <orbsvcs/FT_FaultDetectorFactoryC.h>
14 #include <ace/Vector_T.h>
15 #include <ace/SString.h>
17 //////////////////////
24 * A stub implementation of the FaultNotifier interface
26 class StubFaultNotifier
: public virtual POA_FT::FaultNotifier
28 //////////////////////
29 // non-CORBA interface
32 * Default constructor.
39 virtual ~StubFaultNotifier ();
42 * Parse command line arguments.
44 int parse_args (int argc
, ACE_TCHAR
* argv
[]);
49 int init (CORBA::ORB_ptr orb
);
57 * Return a string to identify this object for logging/console message purposes.
59 const ACE_TCHAR
* identity () const;
63 * @param result [out] status code to return from process
64 * @returns 0 to continue; nonzero to quit
66 int idle(int &result
);
69 ::PortableServer::POA_ptr
_default_POA (void);
71 PortableServer::ObjectId
objectId()const;
75 * Clean house for process shut down.
77 void shutdown_i (void);
79 ////////////////////////////////
80 // CORBA interface FaultNotifier
83 virtual void push_structured_fault (
84 const CosNotification::StructuredEvent
& event
87 virtual void push_sequence_fault (
88 const CosNotification::EventBatch
& events
91 virtual ::CosNotifyFilter::Filter_ptr
create_subscription_filter (
92 const char * constraint_grammar
95 virtual FT::FaultNotifier::ConsumerId
connect_structured_fault_consumer (
96 CosNotifyComm::StructuredPushConsumer_ptr push_consumer
,
97 CosNotifyFilter::Filter_ptr filter
100 virtual FT::FaultNotifier::ConsumerId
connect_sequence_fault_consumer (
101 CosNotifyComm::SequencePushConsumer_ptr push_consumer
,
102 CosNotifyFilter::Filter_ptr filter
105 virtual void disconnect_consumer (
106 FT::FaultNotifier::ConsumerId connection
109 //////////////////////////////////////////
110 // CORBA interface PullMonitorable methods
111 virtual CORBA::Boolean
is_alive (void);
116 int write_ior_file();
127 * The POA used to activate this object.
129 PortableServer::POA_var poa_
;
132 * The CORBA object id assigned to this object.
134 PortableServer::ObjectId_var object_id_
;
137 * IOR of this object as assigned by poa
139 CORBA::String_var ior_
;
142 * A file to which the factory's IOR should be written.
144 const ACE_TCHAR
* ior_output_file_
;
147 * A file from which the detector's IOR should be read.
149 const ACE_TCHAR
* detector_ior_
;
151 ::FT::FaultDetectorFactory_var factory_
;
154 * A collection of files containing replica IORs
156 ACE_Vector
< const char * > iorReplicaFiles_
;
159 ACE_Vector
< FT::PullMonitorable_var
> replicas_
;
161 * A name to be used to register with the name service.
163 ACE_CString ns_name_
;
166 * A human-readable string to distinguish this from other Notifiers.
168 ACE_TString identity_
;
171 #include /**/ <ace/post.h>
173 #endif /* STUBFAULTNOTIFIER_H_ */