@Transactional(readOnly=true) public class JobBean extends AbstractStatefulBean implements JobHandle, ProcessCallback
iQuery, iUpdate, modified, sec
Constructor and Description |
---|
JobBean()
default constructor
|
Modifier and Type | Method and Description |
---|---|
void |
activate()
Does almost nothing.
|
JobStatus |
attach(long id) |
void |
cancelJob()
Marks a job for cancellation.
|
protected void |
checkAndRegister() |
void |
close()
signals the end of the service lifecycle.
|
protected void |
errorIfInvalidState() |
Job |
getJob() |
Class<? extends ServiceInterface> |
getServiceInterface() |
boolean |
jobError()
Returns true if the
Job has thrown an error. |
Timestamp |
jobFinished() |
String |
jobMessage() |
boolean |
jobRunning()
|
JobStatus |
jobStatus() |
void |
passivate()
Does nothing.
|
void |
processCancelled(Process proc) |
void |
processFinished(Process proc) |
String |
setMessage(String message)
Sets the job's message string, and returns the previous value.
|
void |
setProcessManager(IProcessManager procMgr)
Process Manager Bean injector.
|
String |
setStatus(String status)
Updates the
JobStatus for the current job. |
String |
setStatusAndMessage(String status,
String message)
Like
JobHandle.setStatus(String) but also sets the message. |
void |
setTypesService(ITypes typesService)
Types service Bean injector.
|
long |
submit(Job newJob)
Submits a
Job and returns its database id. |
getBeanHelper, getCurrentEventContext, isModified, modified, selfConfigure, setQueryService, setSecuritySystem, setUpdateService
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCurrentEventContext
public Class<? extends ServiceInterface> getServiceInterface()
getServiceInterface
in interface SelfConfigurableService
@Transactional public void passivate()
passivate
in interface StatefulServiceInterface
@Transactional public void activate()
jobId
is non-null, then
this instance will need to handle re-loading on first
access. (Previously it could not be done here, because the
security system was not configured for transactions during
JavaEE callbacks. This is no longer true.)activate
in interface StatefulServiceInterface
@Transactional(readOnly=true) public void close()
StatefulServiceInterface
close
in interface StatefulServiceInterface
@Transactional(readOnly=false) public long submit(Job newJob)
JobHandle
Job
and returns its database id. The only fields
directly on status which are editable are message,
scheduledFor and status. The latter two must be
sensible.public JobStatus attach(long id)
public void setTypesService(ITypes typesService)
typesService
- an ITypes
.public void setProcessManager(IProcessManager procMgr)
procMgr
- a ProcessManager
.protected void errorIfInvalidState()
protected void checkAndRegister()
public Timestamp jobFinished()
jobFinished
in interface JobHandle
Job
is not finished, otherwise the
Timestamp
for when it completed.public JobStatus jobStatus()
public String jobMessage()
jobMessage
in interface JobHandle
public boolean jobRunning()
JobHandle
jobRunning
in interface JobHandle
public boolean jobError()
JobHandle
Job
has thrown an error.@Transactional(readOnly=false) public void cancelJob()
JobHandle
@Transactional(readOnly=false) public String setStatus(String status)
JobHandle
JobStatus
for the current job. The previous status
is returned as a string. If the status is JobHandle.CANCELLED
, this
method is equivalent to JobHandle.cancelJob()
.@Transactional(readOnly=false) public String setMessage(String message)
JobHandle
setMessage
in interface JobHandle
@Transactional(readOnly=false) public String setStatusAndMessage(String status, String message)
JobHandle
JobHandle.setStatus(String)
but also sets the message.setStatusAndMessage
in interface JobHandle
public void processCancelled(Process proc)
processCancelled
in interface ProcessCallback
public void processFinished(Process proc)
processFinished
in interface ProcessCallback
Version: 5.2.4-ice35-b23
Copyright © 2016 The University of Dundee & Open Microscopy Environment. All Rights Reserved.