Package digilib.servlet
Class AsyncServletWorker
java.lang.Object
digilib.servlet.AsyncServletWorker
- All Implemented Interfaces:
Runnable,EventListener,javax.servlet.AsyncListener
Worker class for the asynchronous Servlet API.
- Author:
- casties
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAsyncServletWorker(DigilibConfiguration dlConfig, ImageJobDescription jobinfo, javax.servlet.AsyncContext asyncContext, Scaler.ErrMsg errMsgType, long startTime) -
Method Summary
Modifier and TypeMethodDescriptionstatic longvoidonComplete(javax.servlet.AsyncEvent event) voidonError(javax.servlet.AsyncEvent event) voidonStartAsync(javax.servlet.AsyncEvent event) voidonTimeout(javax.servlet.AsyncEvent event) voidrun()runs the ImageWorker and writes the image to the ServletResponse.static voidsetTimeout(long timeout)
-
Field Details
-
logger
protected static final org.slf4j.Logger logger -
timeout
protected static long timeoutAsyncRequest timeout
-
-
Constructor Details
-
AsyncServletWorker
public AsyncServletWorker(DigilibConfiguration dlConfig, ImageJobDescription jobinfo, javax.servlet.AsyncContext asyncContext, Scaler.ErrMsg errMsgType, long startTime) - Parameters:
dlConfig- the DigilibConfigurationjobinfo- the ImageJobDescriptionasyncContext- the AsyncContexterrMsgType- the ErrmsgstartTime- the start time
-
-
Method Details
-
run
public void run()runs the ImageWorker and writes the image to the ServletResponse. -
onStartAsync
- Specified by:
onStartAsyncin interfacejavax.servlet.AsyncListener- Throws:
IOException
-
onComplete
- Specified by:
onCompletein interfacejavax.servlet.AsyncListener- Throws:
IOException
-
onError
- Specified by:
onErrorin interfacejavax.servlet.AsyncListener- Throws:
IOException
-
onTimeout
- Specified by:
onTimeoutin interfacejavax.servlet.AsyncListener- Throws:
IOException
-
getTimeout
public static long getTimeout() -
setTimeout
public static void setTimeout(long timeout)
-