org.jboss.resteasy.core
Class AsynchronousDispatcher

java.lang.Object
  extended by org.jboss.resteasy.core.SynchronousDispatcher
      extended by org.jboss.resteasy.core.AsynchronousDispatcher
All Implemented Interfaces:
Dispatcher

public class AsynchronousDispatcher
extends SynchronousDispatcher

Version:
$Revision: 1 $
Author:
Bill Burke

Field Summary
protected  java.util.concurrent.ExecutorService executor
           
 
Fields inherited from class org.jboss.resteasy.core.SynchronousDispatcher
extentionHttpPreprocessor, providerFactory, registry, requestPreprocessors
 
Constructor Summary
AsynchronousDispatcher(ResteasyProviderFactory providerFactory)
           
 
Method Summary
 Response get(long wait, java.lang.String jobId)
           
 void invoke(HttpRequest in, HttpResponse response)
           
 void invokeSuper(HttpRequest request, HttpResponse response)
           
 boolean isAsynchrnousRequest(HttpRequest in)
           
 void oneway(HttpRequest request, HttpResponse response)
           
 void postJob(HttpRequest request, HttpResponse response)
           
protected  Response process(long wait, java.lang.String jobId, boolean eatJob)
           
 Response readAndRemove(long wait, java.lang.String jobId)
           
 void remove(java.lang.String jobId)
           
 void setBasePath(java.lang.String basePath)
          Set the base path to find jobs
 void setExecutor(java.util.concurrent.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()
           
 
Methods inherited from class org.jboss.resteasy.core.SynchronousDispatcher
asynchronousDelivery, clearContextData, executeExceptionMapper, getInvoker, getLanguageMappings, getMediaTypeMappings, getProviderFactory, getRegistry, getResponse, handleApplicationException, handleException, handleFailure, handleInvokerException, handleWebApplicationException, handleWriteResponseException, internalInvocation, invoke, preprocess, preprocessExtensions, pushContextObjects, setLanguageMappings, setMediaTypeMappings, writeFailure, writeJaxrsResponse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

executor

protected java.util.concurrent.ExecutorService executor
Constructor Detail

AsynchronousDispatcher

public AsynchronousDispatcher(ResteasyProviderFactory providerFactory)
Method Detail

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

public void setBasePath(java.lang.String basePath)
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

public void setExecutor(java.util.concurrent.ExecutorService executor)
Plug in your own executor to process requests

Parameters:
executor -

start

public void start()

stop

public void stop()

remove

public void remove(java.lang.String jobId)

readAndRemove

public Response readAndRemove(long wait,
                              java.lang.String jobId)

get

public Response get(long wait,
                    java.lang.String jobId)

process

protected Response process(long wait,
                           java.lang.String jobId,
                           boolean eatJob)

invokeSuper

public void invokeSuper(HttpRequest request,
                        HttpResponse response)

isAsynchrnousRequest

public boolean isAsynchrnousRequest(HttpRequest in)

invoke

public void invoke(HttpRequest in,
                   HttpResponse response)
Specified by:
invoke in interface Dispatcher
Overrides:
invoke in class SynchronousDispatcher

postJob

public void postJob(HttpRequest request,
                    HttpResponse response)

oneway

public void oneway(HttpRequest request,
                   HttpResponse response)


Copyright © 2009. All Rights Reserved.