@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 |
---|---|
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 Response |
process(long wait,
String jobId,
boolean eatJob) |
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, asynchronousExceptionDelivery, clearContextData, execute, getDefaultContextObjects, getInvoker, getProviderFactory, getRegistry, getUnwrappedExceptions, internalInvocation, invoke, invokePropagateNotFound, preprocess, preprocess, pushContextObjects, writeException, writeResponse
protected ExecutorService executor
public AsynchronousDispatcher(ResteasyProviderFactory providerFactory)
public AsynchronousDispatcher(ResteasyProviderFactory providerFactory, ResourceMethodRegistry registry)
public void setMaxCacheSize(int maxCacheSize)
maxCacheSize
- public void setMaxWaitMilliSeconds(long maxWaitMilliSeconds)
maxWaitMilliSeconds
- public void setBasePath(String basePath)
basePath
- public void setThreadPoolSize(int threadPoolSize)
threadPoolSize
- public void setExecutor(ExecutorService executor)
executor
- public void start()
public void stop()
@Path(value="{job-id}") @POST public Response readAndRemove(@QueryParam(value="wait") @DefaultValue(value="-1") long wait, @PathParam(value="job-id") String jobId)
@Path(value="{job-id}") @GET public Response get(@QueryParam(value="wait") @DefaultValue(value="-1") long wait, @PathParam(value="job-id") String jobId)
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
public void postJob(HttpRequest request, HttpResponse response, ResourceInvoker invoker)
public void oneway(HttpRequest request, HttpResponse response, ResourceInvoker invoker)
Copyright © 2017 JBoss by Red Hat. All rights reserved.