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

ACE_RCSID (Utils,
           Implicit_Deactivator,
           "$Id$")
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;
}