@Path(value="/") public class AsynchronousDispatcher extends SynchronousDispatcher
Modifier and Type | Field and Description |
---|---|
protected ExecutorService |
executor |
bufferExceptionEntity, bufferExceptionEntityRead, defaultContextObjects, providerFactory, registry, requestPreprocessors, unwrappedExceptions
Constructor and Description |
---|
AsynchronousDispatcher(ResteasyProviderFactory providerFactory) |
AsynchronousDispatcher(ResteasyProviderFactory providerFactory,
ResourceMethodRegistry registry) |
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
get(long wait,
String jobId) |
void |
invoke(HttpRequest in,
HttpResponse response,
ResourceInvoker invoker)
Invoke and write response.
|
void |
invokeSuper(HttpRequest in,
HttpResponse response,
ResourceInvoker invoker) |
boolean |
isAsynchrnousRequest(HttpRequest in) |
void |
oneway(HttpRequest request,
HttpResponse response,
ResourceInvoker invoker) |
void |
postJob(HttpRequest request,
HttpResponse response,
ResourceInvoker invoker) |
protected javax.ws.rs.core.Response |
process(long wait,
String jobId,
boolean eatJob) |
javax.ws.rs.core.Response |
readAndRemove(long wait,
String jobId) |
void |
remove(String jobId) |
void |
setBasePath(String basePath)
Set the base path to find jobs.
|
void |
setExecutor(ExecutorService executor)
Plug in your own executor to process requests.
|
void |
setMaxCacheSize(int maxCacheSize)
Max response cache size default is 100.
|
void |
setMaxWaitMilliSeconds(long maxWaitMilliSeconds)
Maximum wait time.
|
void |
setThreadPoolSize(int threadPoolSize)
Fixed thread pool size of asynchronous delivery.
|
void |
start() |
void |
stop() |
addHttpPreprocessor, asynchronousDelivery, asynchronousDelivery, asynchronousExceptionDelivery, asynchronousExceptionDelivery, clearContextData, execute, getDefaultContextObjects, getInvoker, getProviderFactory, getRegistry, getUnwrappedExceptions, internalInvocation, invoke, invokePropagateNotFound, preprocess, preprocess, pushContextObjects, rethrow, unhandledAsynchronousException, writeException, writeException, writeResponse
protected ExecutorService executor
public AsynchronousDispatcher(ResteasyProviderFactory providerFactory)
public AsynchronousDispatcher(ResteasyProviderFactory providerFactory, ResourceMethodRegistry registry)
public void setMaxCacheSize(int maxCacheSize)
maxCacheSize
- max cache sizepublic void setMaxWaitMilliSeconds(long maxWaitMilliSeconds)
maxWaitMilliSeconds
- max wait time in millispublic void setBasePath(String basePath)
basePath
- base pathpublic void setThreadPoolSize(int threadPoolSize)
threadPoolSize
- thread pool sizepublic void setExecutor(ExecutorService executor)
executor
- executor servicepublic void start()
public void stop()
@Path(value="{job-id}") @DELETE public void remove(@PathParam(value="job-id") String jobId)
@Path(value="{job-id}") @POST public javax.ws.rs.core.Response readAndRemove(@QueryParam(value="wait") @DefaultValue(value="-1") long wait, @PathParam(value="job-id") String jobId)
@Path(value="{job-id}") @GET public javax.ws.rs.core.Response get(@QueryParam(value="wait") @DefaultValue(value="-1") long wait, @PathParam(value="job-id") String jobId)
protected javax.ws.rs.core.Response process(long wait, String jobId, boolean eatJob)
public boolean isAsynchrnousRequest(HttpRequest in)
public void invokeSuper(HttpRequest in, HttpResponse response, ResourceInvoker invoker)
public void invoke(HttpRequest in, HttpResponse response, ResourceInvoker invoker)
SynchronousDispatcher
invoke
in class SynchronousDispatcher
in
- http requestresponse
- http responseinvoker
- resource invokerpublic void postJob(HttpRequest request, HttpResponse response, ResourceInvoker invoker)
public void oneway(HttpRequest request, HttpResponse response, ResourceInvoker invoker)
Copyright © 2020 JBoss by Red Hat. All rights reserved.