Merge pull request #1551 from DOCGroup/plm_jira_333
[ACE_TAO.git] / TAO / examples / RTCORBA / Activity / Job_i.cpp
blob7f0ac5e8ec417e2b1b64e7941ebb2ddb4ef79727
1 #include "Job_i.h"
3 #include "tao/debug.h"
5 #include "Activity.h"
7 Job_i::Job_i ()
11 const ACE_CString&
12 Job_i::name (void)
14 return job_name_;
17 const ACE_CString&
18 Job_i::poa (void)
20 return POA_name_;
23 int
24 Job_i::init (ACE_Arg_Shifter& arg_shifter)
26 // Read the name of the Job
27 job_name_ = ACE_TEXT_ALWAYS_CHAR(arg_shifter.get_current ());
28 arg_shifter.consume_arg ();
30 // Read the name of the POA
31 POA_name_ = ACE_TEXT_ALWAYS_CHAR(arg_shifter.get_current ());
32 arg_shifter.consume_arg ();
34 return 0;
37 void
38 Job_i::work (CORBA::ULong work)
40 static CORBA::ULong prime_number = 9619;
42 if (TAO_debug_level > 0)
43 ACE_DEBUG ((LM_DEBUG,
44 "test_i::method: %hd units of work\n",
45 work));
47 for (; work != 0; work--)
48 ACE::is_prime (prime_number,
50 prime_number / 2);
53 void
54 Job_i::shutdown (void)
56 ACTIVITY::instance()->job_ended (this);