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
56
57
58
59
60
61
62
63
64
65
66
67
|
// $Id$
#include "Servant_Locator.h"
#include "Servant_Factory.h"
ACE_RCSID(IFR_Service, Servant_Locator, "$Id$")
IFR_ServantLocator::IFR_ServantLocator (TAO_Repository_i *repo)
: repo_ (repo)
{
}
PortableServer::Servant
IFR_ServantLocator::preinvoke (
const PortableServer::ObjectId &oid,
PortableServer::POA_ptr poa,
const char * /* operation */,
PortableServer::ServantLocator::Cookie &cookie
TAO_ENV_ARG_DECL
)
ACE_THROW_SPEC ((CORBA::SystemException,
PortableServer::ForwardRequest))
{
TAO_ENV_ARG_DEFN;
CORBA::String_var s =
PortableServer::ObjectId_to_string (oid);
ACE_Configuration_Section_Key servant_key;
int status =
this->repo_->config ()->expand_path (this->repo_->root_key (),
s.in (),
servant_key,
0);
if (status != 0)
{
// If we're here, destroy() has been called.
ACE_THROW_RETURN (CORBA::OBJECT_NOT_EXIST (), 0);
}
PortableServer::Servant servant =
this->repo_->servant_factory ()->create_tie (servant_key,
poa,
ACE_TRY_ENV);
ACE_CHECK_RETURN (0);
cookie = servant;
return servant;
}
void
IFR_ServantLocator::postinvoke (
const PortableServer::ObjectId & /* oid */,
PortableServer::POA_ptr /* poa */,
const char * /* operation */,
PortableServer::ServantLocator::Cookie /* cookie */,
PortableServer::Servant servant
TAO_ENV_ARG_DECL_NOT_USED
)
ACE_THROW_SPEC ((CORBA::SystemException))
{
delete servant;
}
|