summaryrefslogtreecommitdiff
path: root/TAO/tests/Object_Loader/Test_i.cpp
blob: 5f4ed5a86e136899b87cf3de741a71c4145b1864 (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
// $Id$

#include "Test_i.h"

#if !defined(__ACE_INLINE__)
#include "Test_i.i"
#endif /* __ACE_INLINE__ */

ACE_RCSID(Object_Loader, Test_i, "$Id$")

CORBA::Long
Test_i::instance_count_ = 0;

Test_i::Test_i (PortableServer::POA_ptr poa)
  :  poa_ (PortableServer::POA::_duplicate (poa))
{
  Test_i::instance_count_++;
}

CORBA::Long
Test_i::instance_count (CORBA::Environment &)
    ACE_THROW_SPEC ((CORBA::SystemException))
{
  return Test_i::instance_count_;
}

void
Test_i::destroy (CORBA::Environment &ACE_TRY_ENV)
    ACE_THROW_SPEC ((CORBA::SystemException))
{
  PortableServer::POA_var poa =
    this->_default_POA (ACE_TRY_ENV);
  ACE_CHECK;
  PortableServer::ObjectId_var oid =
    poa->servant_to_id (this, ACE_TRY_ENV);
  ACE_CHECK;
  poa->deactivate_object (oid.in (), ACE_TRY_ENV);
  ACE_CHECK;
}

PortableServer::POA_ptr
Test_i::_default_POA (CORBA::Environment &)
    ACE_THROW_SPEC ((CORBA::SystemException))
{
  return PortableServer::POA::_duplicate (this->poa_.in ());
}