summaryrefslogtreecommitdiff
path: root/TAO/tao/Utils/Implicit_Deactivator.cpp
blob: 9e0fb6444f92b209e2ac6e92dfbfa725f692756d (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
#include "tao/Utils/Implicit_Deactivator.h"
#include "tao/PortableServer/Servant_Base.h"

ACE_RCSID (Utils,
           Implicit_Deactivator,
           "$Id$")

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

void
TAO::Utils::Implicit_Deactivation_Functor::operator () (
   PortableServer::ServantBase * servant)
  ACE_THROW_SPEC (())
{
  ACE_DECLARE_NEW_CORBA_ENV;

  ACE_TRY
    {
      PortableServer::POA_var poa (servant->_default_POA (
          ACE_ENV_SINGLE_ARG_PARAMETER));
      ACE_TRY_CHECK;

      PortableServer::ObjectId_var id (poa->servant_to_id (servant
                                                           ACE_ENV_ARG_PARAMETER));
      ACE_TRY_CHECK;

      poa->deactivate_object (id.in()
                              ACE_ENV_ARG_PARAMETER);
      ACE_TRY_CHECK;
    }
  ACE_CATCHALL
    {
      // @@ Cannot let exceptions escape, yet we need to log them!
    }
  ACE_ENDTRY;
}

TAO_END_VERSIONED_NAMESPACE_DECL