2 //=============================================================================
4 * @file Servant_Activator.cpp
6 * Implementation of ServantActivator, which is used by a POA with
9 * @author Irfan Pyarali
11 //=============================================================================
14 #include "Servant_Activator.h"
16 #include "ace/OS_NS_string.h"
18 ServantActivator::ServantActivator (CORBA::ORB_ptr orb
)
19 : orb_ (CORBA::ORB::_duplicate (orb
))
23 PortableServer::Servant
24 ServantActivator::incarnate (const PortableServer::ObjectId
&oid
,
25 PortableServer::POA_ptr poa
)
27 // Convert ObjectId to String.
29 CORBA::String_var s
= PortableServer::ObjectId_to_string (oid
);
31 // If ObjectId string has a test substring, create and return a
34 if (ACE_OS::strstr (s
.in (), "test") != 0)
35 return new test_i (this->orb_
.in (), poa
);
38 throw CORBA::OBJECT_NOT_EXIST ();
44 ServantActivator::etherealize (const PortableServer::ObjectId
&,
45 PortableServer::POA_ptr
,
46 PortableServer::Servant servant
,
48 CORBA::Boolean remaining_activations
)
50 // If there are no remaining activations i.e ObjectIds associated
51 // with test_i delete it.
52 if (!remaining_activations
)