blob: 79fc22d1eb45672c7c24f3d5d9f3a8e168802c57 (
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
|
//
// $Id$
//
#include "tao/ORB_Core.h"
#include "tao/debug.h"
#include "tao/Transport_Cache_Manager.h"
#include "Object_Factory_i.h"
#include "ace/Synch.h"
ACE_RCSID(Test, Test, "$Id$")
Object_Factory_i::Object_Factory_i (CORBA::ORB_ptr orb, CORBA::ULong len)
: orb_ (CORBA::ORB::_duplicate (orb)),
length_(len)
{
}
//factory method to create first object
Two_Objects_Test::First_ptr
Object_Factory_i::create_first (void)
ACE_THROW_SPEC ((CORBA::SystemException))
{
First_i *first_impl;
// @@ Dont you want to transfer ownership to the POA?
ACE_NEW_THROW_EX (first_impl,
First_i (orb_.in(), two_way_done_ ),
CORBA::NO_MEMORY() );
Two_Objects_Test::First_var first =
first_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER );
return first._retn();
}
//factory method to create second object
Two_Objects_Test::Second_ptr
Object_Factory_i::create_second (void)
ACE_THROW_SPEC ((CORBA::SystemException))
{
Second_i *second_impl;
ACE_NEW_THROW_EX (second_impl,
Second_i (orb_.in(),
length_, two_way_done_),
CORBA::NO_MEMORY ());
Two_Objects_Test::Second_var second =
second_impl->_this ();
return second._retn();
}
|