|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectome.services.AbstractStatefulBean
ome.services.JobBean
@Transactional(readOnly=true) public class JobBean
Provides methods for submitting asynchronous tasks.
Field Summary |
---|
Fields inherited from class ome.services.AbstractStatefulBean |
---|
iQuery, sec |
Fields inherited from interface ome.api.JobHandle |
---|
CANCELLED, ERROR, FINISHED, QUEUED, REQUEUED, RESUBMITTED, RUNNING, SUBMITTED, WAITING |
Constructor Summary | |
---|---|
JobBean()
default constructor |
Method Summary | |
---|---|
void |
activate()
Does almost nothing. |
ome.model.jobs.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()
|
ome.model.jobs.Job |
getJob()
|
Class<? extends ServiceInterface> |
getServiceInterface()
|
boolean |
jobError()
Returns true if the Job has thrown an error. |
Timestamp |
jobFinished()
|
String |
jobMessage()
|
boolean |
jobRunning()
Returns true if the Job is running, i.e. has an attached
Process . |
ome.model.jobs.JobStatus |
jobStatus()
|
void |
passivate()
Does nothing. |
void |
processCancelled(Process proc)
|
void |
processFinished(Process proc)
|
void |
setJobNotification(JobNotification notify)
job notification injector. |
void |
setProcessManager(IProcessManager procMgr)
Process Manager Bean injector. |
void |
setTypesService(ITypes typesService)
Types service Bean injector. |
void |
setUpdateService(LocalUpdate updateService)
Update service Bean injector. |
long |
submit(ome.model.jobs.Job newJob)
Submits a Job and returns its database id. |
Methods inherited from class ome.services.AbstractStatefulBean |
---|
getBeanHelper, getCurrentEventContext, selfConfigure, setQueryService, setSecuritySystem |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface ome.api.StatefulServiceInterface |
---|
getCurrentEventContext |
Constructor Detail |
---|
public JobBean()
Method Detail |
---|
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(ome.model.jobs.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.
submit
in interface JobHandle
newJob
- Not null
public ome.model.jobs.JobStatus attach(long id)
attach
in interface JobHandle
JobStatus
for the id
public void setTypesService(ITypes typesService)
typesService
- an ITypes
.public void setUpdateService(LocalUpdate updateService)
updateService
- a IUpdate
.public void setProcessManager(IProcessManager procMgr)
processManager
- a ProcessManager
.public void setJobNotification(JobNotification notify)
protected void errorIfInvalidState()
protected void checkAndRegister()
public ome.model.jobs.Job getJob()
getJob
in interface JobHandle
Job
public Timestamp jobFinished()
jobFinished
in interface JobHandle
Job
is not finished, otherwise the
Timestamp
for when it completed.public ome.model.jobs.JobStatus jobStatus()
jobStatus
in interface JobHandle
JobStatus
. Will never return null.public String jobMessage()
jobMessage
in interface JobHandle
public boolean jobRunning()
JobHandle
Job
is running, i.e. has an attached
Process
.
jobRunning
in interface JobHandle
public boolean jobError()
JobHandle
Job
has thrown an error.
jobError
in interface JobHandle
@Transactional(readOnly=false) public void cancelJob()
JobHandle
cancelJob
in interface JobHandle
public void processCancelled(Process proc)
processCancelled
in interface ProcessCallback
public void processFinished(Process proc)
processFinished
in interface ProcessCallback
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Version: Beta-4.1.1-r5927-b91
Copyright © 2009 The University of Dundee. All Rights Reserved.