public abstract class LongRunningProcess extends Thread
LongRunningProcessServlet
.
Because a LongRunningProcess is a thread, classes that extend this
class must override Thread.run()
.Thread.State, Thread.UncaughtExceptionHandler
Modifier and Type | Field and Description |
---|---|
protected LRPControlBean |
bean
Control bean for this process.
|
protected boolean |
canceled
If the process was canceled.
|
protected NewConnectionClassicConnectorProvider |
connectionProvider
Connection provider that provides a new connection for this process.
|
static String |
CONTROL_BEAN_SESSION_ATTR
Name of the session attribute used to store the control bean for
long running processes.
|
protected boolean |
error
If an error occurred.
|
protected int |
progress
Current progress (percent).
|
protected javax.servlet.http.HttpSession |
session
Current session.
|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
LongRunningProcess(LRPControlBean bean,
javax.servlet.http.HttpSession session) |
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancels the process.
|
int |
getProgress() |
boolean |
isError() |
protected void |
updateProgress(int currentElement,
int totalElements)
Updates the progress.
|
abstract void |
writeResult(javax.servlet.http.HttpServletResponse response)
Writes the result of the process to the output-stream.
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public static final String CONTROL_BEAN_SESSION_ATTR
protected final LRPControlBean bean
protected final javax.servlet.http.HttpSession session
protected int progress
protected boolean error
protected boolean canceled
protected NewConnectionClassicConnectorProvider connectionProvider
public LongRunningProcess(LRPControlBean bean, javax.servlet.http.HttpSession session)
bean
- bean containing information for the processsession
- the current sessionpublic abstract void writeResult(javax.servlet.http.HttpServletResponse response) throws IOException, SystemException
response
- servlet response to write toIOException
- IO Exception when writingSystemException
- generic exception when writingprotected void updateProgress(int currentElement, int totalElements)
currentElement
- element currently being processedtotalElements
- total number of elementspublic int getProgress()
public boolean isError()
public void cancel()
Copyright © 2021 Hyland Software Germany GmbH. All rights reserved.