summaryrefslogtreecommitdiff
path: root/TAO/performance-tests/POA/Implicit_Activation/Factory.cpp
blob: 88490f1c62ed42760926ca5946b28c3af23352cd (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
//
// $Id$
//
#include "Factory.h"
#include "Simple.h"

ACE_RCSID(Activation, Factory, "$Id$")

Factory::Factory (CORBA::ORB_ptr orb)
  : orb_ (CORBA::ORB::_duplicate (orb))
{
}

Test::Simple_ptr
Factory::create_simple_object (TAO_ENV_SINGLE_ARG_DECL)
  ACE_THROW_SPEC ((CORBA::SystemException))
{
  Simple *simple_impl;
  ACE_NEW_THROW_EX (simple_impl,
                    Simple,
                    CORBA::NO_MEMORY ());
  ACE_CHECK_RETURN (Test::Simple::_nil ());

  PortableServer::ServantBase_var owner_transfer(simple_impl);

  return simple_impl->_this (TAO_ENV_SINGLE_ARG_PARAMETER);
}

void
Factory::shutdown (TAO_ENV_SINGLE_ARG_DECL)
  ACE_THROW_SPEC ((CORBA::SystemException))
{
  this->orb_->shutdown (0 TAO_ENV_ARG_PARAMETER);
}