SMILA 1.0 API documentation

org.eclipse.smila.jobmanager.internal
Class JobRunEngineImpl

java.lang.Object
  extended by org.eclipse.smila.jobmanager.internal.JobRunEngineImpl
All Implemented Interfaces:
JobRunEngine, JobRunListener

public class JobRunEngineImpl
extends java.lang.Object
implements JobRunEngine, JobRunListener

Implements JobRunEngine.


Constructor Summary
JobRunEngineImpl()
           
 
Method Summary
 void addJobListener(JobListener listener)
          Add a RequestHandler..
 void cancelJob(java.lang.String jobName, java.lang.String jobRunId)
          
 void checkAndHandleJobRunCompleted(java.lang.String jobName, java.lang.String jobRunId)
          Checks if a job run is completed or if some completion run must take place.
 void deleteJobRunData(java.lang.String jobName, java.lang.String jobId)
          delete a previously completed job run.
 void deleteTransientBulks(java.lang.String jobName, java.lang.String jobRunId, java.lang.String workflowRunId)
          Deletes transient instances of buckets from the collection of bucket instance ids.
 JobRun ensureJobRun(java.lang.String jobName, java.lang.String jobRunId)
          Check if the job run data are still valid creates a new job run if not.
 void finishJob(java.lang.String jobName, java.lang.String jobRunId)
          
 java.util.Map<java.lang.String,java.lang.String> getJobRunsUsingStore(java.lang.String storeName)
          Creates a map with active job runs using the given store.
 void notifiyAboutJobRunCompletion(java.lang.String jobName)
          callback method to be notified about job run completion events.
 void removeJobListener(JobListener listener)
          Remove the given RequestHandler.
 void setDefinitionPersistence(DefinitionPersistence defPersistence)
          set OSGI service.
 void setJobRunDataProvider(JobRunDataProvider dataProvider)
          set OSGI service.
 void setObjectStoreService(ObjectStoreService objectStore)
          set OSGI service.
 void setPermanentStorage(PermanentStorage permStorage)
          set OSGI service.
 void setRunStorage(RunStorage runStorage)
          set OSGI service.
 void setTaskGeneratorProvider(TaskGeneratorProvider taskGeneratorProvider)
          set OSGI service.
 void setTaskManager(TaskManager taskManager)
          set OSGI service.
 java.lang.String startJob(java.lang.String jobName)
          start job with default job run mode (as defined by workflow or job, or JobRunMode.STANDARD.
 java.lang.String startJob(java.lang.String jobName, JobRunMode requestedJobRunMode)
          
 void unsetDefinitionPersistence(DefinitionPersistence defPersistence)
          unset OSGI service.
 void unsetJobRunDataProvider(JobRunDataProvider dataProvider)
          unset OSGI service.
 void unsetObjectStoreService(ObjectStoreService objectStore)
          unset OSGI service.
 void unsetPermanentStorage(PermanentStorage permStorage)
          unset OSGI service.
 void unsetRunStorage(RunStorage runStorage)
           
 void unsetTaskGeneratorProvider(TaskGeneratorProvider taskGeneratorProvider)
          unset OSGI service.
 void unsetTaskManager(TaskManager taskManager)
          unset OSGI service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JobRunEngineImpl

public JobRunEngineImpl()
Method Detail

startJob

public java.lang.String startJob(java.lang.String jobName)
                          throws JobManagerException
start job with default job run mode (as defined by workflow or job, or JobRunMode.STANDARD.

Specified by:
startJob in interface JobRunEngine
Parameters:
jobName - name of the job to start
Returns:
id of the new job run
Throws:
JobManagerException - error starting job

startJob

public java.lang.String startJob(java.lang.String jobName,
                                 JobRunMode requestedJobRunMode)
                          throws JobManagerException

Specified by:
startJob in interface JobRunEngine
Parameters:
jobName - name of the job to start
requestedJobRunMode - the mode for the job to start. May be null, then method behaves just like JobRunEngine.startJob(String).
Returns:
id of the new job run
Throws:
JobManagerException - error starting job

finishJob

public void finishJob(java.lang.String jobName,
                      java.lang.String jobRunId)
               throws JobManagerException

Specified by:
finishJob in interface JobRunEngine
Parameters:
jobName - name of the job for which to finish the run.
jobRunId - id of the job run to finish
Throws:
JobManagerException - error finishing job

cancelJob

public void cancelJob(java.lang.String jobName,
                      java.lang.String jobRunId)
               throws JobManagerException

Specified by:
cancelJob in interface JobRunEngine
Parameters:
jobName - name of the job for which to cancel the run.
jobRunId - id of the job run to cancel
Throws:
JobManagerException - error canceling job

ensureJobRun

public JobRun ensureJobRun(java.lang.String jobName,
                           java.lang.String jobRunId)
                    throws JobManagerException
Check if the job run data are still valid creates a new job run if not.

Specified by:
ensureJobRun in interface JobRunEngine
Parameters:
jobName - The job name
jobRunId - The job run id
Returns:
The job run
Throws:
JobManagerException - The job manager exception

deleteTransientBulks

public void deleteTransientBulks(java.lang.String jobName,
                                 java.lang.String jobRunId,
                                 java.lang.String workflowRunId)
Deletes transient instances of buckets from the collection of bucket instance ids. If the bucket instance is not found in this instance of jobmanager it is lazily loaded before deleted.

Specified by:
deleteTransientBulks in interface JobRunEngine
Parameters:
jobName - The job name
jobRunId - The job run id
workflowRunId - The workflow run id

checkAndHandleJobRunCompleted

public void checkAndHandleJobRunCompleted(java.lang.String jobName,
                                          java.lang.String jobRunId)
                                   throws JobManagerException
Checks if a job run is completed or if some completion run must take place.

Specified by:
checkAndHandleJobRunCompleted in interface JobRunEngine
Parameters:
jobName - The name of the job.
jobRunId - The id of the job run.
Throws:
JobManagerException - error

deleteJobRunData

public void deleteJobRunData(java.lang.String jobName,
                             java.lang.String jobId)
                      throws JobManagerException
delete a previously completed job run.

Specified by:
deleteJobRunData in interface JobRunEngine
Parameters:
jobName - name of the job for which to monitor the run.
jobId - id of the complete job run to delete the monitoring data.
Throws:
JobManagerException - run id is not a completed run or error deleting it.

getJobRunsUsingStore

public java.util.Map<java.lang.String,java.lang.String> getJobRunsUsingStore(java.lang.String storeName)
Creates a map with active job runs using the given store.

Specified by:
getJobRunsUsingStore in interface JobRunEngine
Parameters:
storeName - the store name
Returns:
a map with all job runs using the store with given name. The job name is used as key, the job run id as value.

notifiyAboutJobRunCompletion

public void notifiyAboutJobRunCompletion(java.lang.String jobName)
callback method to be notified about job run completion events.

Specified by:
notifiyAboutJobRunCompletion in interface JobRunListener

addJobListener

public void addJobListener(JobListener listener)
Add a RequestHandler..

Parameters:
listener - the new RequestHandler

removeJobListener

public void removeJobListener(JobListener listener)
Remove the given RequestHandler.

Parameters:
listener - the RequestHandler

setPermanentStorage

public void setPermanentStorage(PermanentStorage permStorage)
set OSGI service.


unsetPermanentStorage

public void unsetPermanentStorage(PermanentStorage permStorage)
unset OSGI service.


setRunStorage

public void setRunStorage(RunStorage runStorage)
set OSGI service.


unsetRunStorage

public void unsetRunStorage(RunStorage runStorage)
Parameters:
runStorage - RunStorage reference.

setObjectStoreService

public void setObjectStoreService(ObjectStoreService objectStore)
set OSGI service.


unsetObjectStoreService

public void unsetObjectStoreService(ObjectStoreService objectStore)
unset OSGI service.


setTaskGeneratorProvider

public void setTaskGeneratorProvider(TaskGeneratorProvider taskGeneratorProvider)
set OSGI service.


unsetTaskGeneratorProvider

public void unsetTaskGeneratorProvider(TaskGeneratorProvider taskGeneratorProvider)
unset OSGI service.


setTaskManager

public void setTaskManager(TaskManager taskManager)
set OSGI service.


unsetTaskManager

public void unsetTaskManager(TaskManager taskManager)
unset OSGI service.


setDefinitionPersistence

public void setDefinitionPersistence(DefinitionPersistence defPersistence)
set OSGI service.


unsetDefinitionPersistence

public void unsetDefinitionPersistence(DefinitionPersistence defPersistence)
unset OSGI service.


setJobRunDataProvider

public void setJobRunDataProvider(JobRunDataProvider dataProvider)
set OSGI service.


unsetJobRunDataProvider

public void unsetJobRunDataProvider(JobRunDataProvider dataProvider)
unset OSGI service.


SMILA 1.0 API documentation