2 #ifndef STUBFAULTCONSUMER_H
3 #define STUBFAULTCONSUMER_H
4 #include /**/ <ace/pre.h>
7 #if !defined (ACE_LACKS_PRAGMA_ONCE)
9 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 #include "orbsvcs/CosNotifyChannelAdminS.h"
12 #include <orbsvcs/FT_NotifierC.h>
14 #include "ace/SString.h"
17 //////////////////////
24 * A stub fault consumer for use in unit testing Fault Notifier.
26 class StubFaultConsumer
27 : public virtual POA_CosNotifyComm::StructuredPushConsumer
31 * Default constructor.
38 virtual ~StubFaultConsumer ();
41 ::PortableServer::POA_ptr
_default_POA ();
42 ::PortableServer::ObjectId
objectId()const;
45 * Parse command line arguments.
47 int parse_args (int argc
, ACE_TCHAR
* argv
[]);
50 * Publish this objects IOR.
52 int init (CORBA::ORB_ptr orb
, ::FT::FaultNotifier_var
& notifier
);
55 * Return a string to identify this object for logging/console message purposes.
57 const char * identity () const;
61 * @param result [out] status code to return from process
62 * @returns 0 to continue; nonzero to quit
64 int idle(int &result
);
67 * Clean house for process shut down.
72 size_t notifications() const;
77 virtual void push_structured_event(
78 const CosNotification::StructuredEvent
¬ification
);
80 virtual void offer_change (
81 const CosNotification::EventTypeSeq
& added
,
82 const CosNotification::EventTypeSeq
& removed
);
84 virtual void disconnect_structured_push_consumer();
89 StubFaultConsumer (const StubFaultConsumer
& rhs
);
90 StubFaultConsumer
& operator = (const StubFaultConsumer
& rhs
);
92 /////////////////////////
93 // Implementation methods
104 * The POA used to activate this object.
106 PortableServer::POA_var poa_
;
109 * The CORBA object id assigned to this object.
111 PortableServer::ObjectId_var object_id_
;
115 * A human-readable string to distinguish this from other FaultConsumers.
117 ACE_CString identity_
;
120 * boolean: request quit
127 ::FT::FaultNotifier_var notifier_
;
130 * consumer id assigned by the notifier
132 ::FT::FaultNotifier::ConsumerId consumer_id_
;
134 size_t notifications_
;
137 #include /**/ <ace/post.h>
139 #endif /* STUBFAULTCONSUMER_H */