Changes to attempt to silence bcc64x
[ACE_TAO.git] / TAO / orbsvcs / tests / FT_App / StubFaultNotifier.h
blob20ee652624c972c523617f7b6ce7957a990c4ca4
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 ();
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 ();
71 PortableServer::ObjectId objectId()const;
74 /**
75 * Clean house for process shut down.
77 void shutdown_i ();
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 ();
107 /////////////////
108 // Implementation
109 private:
110 int write_ior_file();
112 ///////////////
113 // Data Members
114 private:
116 * The orb
118 CORBA::ORB_var orb_;
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_ */