summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/Naming_Service/Naming_Service.cpp
blob: c5d6a3baf4d0a4314da358b936450720d0cf1e12 (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
// $Id$

// ============================================================================
//
// = LIBRARY
//    orbsvcs/Naming_Service/Naming_Service
//
// = FILENAME
//    Naming_Service.cpp
//
// = DESCRIPTION
//      This class implements a Naming_Service object.
//
// = AUTHORS
//    Nagarajan Surendran (naga@cs.wustl.edu)
//
// ============================================================================

#include "Naming_Service.h"

// Default Constructor.

Naming_Service::Naming_Service (void)
{
}

// Constructor taking command-line arguments

Naming_Service::Naming_Service (int argc,
				char** argv)
{
   this->init (argc,argv);
}

// Initialize the state of the Naming_Service object

int
Naming_Service::init (int argc,
		      char** argv)
{
  TAO_TRY
    {
      this->init_child_poa (argc,
			    argv,
			    "child_poa",
			    TAO_TRY_ENV);
      TAO_CHECK_ENV;
      
      this->my_naming_server_.init (this->orb_,
				    this->child_poa_);
    }
  TAO_CATCHANY
    {
      TAO_TRY_ENV.print_exception ("Naming_Service::init");
      return -1;
    }
  TAO_ENDTRY;
  return 0;
}

// Run the ORB event loop

int
Naming_Service::run (CORBA_Environment& env)
{
  return TAO_ORB_Manager::run (env);
}

// Destructor.

Naming_Service::~Naming_Service (void)
{
}


int
main (int argc, char ** argv)
{
  int init_result;

  Naming_Service naming_service;

  init_result = naming_service.init (argc,argv);
  if (init_result < 0)
    return init_result;

  TAO_TRY
    {
      naming_service.run (TAO_TRY_ENV);
      TAO_CHECK_ENV;
    }
  TAO_CATCHANY
    {
      TAO_TRY_ENV.print_exception ("NamingService");
      return -1;
    }
  TAO_ENDTRY;
  return 0;
}