2 #include "StubBatchConsumer.h"
3 #include "ace/Get_Opt.h"
4 #include "orbsvcs/PortableGroup/PG_Properties_Encoder.h"
6 StubBatchConsumer::StubBatchConsumer ()
12 StubBatchConsumer::~StubBatchConsumer ()
17 int StubBatchConsumer::parse_args (int argc
, ACE_TCHAR
* argv
[])
19 ACE_UNUSED_ARG (argc
);
20 ACE_UNUSED_ARG (argv
);
27 ::PortableServer::POA_ptr
StubBatchConsumer::_default_POA ()
29 return ::PortableServer::POA::_duplicate(this->poa_
.in ());
32 PortableServer::ObjectId
StubBatchConsumer::objectId()const
34 return this->object_id_
.in();
39 * register this object
41 int StubBatchConsumer::init (CORBA::ORB_ptr orb
, ::FT::FaultNotifier_var
& notifier
)
44 this->orb_
= CORBA::ORB::_duplicate (orb
);
45 this->notifier_
= notifier
;
46 this->identity_
= "StubBatchConsumer";
49 // Use the ROOT POA for now
50 CORBA::Object_var poa_object
=
51 this->orb_
->resolve_initial_references (TAO_OBJID_ROOTPOA
);
53 if (CORBA::is_nil (poa_object
.in ()))
54 ACE_ERROR_RETURN ((LM_ERROR
,
55 ACE_TEXT (" (%P|%t) Unable to initialize the POA.\n")),
59 this->poa_
= PortableServer::POA::_narrow (poa_object
.in ());
62 if (CORBA::is_nil(this->poa_
.in ()))
64 ACE_ERROR_RETURN ((LM_ERROR
,
65 ACE_TEXT (" (%P|%t) Unable to narrow the POA.\n")),
69 PortableServer::POAManager_var poa_manager
=
70 this->poa_
->the_POAManager ();
72 poa_manager
->activate ();
74 // Register with the POA.
76 this->object_id_
= this->poa_
->activate_object (this);
78 // find my identity as an object
80 CORBA::Object_var this_obj
=
81 this->poa_
->id_to_reference (object_id_
.in ());
83 CosNotifyFilter::Filter_var filter
= CosNotifyFilter::Filter::_nil();
85 this->consumer_id_
= notifier
->connect_sequence_fault_consumer(
86 CosNotifyComm::SequencePushConsumer::_narrow(this_obj
.in ()),
93 * Return a string to identify this object for logging/console message purposes.
95 const char * StubBatchConsumer::identity () const
97 return this->identity_
.c_str();
101 * Clean house for process shut down.
103 void StubBatchConsumer::fini ()
105 this->notifier_
->disconnect_consumer(this->consumer_id_
);
109 int StubBatchConsumer::idle(int & result
)
111 ACE_UNUSED_ARG(result
);
120 void StubBatchConsumer::push_structured_events (
121 const CosNotification::EventBatch
& notifications
124 ACE_UNUSED_ARG (notifications
);
125 //@@ sequence of structured event handling not written yet
128 void StubBatchConsumer::offer_change (
129 const CosNotification::EventTypeSeq
& added
,
130 const CosNotification::EventTypeSeq
& removed
133 ACE_UNUSED_ARG (added
);
134 ACE_UNUSED_ARG (removed
);
135 ACE_ERROR ((LM_ERROR
,
136 "StubBatchConsumer: offer_change call ignored.\n"
138 // @@ not implemented (not likely to be needed)
142 void StubBatchConsumer::disconnect_sequence_push_consumer (
145 ACE_ERROR ((LM_ERROR
,
146 "StubBatchConsumer:disconnect_sequence_push_consumer interpreted as quit request.\n"