Class AsyncServletWorker

  • All Implemented Interfaces:
    Runnable, EventListener, javax.servlet.AsyncListener

    public class AsyncServletWorker
    extends Object
    implements Runnable, javax.servlet.AsyncListener
    Worker class for the asynchronous Servlet API.
    Author:
    casties
    • Field Detail

      • logger

        protected static final org.slf4j.Logger logger
      • timeout

        protected static long timeout
        AsyncRequest timeout
    • Constructor Detail

      • AsyncServletWorker

        public AsyncServletWorker​(DigilibConfiguration dlConfig,
                                  ImageJobDescription jobinfo,
                                  javax.servlet.AsyncContext asyncContext,
                                  Scaler.ErrMsg errMsgType,
                                  long startTime)
        Parameters:
        dlConfig - the DigilibConfiguration
        jobinfo - the ImageJobDescription
        asyncContext - the AsyncContext
        errMsgType - the Errmsg
        startTime - the start time
    • Method Detail

      • run

        public void run()
        runs the ImageWorker and writes the image to the ServletResponse.
        Specified by:
        run in interface Runnable
      • onStartAsync

        public void onStartAsync​(javax.servlet.AsyncEvent event)
                          throws IOException
        Specified by:
        onStartAsync in interface javax.servlet.AsyncListener
        Throws:
        IOException
      • onComplete

        public void onComplete​(javax.servlet.AsyncEvent event)
                        throws IOException
        Specified by:
        onComplete in interface javax.servlet.AsyncListener
        Throws:
        IOException
      • onError

        public void onError​(javax.servlet.AsyncEvent event)
                     throws IOException
        Specified by:
        onError in interface javax.servlet.AsyncListener
        Throws:
        IOException
      • onTimeout

        public void onTimeout​(javax.servlet.AsyncEvent event)
                       throws IOException
        Specified by:
        onTimeout in interface javax.servlet.AsyncListener
        Throws:
        IOException
      • getTimeout

        public static long getTimeout()
      • setTimeout

        public static void setTimeout​(long timeout)