Merge pull request #2303 from jwillemsen/jwi-803
[ACE_TAO.git] / TAO / orbsvcs / tests / FT_App / StubBatchConsumer.h
blob7af8b3bacd921423f566a989b930d0bdc991f1ed
1 // -*- C++ -*-
2 #ifndef STUBBATCHCONSUMER_H
3 #define STUBBATCHCONSUMER_H
4 #include /**/ <ace/pre.h>
5 #include <ace/ACE.h>
7 #if !defined (ACE_LACKS_PRAGMA_ONCE)
8 #pragma once
9 #endif /* ACE_LACKS_PRAGMA_ONCE */
11 #include <orbsvcs/CosNotifyChannelAdminS.h>
12 #include <orbsvcs/FT_NotifierC.h>
14 #include "ace/SString.h"
16 //////////////////////
17 // Forward references
19 /////////////////////
20 // Class declarations
22 /**
23 * A stub fault consumer for use in unit testing Fault Notifier.
25 class StubBatchConsumer
26 : public virtual POA_CosNotifyComm::SequencePushConsumer
28 public:
29 /**
30 * Default constructor.
32 StubBatchConsumer ();
34 /**
35 * virtual destructor.
37 virtual ~StubBatchConsumer ();
39 ::PortableServer::POA_ptr _default_POA ();
40 ::PortableServer::ObjectId objectId()const;
42 /**
43 * Parse command line arguments.
45 int parse_args (int argc, ACE_TCHAR * argv[]);
47 /**
48 * Publish this objects IOR.
50 int init (CORBA::ORB_ptr orbManager, ::FT::FaultNotifier_var & notifier);
52 /**
53 * Return a string to identify this object for logging/console message purposes.
55 const char * identity () const;
57 /**
58 * idle time activity.
59 * @param result [out] status code to return from process
60 * @returns 0 to continue; nonzero to quit
62 int idle(int &result);
64 /**
65 * Clean house for process shut down.
67 void fini ();
70 public:
71 ////////////////
72 // CORBA methods
74 virtual void push_structured_events (
75 const CosNotification::EventBatch & notifications);
77 virtual void disconnect_sequence_push_consumer ();
79 virtual void offer_change (
80 const CosNotification::EventTypeSeq & added,
81 const CosNotification::EventTypeSeq & removed);
83 ////////////////////
84 // Forbidden methods
85 private:
86 StubBatchConsumer (const StubBatchConsumer & rhs);
87 StubBatchConsumer & operator = (const StubBatchConsumer & rhs);
89 /////////////////////////
90 // Implementation methods
91 private:
92 ///////////////
93 // Data Members
94 private:
95 /**
96 * The orb
98 CORBA::ORB_var orb_;
101 * The POA used to activate this object.
103 PortableServer::POA_var poa_;
106 * The CORBA object id assigned to this object.
108 PortableServer::ObjectId_var object_id_;
111 * A human-readable string to distinguish this from other FaultConsumers.
113 ACE_CString identity_;
116 * boolean: request quit
118 int quit_;
121 * the notifier
123 ::FT::FaultNotifier_var notifier_;
126 * consumer id assigned by the notifier
128 ::FT::FaultNotifier::ConsumerId consumer_id_;
131 #include /**/ <ace/post.h>
133 #endif /* STUBBATCHCONSUMER_H */