Merge pull request #1551 from DOCGroup/plm_jira_333
[ACE_TAO.git] / TAO / orbsvcs / tests / ImplRepo / RestartServer / Messenger_i.cpp
blob0b930b42c3b2184f6b4f71bd3da1ed97b9d851e2
1 /* -*- C++ -*- */
3 // ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******
4 // TAO and the TAO IDL Compiler have been developed by the Center for
5 // Distributed Object Computing at Washington University, St. Louis.
6 //
7 // Information about TAO is available at:
8 // http://www.dre.vanderbilt.edu/~schmidt/TAO.html
10 #include "Messenger_i.h"
11 #include "Terminator.h"
13 #include <iostream>
15 // Implementation skeleton constructor
16 Messenger_i::Messenger_i (CORBA::ORB_ptr orb, Terminator &terminator)
17 : orb_ (CORBA::ORB::_duplicate (orb))
18 , message_count_ (0)
19 , terminator_ (terminator)
23 // Implementation skeleton destructor
24 Messenger_i::~Messenger_i (void)
28 CORBA::Boolean Messenger_i::send_message (
29 const char * user_name,
30 const char * subject,
31 char *& message)
33 std::cout << "Message count: " << message_count_++ << std::endl;
34 std::cout << "Message from: " << user_name << std::endl
35 << "Subject: " << subject << std::endl
36 << "Message: " << message << std::endl;
37 return 1;
40 void
41 Messenger_i::abort (CORBA::Short delay_secs)
43 ACE_Message_Block *mb = 0;
44 ACE_NEW(mb, ACE_Message_Block(2));
45 ACE_OS::sprintf(mb->wr_ptr (), "%d", delay_secs);
46 terminator_.putq(mb);
49 void
50 Messenger_i::shutdown (void)
52 this->orb_->shutdown (0);