2 #include "FooServantList.h"
4 Foo_i::Foo_i(const char* servant_name
,FooServantList
* mgr
)
11 servant_name_(servant_name
),
27 // Sleep for 10 milliseconds (10,000 microseconds)
28 //ACE_OS::sleep(ACE_Time_Value(0,10000));
33 Foo_i::op2(CORBA::Long value
)
45 if (this->count_op3_
== 30)
47 this->mgr_
->deactivate_servant ();
50 return this->value_
.value ();
55 Foo_i::op4(CORBA::Long value
)
60 if (this->count_op4_
.value () % 1 == 0)
63 "(%P|%t) op4() has been called %d times now. value == %d\n",
64 this->count_op4_
.value (), this->value_
.value ()));
67 // Sleep for 10 milliseconds (10,000 microseconds)
68 //ACE_OS::sleep(ACE_Time_Value(0,10000));
82 const char * user_name
,
86 ACE_CString
str(message
);
88 CORBA::string_free (message
);
89 message
= CORBA::string_dup (str
.c_str ());
95 Foo_i::test_unbounded_string_arg (
99 ACE_DEBUG((LM_DEBUG
, ACE_TEXT("(%P|%t)Foo_i::test_unbounded_string_arg ")
100 ACE_TEXT("got unbounded string %s\n"),
106 Foo_i::test_bounded_string_arg (
110 ACE_DEBUG((LM_DEBUG
, ACE_TEXT("(%P|%t)Foo_i::test_bounded_string_arg ")
111 ACE_TEXT("got bounded string %s\n"),
117 Foo_i::test_fixed_array_arg (
118 const ::Fixed_Array message
121 for (CORBA::ULong i
= 0; i
< 20; i
++)
123 ACE_DEBUG((LM_DEBUG
, ACE_TEXT("(%P|%t)Foo_i::test_fixed_array_arg ")
124 ACE_TEXT("got fixed_array[i] = %d\n"),
131 Foo_i::test_bounded_var_size_arg (
132 const ::Bounded_Var_Size
& message
135 ACE_DEBUG((LM_DEBUG
, ACE_TEXT("(%P|%t)Foo_i::test_bounded_var_size_arg ")
136 ACE_TEXT("got var array chars %s\n"),
137 message
.get_buffer ()));
142 Foo_i::test_unbounded_var_size_arg (
143 const ::Unbounded_Var_Size
& message
146 ACE_DEBUG((LM_DEBUG
, ACE_TEXT("(%P|%t)Foo_i::test_unbounded_var_size_arg ")
147 ACE_TEXT("got var array chars %s\n"),
148 message
.get_buffer ()));
153 Foo_i::test_fixed_size_arg (
154 const ::TimeOfDay
& t
157 ACE_DEBUG((LM_DEBUG
, ACE_TEXT("(%P|%t)Foo_i::test_fixed_size_arg ")
158 ACE_TEXT("got timeofday %d:%d:%d\n"),
159 t
.hour
, t
.minute
, t
.second
));
163 Foo_i::test_fixed_size_arg_two_way (
164 const ::TimeOfDay
& t
167 ACE_DEBUG((LM_DEBUG
, ACE_TEXT("(%P|%t)Foo_i::test_fixed_size_arg_two_way ")
168 ACE_TEXT("got timeofday %d:%d:%d\n"),
169 t
.hour
, t
.minute
, t
.second
));
173 Foo_i::test_var_array_arg (
174 const ::Var_Array messages
177 ACE_DEBUG((LM_DEBUG
, ACE_TEXT("(%P|%t)Foo_i::test_var_array_arg ")
178 ACE_TEXT(" %s\n"), messages
[0].in ()));
179 ACE_DEBUG((LM_DEBUG
, ACE_TEXT("(%P|%t)Foo_i::test_var_array_arg ")
180 ACE_TEXT(" %s\n"), messages
[1].in ()));
181 ACE_DEBUG((LM_DEBUG
, ACE_TEXT("(%P|%t)Foo_i::test_var_array_arg ")
182 ACE_TEXT(" %s\n"), messages
[2].in ()));
187 Foo_i::test_special_basic_arg (
188 ::CORBA::Boolean value
191 ACE_DEBUG((LM_DEBUG
, ACE_TEXT("(%P|%t)Foo_i::test_special_basic_arg ")
192 ACE_TEXT(" got special basic arg: %d\n"), value
));
197 Foo_i::test_objref_arg (
201 this->callback_
= Callback::_duplicate (cb
);
202 ACE_DEBUG((LM_DEBUG
, ACE_TEXT("(%P|%t)Foo_i::test_objref_arg ")
203 ACE_TEXT(" got callback object.\n")));
208 Foo_i::callback_object (
212 this->callback_
= Callback::_duplicate (cb
);
216 Foo_i::test_callback (
219 if (CORBA::is_nil (this->callback_
.in ()))
221 throw FooException ();
225 this->callback_
->test_method ();
233 this->mgr_
->client_done();
238 Foo_i::active (bool flag
)
247 return active_
.value ();