summaryrefslogtreecommitdiff
path: root/TAO/tao/PortableServer/Adapter_Activator.cpp
blob: 4a8a0386ef1bf79bc18a5047010b024cfbd289bc (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
// $Id$

#include "Adapter_Activator.h"

ACE_RCSID (PortableServer,
           Adapter_Activator,
           "$Id$")

#if (TAO_HAS_MINIMUM_POA == 0)

#include "AdapterActivatorC.h"
#include "POAManagerC.h"
#include "PortableServer.h"

namespace TAO
{
  namespace Portable_Server
  {
    Adapter_Activator::Adapter_Activator (
      PortableServer::POAManager_ptr pm)
      : poa_manager_ (PortableServer::POAManager::_duplicate (pm))
    {
    }

    CORBA::Boolean
    Adapter_Activator::unknown_adapter (PortableServer::POA_ptr parent,
                                        const char *name
                                        ACE_ENV_ARG_DECL)
      ACE_THROW_SPEC ((CORBA::SystemException))
    {
      // Default policies
      CORBA::PolicyList default_policies;

      // This assumes that the lock on the parent is recursive
      PortableServer::POA_var child =
        parent->create_POA (name,
                            this->poa_manager_.in (),
                            default_policies
                            ACE_ENV_ARG_PARAMETER);
      ACE_CHECK_RETURN (0);

      ACE_TRY
        {
          child->the_activator (this ACE_ENV_ARG_PARAMETER);
          ACE_TRY_CHECK;
        }
      ACE_CATCHANY
        {
          (void) child->destroy (1,
                                 1
                                 ACE_ENV_ARG_PARAMETER);

          return false;
        }
      ACE_ENDTRY;
      ACE_CHECK_RETURN (0);

      // Finally everything is fine
      return true;
    }
  }
}

#endif /* TAO_HAS_MINIMUM_POA == 0 */