@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) |
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, asynchronousExceptionDelivery, clearContextData, execute, getDefaultContextObjects, getInvoker, getProviderFactory, getRegistry, getUnwrappedExceptions, internalInvocation, invoke, invokePropagateNotFound, preprocess, preprocess, pushContextObjects, writeException, writeResponse
protected ExecutorService executor
public AsynchronousDispatcher(ResteasyProviderFactory providerFactory)
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}") @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
public void postJob(HttpRequest request, HttpResponse response, ResourceInvoker invoker)
public void oneway(HttpRequest request, HttpResponse response, ResourceInvoker invoker)
Copyright © 2015 JBoss by Red Hat. All rights reserved.