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 ();
71 PortableServer::ObjectId
objectId()const;
75 * Clean house for process shut down.
79 ////////////////////////////////
80 // CORBA interface FaultNotifier
83 virtual void push_structured_fault (
84 const CosNotification::StructuredEvent
& event
);
86 virtual void push_sequence_fault (
87 const CosNotification::EventBatch
& events
);
89 virtual ::CosNotifyFilter::Filter_ptr
create_subscription_filter (
90 const char * constraint_grammar
);
92 virtual FT::FaultNotifier::ConsumerId
connect_structured_fault_consumer (
93 CosNotifyComm::StructuredPushConsumer_ptr push_consumer
,
94 CosNotifyFilter::Filter_ptr filter
);
96 virtual FT::FaultNotifier::ConsumerId
connect_sequence_fault_consumer (
97 CosNotifyComm::SequencePushConsumer_ptr push_consumer
,
98 CosNotifyFilter::Filter_ptr filter
);
100 virtual void disconnect_consumer (
101 FT::FaultNotifier::ConsumerId connection
);
103 //////////////////////////////////////////
104 // CORBA interface PullMonitorable methods
105 virtual CORBA::Boolean
is_alive ();
110 int write_ior_file();
121 * The POA used to activate this object.
123 PortableServer::POA_var poa_
;
126 * The CORBA object id assigned to this object.
128 PortableServer::ObjectId_var object_id_
;
131 * IOR of this object as assigned by poa
133 CORBA::String_var ior_
;
136 * A file to which the factory's IOR should be written.
138 const ACE_TCHAR
* ior_output_file_
;
141 * A file from which the detector's IOR should be read.
143 const ACE_TCHAR
* detector_ior_
;
145 ::FT::FaultDetectorFactory_var factory_
;
148 * A collection of files containing replica IORs
150 ACE_Vector
< const char * > iorReplicaFiles_
;
153 ACE_Vector
< FT::PullMonitorable_var
> replicas_
;
155 * A name to be used to register with the name service.
157 ACE_CString ns_name_
;
160 * A human-readable string to distinguish this from other Notifiers.
162 ACE_TString identity_
;
165 #include /**/ <ace/post.h>
167 #endif /* STUBFAULTNOTIFIER_H_ */