Class AsynchronousDispatcher

    • Method Detail

      • setMaxCacheSize

        public void setMaxCacheSize​(int maxCacheSize)
        Max response cache size default is 100.
        Parameters:
        maxCacheSize - max cache size
      • setMaxWaitMilliSeconds

        public void setMaxWaitMilliSeconds​(long maxWaitMilliSeconds)
        Maximum wait time. This overrides any wait query parameter.
        Parameters:
        maxWaitMilliSeconds - max wait time in millis
      • setBasePath

        public void setBasePath​(String basePath)
        Set the base path to find jobs.
        Parameters:
        basePath - base path
      • setThreadPoolSize

        public void setThreadPoolSize​(int threadPoolSize)
        Fixed thread pool size of asynchronous delivery.
        Parameters:
        threadPoolSize - thread pool size
      • setExecutor

        public void setExecutor​(ExecutorService executor)
        Plug in your own executor to process requests.
        Parameters:
        executor - executor service
      • start

        public void start()
      • stop

        public void stop()
      • remove

        @Path("{job-id}")
        @DELETE
        public void remove​(@PathParam("job-id")
                           String jobId)
      • readAndRemove

        @Path("{job-id}")
        @POST
        public jakarta.ws.rs.core.Response readAndRemove​(@QueryParam("wait") @DefaultValue("-1")
                                                         long wait,
                                                         @PathParam("job-id")
                                                         String jobId)
      • get

        @Path("{job-id}")
        @GET
        public jakarta.ws.rs.core.Response get​(@QueryParam("wait") @DefaultValue("-1")
                                               long wait,
                                               @PathParam("job-id")
                                               String jobId)
      • process

        protected jakarta.ws.rs.core.Response process​(long wait,
                                                      String jobId,
                                                      boolean eatJob)
      • isAsynchrnousRequest

        public boolean isAsynchrnousRequest​(HttpRequest in)