Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tests / Faults / test_i.cpp
blobaae860a4fb4ddba79236f4877e88c9e80b76a3fc
1 #include "test_i.h"
3 #if !defined(__ACE_INLINE__)
4 #include "test_i.inl"
5 #endif /* __ACE_INLINE__ */
7 #include "ace/OS_NS_unistd.h"
9 void
10 Callback_i::shutdown (CORBA::Boolean is_clean)
12 if (is_clean == 0)
14 ACE_DEBUG ((LM_DEBUG, "Performing catastrophic shutdown\n"));
16 ACE_OS::abort();
17 return;
19 this->orb_->shutdown (false);
21 ACE_DEBUG ((LM_DEBUG, "Shutdown: Performed clean shutdown\n"));
24 // ****************************************************************
26 CORBA::Long
27 Simple_Server_i::test_method (CORBA::Boolean do_callback,
28 CORBA::Boolean is_clean,
29 Callback_ptr callback)
31 if (do_callback)
33 ACE_DEBUG ((LM_DEBUG, "Callback to shutdown client (%d)\n",
34 is_clean));
35 callback->shutdown (is_clean);
37 ACE_Time_Value tv (0, 20000);
38 ACE_OS::sleep (tv);
39 return 0;
42 void
43 Simple_Server_i::shutdown_now (CORBA::Boolean is_clean)
45 if (is_clean == 0)
47 ACE_DEBUG ((LM_DEBUG, "Performing catastrophic shutdown\n"));
48 ACE_OS::abort();
49 return;
52 ACE_DEBUG ((LM_DEBUG, "shutdown_now:Performing clean shutdown\n"));
53 this->orb_->shutdown (false);
56 void
57 Simple_Server_i::shutdown ()
59 this->orb_->shutdown (false);
62 // ****************************************************************
64 CORBA::Long
65 Middle_i::test_method (CORBA::Boolean do_callback,
66 CORBA::Boolean is_clean,
67 Callback_ptr callback)
69 int i = 0;
70 for (; i != 10; ++i)
72 this->server_->test_method (0,
74 callback);
77 this->server_->test_method (do_callback,
78 is_clean,
79 callback);
81 for (; i != 10; ++i)
83 this->server_->test_method (0,
85 callback);
88 return 0;
91 void
92 Middle_i::shutdown_now (CORBA::Boolean is_clean)
94 this->server_->shutdown_now (is_clean);
97 void
98 Middle_i::shutdown ()
102 this->server_->shutdown ();
104 catch (const CORBA::Exception&)
106 // ignore them
109 this->orb_->shutdown (false);