Merge pull request #1551 from DOCGroup/plm_jira_333
[ACE_TAO.git] / TAO / orbsvcs / tests / FT_App / StubFaultNotifier.h
blobc1ded566c7fac1574cf52add3f5365a4a23f608a
1 // -*- C++ -*-
2 #ifndef STUBFAULTNOTIFIER_H_
3 #define STUBFAULTNOTIFIER_H_
5 #include <ace/ACE.h>
7 #if !defined (ACE_LACKS_PRAGMA_ONCE)
8 #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 //////////////////////
18 // Forward references
20 /////////////////////
21 // Class declarations
23 /**
24 * A stub implementation of the FaultNotifier interface
26 class StubFaultNotifier : public virtual POA_FT::FaultNotifier
28 //////////////////////
29 // non-CORBA interface
30 public:
31 /**
32 * Default constructor.
34 StubFaultNotifier ();
36 /**
37 * Virtual destructor.
39 virtual ~StubFaultNotifier ();
41 /**
42 * Parse command line arguments.
44 int parse_args (int argc, ACE_TCHAR * argv[]);
46 /**
47 * Initialize.
49 int init (CORBA::ORB_ptr orb);
51 /**
52 * Prepare to exit.
54 int fini (void);
56 /**
57 * Return a string to identify this object for logging/console message purposes.
59 const ACE_TCHAR * identity () const;
61 /**
62 * idle time activity.
63 * @param result [out] status code to return from process
64 * @returns 0 to continue; nonzero to quit
66 int idle(int &result);
68 // override virtuals
69 ::PortableServer::POA_ptr _default_POA (void);
71 PortableServer::ObjectId objectId()const;
74 /**
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);
113 /////////////////
114 // Implementation
115 private:
116 int write_ior_file();
118 ///////////////
119 // Data Members
120 private:
122 * The orb
124 CORBA::ORB_var orb_;
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_ */