summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/Log/LogActivator.cpp
blob: 970f414c29e1f829b62dde3a3444a3c85a30a173 (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
#include "orbsvcs/Log/LogActivator.h"

ACE_RCSID (Log,
           LogActivator,
           "$Id$")

#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)
  ACE_THROW_SPEC ((CORBA::SystemException,
		   PortableServer::ForwardRequest
		   ))
{
  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)
  ACE_THROW_SPEC ((CORBA::SystemException))
{
  if (!remaining_activations)
   {
     delete servant;
   }
}

TAO_END_VERSIONED_NAMESPACE_DECL

#endif