summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/Log/LogActivator.cpp
blob: e55967a9c6f68c822c6fe44b32fe9c087e5549c0 (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
// $Id$

#include "orbsvcs/Log/LogActivator.h"

#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
#include "orbsvcs/Log/LogMgr_i.h"

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

TAO_LogActivator::TAO_LogActivator (TAO_LogMgr_i &logmgr_i)
  : logmgr_i_ (logmgr_i)
{
}

TAO_LogActivator::~TAO_LogActivator ()
{
}

PortableServer::Servant
TAO_LogActivator::incarnate (const PortableServer::ObjectId& oid,
                             PortableServer::POA_ptr)
{
  CORBA::String_var poa_id = PortableServer::ObjectId_to_string (oid);

  DsLogAdmin::LogId id = ACE_OS::strtoul(poa_id.in (), 0, 0);

  if (!logmgr_i_.exists(id))
    throw CORBA::OBJECT_NOT_EXIST ();

  return logmgr_i_.create_log_servant (id);
}


void
TAO_LogActivator::etherealize (const PortableServer::ObjectId&,
                               PortableServer::POA_ptr,
                               PortableServer::Servant servant,
                               CORBA::Boolean,
                               CORBA::Boolean remaining_activations)
{
  if (!remaining_activations)
   {
     delete servant;
   }
}

TAO_END_VERSIONED_NAMESPACE_DECL

#endif