summaryrefslogtreecommitdiff
path: root/TAO/tests/Dynamic_TP/POA_Loader/Dynamic_TP_POA_Test_Dynamic/Hello.cpp
blob: 313393fc02c8d0ad80e2269702e6bba2d79014f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//
// $Id$
//
#include "Hello.h"
#include "ace/OS_NS_unistd.h"

Hello::Hello (CORBA::ORB_ptr orb)
  : orb_ (CORBA::ORB::_duplicate (orb)), sleep_sec_(1)
{
}

CORBA::Short
Hello::sleep_sec()
{
  return this->sleep_sec_;
}

void
  Hello::sleep_sec(CORBA::Short sl_sec)
{
  this->sleep_sec_ = sl_sec;
  ACE_DEBUG ((LM_DEBUG, "(%P|%t) Hello::sleep_sec returning\n"));
}

char *
Hello::get_string (CORBA::Long client_num)
{
  ACE_DEBUG ((LM_INFO,
    ACE_TEXT ("TAO (%P|%t) - Server: Sleeping for client->%d....\n "),
              client_num));

  ACE_OS::sleep(this->sleep_sec_);
  ACE_DEBUG ((LM_INFO,
    ACE_TEXT ("TAO (%P|%t) - Server: Returning for client->%d....\n "),
              client_num));
  return CORBA::string_dup ("Hello there!");
}

void
Hello::shutdown (void)
{
  this->orb_->shutdown (0);
}