Public Member Functions | Private Member Functions | Private Attributes | Friends

job_Executor Class Reference
[PM and MIF jobs (infrastructure)]

#include <i_job_impl.h>

Inheritance diagram for job_Executor:
Inheritance graph
[legend]
Collaboration diagram for job_Executor:
Collaboration graph
[legend]

List of all members.

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_im_job
bool m_jobFailed
i_CompletionStatus_e m_failStatus
bool m_execStarted
 log_CLASSID_m

Friends

class i_Job_i

Detailed Description

Definition at line 63 of file i_job_impl.h.


Constructor & Destructor Documentation

job_Executor::job_Executor ( i_Job_i a_job  ) 

Definition at line 48 of file job_executor.cpp.

References cmn_ThreadCounter::Inc(), log_FUNC_m, m_job, and i_Job_i::m_threadCounter.

Here is the call graph for this function:

job_Executor::~job_Executor (  )  [virtual]

Definition at line 59 of file job_executor.cpp.

References i_Job_i::CompleteJob(), dbg_LOW, cmn_ThreadCounter::Dec(), i_ABORTED, 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.

                           {
    log_FUNC_m(~job_Executor);
    
    bool isAborted = m_job.IsAborted();
    bool complete = m_job.m_completeOnExecFinished;
    bool jobFailed = ((m_job.m_status == i_FAILED) || m_jobFailed);
    log_DBG_m(dbg_LOW, "IsAborted(): " << boolalpha << isAborted
        << ", jobFaild: " << boolalpha << jobFailed
        << ", completeOnExecFinished: " << boolalpha << complete);
    m_job.m_threadCounter.Dec();
    try {
        if (m_execStarted){
            if (isAborted)  {
                m_job.CompleteJob(i_ABORTED);
            } 
            else if (jobFailed || complete) {
                m_job.CompleteJob(m_job.m_status);
            }
        };
    } 
    catch (ivd_Exception& e) {
        log_ERR_m("CompleteJob failed. " << e)
        //ignore and continue
    }
    catch (...) {
        log_ERR_m("CompleteJob failed. Unknown error.")
            //ignore and continue
    }
}

Here is the call graph for this function:


Member Function Documentation

void job_Executor::Run ( void *  arg  )  [private, virtual]

Reimplemented from cmn_Thread.

Definition at line 89 of file job_executor.cpp.

References dbg_DETAIL, i_Job_i::Execute(), ivd_BaseException::GetError(), 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().

                                {
    log_FUNC_m(Run);
    m_execStarted = true;
    try {
        if (!m_job.IsAborted()){
            m_job.SetStatus(job_PRE_MED_PROC);
            m_job.Execute();
        }
    } catch (ivd_Exception& e) {
        //bug 4275
        if (e.GetError() == ie_NO_FILES){
            log_DBG_m(dbg_DETAIL, "bug:4275:NO_FILES");
            m_job.m_completeOnExecFinished = true;
        } else {
            log_ERR_m("[" << m_job.m_iJobParams.jobID <<
                "] " << "Execute failed. " << e);
            m_jobFailed = true;
        }
        
    } catch (...) {
        log_ERR_m("[" << m_job.m_iJobParams.jobID <<
                  "] " << "Execute failed. ");
        m_job.m_status = i_UNKNOWN;
        m_jobFailed = true;
        
    }
}

Here is the call graph for this function:


Friends And Related Function Documentation

friend class i_Job_i [friend]

Definition at line 67 of file i_job_impl.h.


Member Data Documentation

Reimplemented from cmn_Thread.

Definition at line 80 of file i_job_impl.h.

Definition at line 78 of file i_job_impl.h.

Referenced by Run(), and ~job_Executor().

Definition at line 77 of file i_job_impl.h.

Definition at line 75 of file i_job_impl.h.

Referenced by job_Executor(), Run(), and ~job_Executor().

bool job_Executor::m_jobFailed [private]

Definition at line 76 of file i_job_impl.h.

Referenced by Run(), and ~job_Executor().


The documentation for this class was generated from the following files: