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 long
void
onComplete
(javax.servlet.AsyncEvent event) void
onError
(javax.servlet.AsyncEvent event) void
onStartAsync
(javax.servlet.AsyncEvent event) void
onTimeout
(javax.servlet.AsyncEvent event) void
run()
runs the ImageWorker and writes the image to the ServletResponse.static void
setTimeout
(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:
onStartAsync
in interfacejavax.servlet.AsyncListener
- Throws:
IOException
-
onComplete
- Specified by:
onComplete
in interfacejavax.servlet.AsyncListener
- Throws:
IOException
-
onError
- Specified by:
onError
in interfacejavax.servlet.AsyncListener
- Throws:
IOException
-
onTimeout
- Specified by:
onTimeout
in interfacejavax.servlet.AsyncListener
- Throws:
IOException
-
getTimeout
public static long getTimeout() -
setTimeout
public static void setTimeout(long timeout)
-