1 #include "Session_Control.h"
3 Session_Control::Session_Control (CORBA::ULong session_count
)
4 : session_count_ (session_count
)
10 Session_Control::all_sessions_finished () const
12 return this->session_count_
== 0;
15 Session_Control::~Session_Control ()
17 if (this->session_count_
== 0 && this->success_
)
20 "(%P|%t) Session_Control::~Session_control, "
21 "good, all sessions did finish\n"));
23 else if (session_count_
!= 0)
26 "ERROR: (%P|%t) Session_Control::~Session_control, "
27 "%d sessions did not finish\n",
28 this->session_count_
));
33 "ERROR: (%P|%t) Session_Control::~Session_control, "
34 "some sessions failed\n"));
39 Session_Control::session_finished (CORBA::Boolean success
)
41 ACE_GUARD (TAO_SYNCH_MUTEX
, ace_mon
, this->mutex_
);
42 if (this->session_count_
== 0)
45 "ERROR: (%P|%t) Session_Control::session_finished, "
46 "unexpected callback\n"));
51 this->session_count_
--;
53 "(%P|%t) Session_Control::session_finished, "
54 "%d sessions to go\n",
55 this->session_count_
));
56 if (session_count_
== 0)
58 PortableServer::POA_var poa
=
59 this->_default_POA ();
60 PortableServer::ObjectId_var oid
=
61 poa
->servant_to_id (this);
62 poa
->deactivate_object (oid
.in ());