1 //=============================================================================
5 * @author Tim Bradley <bradley_t@ociweb.com>
7 //=============================================================================
11 namespace { enum { MAX_ORB_TASK_WORKER_THREADS
= 20 }; }
13 OrbTask::OrbTask(CORBA::ORB_ptr orb
, unsigned num_threads
)
14 : orb_ (CORBA::ORB::_duplicate(orb
)),
15 num_threads_(num_threads
)
22 if (this->num_threads_
< 1)
24 ACE_ERROR_RETURN((LM_ERROR
,
25 "(%P|%t) OrbTask failed to open. "
26 "num_threads_ (%d) is less-than 1.\n",
31 if (this->num_threads_
> MAX_ORB_TASK_WORKER_THREADS
)
33 ACE_ERROR_RETURN((LM_ERROR
,
34 "(%P|%t) OrbTask failed to open. "
35 "num_threads_ (%d) is too large. Max is %d.\n",
36 this->num_threads_
, MAX_ORB_TASK_WORKER_THREADS
),
40 if (CORBA::is_nil(this->orb_
.in()))
42 ACE_ERROR_RETURN((LM_ERROR
,
43 "(%P|%t) OrbTask failed to open. "
44 "ORB object reference is nil.\n"),
48 if (this->activate(THR_NEW_LWP
| THR_JOINABLE
, this->num_threads_
) != 0)
50 // Assumes that when activate returns non-zero return code that
51 // no threads were activated.
52 ACE_ERROR_RETURN((LM_ERROR
,
53 "(%P|%t) OrbTask failed to activate "
54 "(%d) worker threads.\n",
73 "(%P|%t) Exception raised by ORB::run() method. "
74 "OrbTask is stopping.\n"));
82 OrbTask::close(u_long
)