public class Work extends AbstractWork implements ITimeoutable
Work.Progress, Work.State
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_TIMEOUT |
static String |
PROPERTY_ACL_AUDIT_TIMEOUT |
static int |
UNDEFINED_TIMEOUT |
Constructor and Description |
---|
Work(Runnable runnable,
String name)
Uses timeout defined from properties.
|
Work(Runnable runnable,
String name,
int timeout)
If timeout is
UNDEFINED_TIMEOUT , uses DEFAULT_TIMEOUT . |
Work(String name)
Uses timeout defined from properties.
|
Work(String name,
int timeout) |
Modifier and Type | Method and Description |
---|---|
static int |
getAclAuditTimeoutFromProperties() |
Runnable |
getRunnable() |
int |
getTimeout() |
String |
getTitle()
Gets a human-readable name for this work instance.
|
void |
run()
Override to fix transaction timeout.
|
void |
setRunnable(Runnable runnable) |
void |
work()
This method should implement the actual work done by the
Work
instance. |
afterRun, awaitTermination, beforeRun, cleanUp, getCategory, getCompletionTime, getData, getDocuments, getPrincipal, getProgress, getSchedulingTime, getStartTime, getState, getStatus, initSession, setCanceled, setData, suspend, toString
public static final String PROPERTY_ACL_AUDIT_TIMEOUT
public static final int DEFAULT_TIMEOUT
public static final int UNDEFINED_TIMEOUT
public Work(String name)
DEFAULT_TIMEOUT
will be used.public Work(String name, int timeout)
public Work(Runnable runnable, String name)
DEFAULT_TIMEOUT
will be used.public String getTitle()
Work
public void work() throws Exception
AbstractWork
Work
instance.
It should periodically call #setProgress()
to report its
progress.
To allow for suspension by the WorkManager
, it should
periodically call AbstractWork.isSuspending()
, and if true call
#suspended()
with saved state data and return early.
work
in class AbstractWork
Exception
public void run()
public int getTimeout()
getTimeout
in interface ITimeoutable
public Runnable getRunnable()
public void setRunnable(Runnable runnable)
public static int getAclAuditTimeoutFromProperties()
Copyright © 2013 Nuxeo SA. All Rights Reserved.