Package org.jboss.resteasy.core
Class AsynchronousDispatcher
java.lang.Object
org.jboss.resteasy.core.SynchronousDispatcher
org.jboss.resteasy.core.AsynchronousDispatcher
- All Implemented Interfaces:
Dispatcher
- Version:
- $Revision: 1 $
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
private static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
private AsynchronousDispatcher.Cache
protected ExecutorService
private Map<String,
Future<MockHttpResponse>> private int
private long
private int
Fields inherited from class org.jboss.resteasy.core.SynchronousDispatcher
bufferExceptionEntity, bufferExceptionEntityRead, defaultContextObjects, providerFactory, registry, requestPreprocessors, unwrappedExceptions
-
Constructor Summary
ConstructorsConstructorDescriptionAsynchronousDispatcher
(ResteasyProviderFactory providerFactory) AsynchronousDispatcher
(ResteasyProviderFactory providerFactory, ResourceMethodRegistry registry) -
Method Summary
Modifier and TypeMethodDescriptionjavax.ws.rs.core.Response
void
invoke
(HttpRequest in, HttpResponse response, ResourceInvoker invoker) Invoke and write responsevoid
invokeSuper
(HttpRequest in, HttpResponse response, ResourceInvoker invoker) boolean
void
oneway
(HttpRequest request, HttpResponse response, ResourceInvoker invoker) void
postJob
(HttpRequest request, HttpResponse response, ResourceInvoker invoker) protected javax.ws.rs.core.Response
javax.ws.rs.core.Response
readAndRemove
(long wait, String jobId) void
void
setBasePath
(String basePath) Set the base path to find jobsvoid
setExecutor
(ExecutorService executor) Plug in your own executor to process requestsvoid
setMaxCacheSize
(int maxCacheSize) Max response cache size default is 100void
setMaxWaitMilliSeconds
(long maxWaitMilliSeconds) Maximum wait time.void
setThreadPoolSize
(int threadPoolSize) Fixed thread pool size of asynchronous deliveryvoid
start()
void
stop()
Methods inherited from class org.jboss.resteasy.core.SynchronousDispatcher
addHttpPreprocessor, asynchronousDelivery, asynchronousExceptionDelivery, clearContextData, execute, getDefaultContextObjects, getInvoker, getProviderFactory, getRegistry, getUnwrappedExceptions, internalInvocation, invoke, invokePropagateNotFound, preprocess, preprocess, pushContextObjects, writeException, writeResponse
-
Field Details
-
executor
-
threadPoolSize
private int threadPoolSize -
jobs
-
cache
-
basePath
-
counter
-
maxWaitMilliSeconds
private long maxWaitMilliSeconds -
maxCacheSize
private int maxCacheSize
-
-
Constructor Details
-
AsynchronousDispatcher
-
AsynchronousDispatcher
public AsynchronousDispatcher(ResteasyProviderFactory providerFactory, ResourceMethodRegistry registry)
-
-
Method Details
-
setMaxCacheSize
public void setMaxCacheSize(int maxCacheSize) Max response cache size default is 100- Parameters:
maxCacheSize
-
-
setMaxWaitMilliSeconds
public void setMaxWaitMilliSeconds(long maxWaitMilliSeconds) Maximum wait time. This overrides any wait query parameter- Parameters:
maxWaitMilliSeconds
-
-
setBasePath
Set the base path to find jobs- Parameters:
basePath
-
-
setThreadPoolSize
public void setThreadPoolSize(int threadPoolSize) Fixed thread pool size of asynchronous delivery- Parameters:
threadPoolSize
-
-
setExecutor
Plug in your own executor to process requests- Parameters:
executor
-
-
start
public void start() -
stop
public void stop() -
remove
-
readAndRemove
@Path("{job-id}") @POST public javax.ws.rs.core.Response readAndRemove(@QueryParam("wait") @DefaultValue("-1") long wait, @PathParam("job-id") String jobId) -
get
@Path("{job-id}") @GET public javax.ws.rs.core.Response get(@QueryParam("wait") @DefaultValue("-1") long wait, @PathParam("job-id") String jobId) -
process
-
isAsynchrnousRequest
-
invokeSuper
-
invoke
Description copied from class:SynchronousDispatcher
Invoke and write response- Overrides:
invoke
in classSynchronousDispatcher
-
postJob
-
oneway
-