#include <i_job_impl.h>


Definition at line 49 of file i_job_impl.h.
Public Member Functions | |
| job_Executor (i_Job_i &a_job) | |
| virtual | ~job_Executor () |
Private Member Functions | |
| virtual void | Run (void *arg) |
Private Attributes | |
| i_Job_i & | m_job |
| bool | m_jobFailed |
| i_CompletionStatus_e | m_failStatus |
| bool | m_execStarted |
| log_CLASSID_m | |
Friends | |
| class | i_Job_i |
| job_Executor::job_Executor | ( | i_Job_i & | a_job | ) |
Definition at line 34 of file job_executor.cpp.
References cmn_ThreadCounter::Inc(), log_FUNC_m, m_job, and i_Job_i::m_threadCounter.
00035 : m_job(a_job), 00036 m_jobFailed(false), 00037 m_failStatus(i_UNKNOWN), 00038 m_execStarted(false){ 00039 00040 log_FUNC_m(job_Executor); 00041 m_job.m_threadCounter.Inc(); 00042 00043 }

| job_Executor::~job_Executor | ( | ) | [virtual] |
Definition at line 45 of file job_executor.cpp.
References i_Job_i::CompleteJob(), dbg_LOW, cmn_ThreadCounter::Dec(), i_ABORTED, i_FAILED, i_Job_i::IsAborted(), log_DBG_m, log_ERR_m, log_FUNC_m, i_Job_i::m_completeOnExecFinished, m_execStarted, m_job, m_jobFailed, i_Job_i::m_status, and i_Job_i::m_threadCounter.
00045 { 00046 log_FUNC_m(~job_Executor); 00047 00048 bool isAborted = m_job.IsAborted(); 00049 bool complete = m_job.m_completeOnExecFinished; 00050 bool jobFailed = ((m_job.m_status == i_FAILED) || m_jobFailed); 00051 log_DBG_m(dbg_LOW, "IsAborted(): " << boolalpha << isAborted 00052 << ", jobFaild: " << boolalpha << jobFailed 00053 << ", completeOnExecFinished: " << boolalpha << complete); 00054 m_job.m_threadCounter.Dec(); 00055 try { 00056 if (m_execStarted){ 00057 if (isAborted) { 00058 m_job.CompleteJob(i_ABORTED); 00059 } 00060 else if (jobFailed || complete) { 00061 m_job.CompleteJob(m_job.m_status); 00062 } 00063 }; 00064 } 00065 catch (ivd_Exception& e) { 00066 log_ERR_m("CompleteJob failed. " << e) 00067 //ignore and continue 00068 } 00069 catch (...) { 00070 log_ERR_m("CompleteJob failed. Unknown error.") 00071 //ignore and continue 00072 } 00073 }

| void job_Executor::Run | ( | void * | arg | ) | [private, virtual] |
Reimplemented from cmn_Thread.
Definition at line 75 of file job_executor.cpp.
References dbg_DETAIL, i_Job_i::Execute(), ivd_BaseException::GetError(), i_UNKNOWN, ie_NO_FILES, i_Job_i::IsAborted(), job_PRE_MED_PROC, i_JobParams::jobID, log_DBG_m, log_ERR_m, log_FUNC_m, i_Job_i::m_completeOnExecFinished, m_execStarted, i_Job_i::m_iJobParams, m_job, m_jobFailed, i_Job_i::m_status, and i_Job_i::SetStatus().
00075 { 00076 log_FUNC_m(Run); 00077 m_execStarted = true; 00078 try { 00079 if (!m_job.IsAborted()){ 00080 m_job.SetStatus(job_PRE_MED_PROC); 00081 m_job.Execute(); 00082 } 00083 } catch (ivd_Exception& e) { 00084 //bug 4275 00085 if (e.GetError() == ie_NO_FILES){ 00086 log_DBG_m(dbg_DETAIL, "bug:4275:NO_FILES"); 00087 m_job.m_completeOnExecFinished = true; 00088 } else { 00089 log_ERR_m("[" << m_job.m_iJobParams.jobID << 00090 "] " << "Execute failed. " << e); 00091 m_jobFailed = true; 00092 } 00093 00094 } catch (...) { 00095 log_ERR_m("[" << m_job.m_iJobParams.jobID << 00096 "] " << "Execute failed. "); 00097 m_job.m_status = i_UNKNOWN; 00098 m_jobFailed = true; 00099 00100 } 00101 }

friend class i_Job_i [friend] |
Definition at line 53 of file i_job_impl.h.
i_Job_i& job_Executor::m_job [private] |
Definition at line 61 of file i_job_impl.h.
Referenced by job_Executor(), Run(), and ~job_Executor().
bool job_Executor::m_jobFailed [private] |
Definition at line 63 of file i_job_impl.h.
bool job_Executor::m_execStarted [private] |
job_Executor::log_CLASSID_m [private] |
1.5.6