2 #include "OrbShutdownTask.h"
4 Foo_i::Foo_i(const char* servant_name
)
11 servant_name_(servant_name
)
25 // Sleep for 10 milliseconds (10,000 microseconds)
26 //ACE_OS::sleep(ACE_Time_Value(0,10000));
31 Foo_i::op2(CORBA::Long value
)
47 Foo_i::op4(CORBA::Long value
)
52 if (this->count_op4_
% 1 == 0)
55 "(%P|%t) op4() has been called %d times now. value == %d\n",
56 this->count_op4_
, this->value_
));
59 // Sleep for 10 milliseconds (10,000 microseconds)
60 //ACE_OS::sleep(ACE_Time_Value(0,10000));
67 ACE_DEBUG((LM_DEBUG
, "(%P|%t) Foo_i::op5() - ENTER\n"));
68 ACE_DEBUG((LM_DEBUG
, "(%P|%t) Foo_i::op5() - Increment counter.\n"));
69 unsigned newcount
= ++this->count_op5_
;
70 ACE_DEBUG((LM_DEBUG
, "(%P|%t) Foo_i::op5() - Counter is now %d.\n", newcount
));
71 ACE_DEBUG((LM_DEBUG
, "(%P|%t) Foo_i::op5() - EXIT - Raise a FooException.\n"));
77 const char * user_name
,
81 ACE_CString
str(message
);
83 CORBA::string_free (message
);
84 message
= CORBA::string_dup (str
.c_str ());
90 Foo_i::test_unbounded_string_arg (
94 ACE_DEBUG((LM_DEBUG
, ACE_TEXT("(%P|%t)Foo_i::test_unbounded_string_arg ")
95 ACE_TEXT("got unbounded string %s\n"),
101 Foo_i::test_bounded_string_arg (
105 ACE_DEBUG((LM_DEBUG
, ACE_TEXT("(%P|%t)Foo_i::test_bounded_string_arg ")
106 ACE_TEXT("got bounded string %s\n"),
112 Foo_i::test_fixed_array_arg (
113 const ::Fixed_Array message
116 for (CORBA::ULong i
= 0; i
< 20; i
++)
118 ACE_DEBUG((LM_DEBUG
, ACE_TEXT("(%P|%t)Foo_i::test_fixed_array_arg ")
119 ACE_TEXT("got fixed_array[i] = %d\n"),
126 Foo_i::test_bounded_var_size_arg (
127 const ::Bounded_Var_Size
& message
130 ACE_DEBUG((LM_DEBUG
, ACE_TEXT("(%P|%t)Foo_i::test_bounded_var_size_arg ")
131 ACE_TEXT("got var array chars %s\n"),
132 message
.get_buffer ()));
137 Foo_i::test_unbounded_var_size_arg (
138 const ::Unbounded_Var_Size
& message
141 ACE_DEBUG((LM_DEBUG
, ACE_TEXT("(%P|%t)Foo_i::test_unbounded_var_size_arg ")
142 ACE_TEXT("got var array chars %s\n"),
143 message
.get_buffer ()));
148 Foo_i::test_fixed_size_arg (
149 const ::TimeOfDay
& t
152 ACE_DEBUG((LM_DEBUG
, ACE_TEXT("(%P|%t)Foo_i::test_fixed_size_arg ")
153 ACE_TEXT("got timeofday %d:%d:%d\n"),
154 t
.hour
, t
.minute
, t
.second
));
158 Foo_i::test_fixed_size_arg_two_way (
159 const ::TimeOfDay
& t
162 ACE_DEBUG((LM_DEBUG
, ACE_TEXT("(%P|%t)Foo_i::test_fixed_size_arg_two_way ")
163 ACE_TEXT("got timeofday %d:%d:%d\n"),
164 t
.hour
, t
.minute
, t
.second
));
168 Foo_i::test_var_array_arg (
169 const ::Var_Array messages
172 ACE_DEBUG((LM_DEBUG
, ACE_TEXT("(%P|%t)Foo_i::test_var_array_arg ")
173 ACE_TEXT(" %s\n"), messages
[0].in ()));
174 ACE_DEBUG((LM_DEBUG
, ACE_TEXT("(%P|%t)Foo_i::test_var_array_arg ")
175 ACE_TEXT(" %s\n"), messages
[1].in ()));
176 ACE_DEBUG((LM_DEBUG
, ACE_TEXT("(%P|%t)Foo_i::test_var_array_arg ")
177 ACE_TEXT(" %s\n"), messages
[2].in ()));
182 Foo_i::test_special_basic_arg (
183 ::CORBA::Boolean value
186 ACE_DEBUG((LM_DEBUG
, ACE_TEXT("(%P|%t)Foo_i::test_special_basic_arg ")
187 ACE_TEXT(" got special basic arg: %d\n"), value
));
192 Foo_i::test_objref_arg (
196 this->callback_
= Callback::_duplicate (cb
);
197 ACE_DEBUG((LM_DEBUG
, ACE_TEXT("(%P|%t)Foo_i::test_objref_arg ")
198 ACE_TEXT(" got callback object.\n")));
203 Foo_i::callback_object (
207 this->callback_
= Callback::_duplicate (cb
);
211 Foo_i::test_callback (
214 if (CORBA::is_nil (this->callback_
.in ()))
216 throw FooException ();
220 this->callback_
->test_method ();
228 static ACE_Atomic_Op
<TAO_SYNCH_MUTEX
, unsigned> num_clients
= 2;
232 if (num_clients
== 0)
234 if (TheOrbShutdownTask::instance()->open(0) != 0)
236 ACE_ERROR((LM_ERROR
, "(%P|%t)Foo_i::done: "
237 "failed to create orb shutdown thread.\n"));