summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/LWFT/LWFT_Server_Init.cpp
blob: 56b15af2563a5a0cb36712b086163119106d67e9 (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
// -*- C++ -*-
// $Id$

#include "tao/ORBInitializer_Registry.h"

#include "tao/PortableServer/PortableServer.h"

#include "tao/PI/PI.h"

#include "LWFT_Server_Init.h"
#include "ServerORBInitializer.h"

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

bool LWFT_Server_Init::initialized_ = false;

LWFT_Server_Init::LWFT_Server_Init (void)
{
}

LWFT_Server_Init::~LWFT_Server_Init (void)
{
}

CORBA::ORB_ptr
LWFT_Server_Init::pre_init (int & /* argc */, char * /* argv */[])
{
  CORBA::ORB_var the_orb;

  return the_orb._retn ();
}

int
LWFT_Server_Init::Initializer (void)
{
  try
    {
      if (! LWFT_Server_Init::initialized_)
        {
          PortableInterceptor::ORBInitializer_ptr oi_ptr;

          ACE_NEW_RETURN (oi_ptr,
                          ServerORBInitializer,
                          -1); // No CORBA exceptions yet!

          PortableInterceptor::ORBInitializer_var orb_initializer =
            oi_ptr;
          PortableInterceptor::register_orb_initializer (
            orb_initializer.in ());
        
          LWFT_Server_Init::initialized_ = true;
        }
    }
  catch (CORBA::Exception& ex)
    {
      ACE_PRINT_EXCEPTION (ex, "LWFT_Server_Init::init: ");
    }
    
  return 0;
}