1 //=============================================================================
5 * @author Tim Bradley <bradley_t@ociweb.com>
7 //=============================================================================
10 #include "ace/CORBA_macros.h"
12 namespace { enum { MAX_ORB_TASK_WORKER_THREADS
= 20 }; }
14 OrbTask::OrbTask(CORBA::ORB_ptr orb
, unsigned num_threads
)
15 : orb_(CORBA::ORB::_duplicate(orb
)),
16 num_threads_(num_threads
)
23 if (this->num_threads_
< 1)
25 ACE_ERROR_RETURN((LM_ERROR
,
26 "(%P|%t) OrbTask failed to open. "
27 "num_threads_ (%d) is less-than 1.\n",
32 if (this->num_threads_
> MAX_ORB_TASK_WORKER_THREADS
)
34 ACE_ERROR_RETURN((LM_ERROR
,
35 "(%P|%t) OrbTask failed to open. "
36 "num_threads_ (%d) is too large. Max is %d.\n",
37 this->num_threads_
, MAX_ORB_TASK_WORKER_THREADS
),
41 if (CORBA::is_nil(this->orb_
.in()))
43 ACE_ERROR_RETURN((LM_ERROR
,
44 "(%P|%t) OrbTask failed to open. "
45 "ORB object reference is nil.\n"),
49 if (this->activate(THR_NEW_LWP
| THR_JOINABLE
, this->num_threads_
) != 0)
51 // Assumes that when activate returns non-zero return code that
52 // no threads were activated.
53 ACE_ERROR_RETURN((LM_ERROR
,
54 "(%P|%t) OrbTask failed to activate "
55 "(%d) worker threads.\n",
74 "(%P|%t) Exception raised by ORB::run() method. "
75 "OrbTask is stopping.\n"));
82 OrbTask::close(u_long
)