org.jboss.resteasy.core
Class SynchronousDispatcher

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

public class SynchronousDispatcher
extends java.lang.Object
implements Dispatcher

Version:
$Revision: 1 $
Author:
Bill Burke

Field Summary
protected  java.util.Map<java.lang.Class,java.lang.Object> defaultContextObjects
           
protected  ExtensionHttpPreprocessor extentionHttpPreprocessor
           
protected  ResteasyProviderFactory providerFactory
           
protected  Registry registry
           
protected  java.util.List<HttpRequestPreprocessor> requestPreprocessors
           
 
Constructor Summary
SynchronousDispatcher(ResteasyProviderFactory providerFactory)
           
 
Method Summary
 void addHttpPreprocessor(HttpRequestPreprocessor httpPreprocessor)
           
 void asynchronousDelivery(HttpRequest request, HttpResponse response, Response jaxrsResponse)
           
 void clearContextData()
           
 boolean executeExceptionMapper(HttpResponse response, java.lang.Throwable exception)
          Execute an ExceptionMapper if one exists for the given exception
 java.util.Map<java.lang.Class,java.lang.Object> getDefaultContextObjects()
           
 ResourceInvoker getInvoker(HttpRequest request, HttpResponse response)
           
 java.util.Map<java.lang.String,java.lang.String> getLanguageMappings()
           
 java.util.Map<java.lang.String,MediaType> getMediaTypeMappings()
           
 ResteasyProviderFactory getProviderFactory()
           
 Registry getRegistry()
           
protected  Response getResponse(HttpRequest request, HttpResponse response, ResourceInvoker invoker)
           
protected  void handleApplicationException(HttpResponse response, ApplicationException e)
           
 void handleException(HttpRequest request, HttpResponse response, java.lang.Exception e)
           
protected  void handleFailure(HttpRequest request, HttpResponse response, Failure failure)
           
 void handleInvokerException(HttpRequest request, HttpResponse response, java.lang.Exception e)
          Called if method invoke was unsuccessful
protected  void handleReaderException(HttpRequest request, HttpResponse response, ReaderException e)
           
protected  void handleWebApplicationException(HttpResponse response, WebApplicationException wae)
           
 void handleWriteResponseException(HttpRequest request, HttpResponse response, java.lang.Exception e)
          Called if method invoke was successful, but writing the Response after was not.
protected  void handleWriterException(HttpRequest request, HttpResponse response, WriterException e)
           
 Response internalInvocation(HttpRequest request, HttpResponse response, java.lang.Object entity)
           
 void invoke(HttpRequest request, HttpResponse response)
           
 void invoke(HttpRequest request, HttpResponse response, ResourceInvoker invoker)
           
protected  void preprocess(HttpRequest in)
           
protected  void preprocessExtensions(HttpRequest in)
           
 void pushContextObjects(HttpRequest request, HttpResponse response)
           
 void setLanguageMappings(java.util.Map<java.lang.String,java.lang.String> languageMappings)
           
 void setMediaTypeMappings(java.util.Map<java.lang.String,MediaType> mediaTypeMappings)
           
protected  void writeFailure(HttpResponse response, Response jaxrsResponse)
           
protected  void writeJaxrsResponse(HttpResponse response, Response jaxrsResponse)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

providerFactory

protected ResteasyProviderFactory providerFactory

registry

protected Registry registry

requestPreprocessors

protected java.util.List<HttpRequestPreprocessor> requestPreprocessors

extentionHttpPreprocessor

protected ExtensionHttpPreprocessor extentionHttpPreprocessor

defaultContextObjects

protected java.util.Map<java.lang.Class,java.lang.Object> defaultContextObjects
Constructor Detail

SynchronousDispatcher

public SynchronousDispatcher(ResteasyProviderFactory providerFactory)
Method Detail

getProviderFactory

public ResteasyProviderFactory getProviderFactory()
Specified by:
getProviderFactory in interface Dispatcher

getRegistry

public Registry getRegistry()
Specified by:
getRegistry in interface Dispatcher

setMediaTypeMappings

public void setMediaTypeMappings(java.util.Map<java.lang.String,MediaType> mediaTypeMappings)
Specified by:
setMediaTypeMappings in interface Dispatcher

setLanguageMappings

public void setLanguageMappings(java.util.Map<java.lang.String,java.lang.String> languageMappings)
Specified by:
setLanguageMappings in interface Dispatcher

getMediaTypeMappings

public java.util.Map<java.lang.String,MediaType> getMediaTypeMappings()
Specified by:
getMediaTypeMappings in interface Dispatcher

getDefaultContextObjects

public java.util.Map<java.lang.Class,java.lang.Object> getDefaultContextObjects()
Specified by:
getDefaultContextObjects in interface Dispatcher

getLanguageMappings

public java.util.Map<java.lang.String,java.lang.String> getLanguageMappings()
Specified by:
getLanguageMappings in interface Dispatcher

preprocess

protected void preprocess(HttpRequest in)

preprocessExtensions

protected void preprocessExtensions(HttpRequest in)

invoke

public void invoke(HttpRequest request,
                   HttpResponse response)
Specified by:
invoke in interface Dispatcher

getInvoker

public ResourceInvoker getInvoker(HttpRequest request,
                                  HttpResponse response)
                           throws Failure
Throws:
Failure

handleInvokerException

public void handleInvokerException(HttpRequest request,
                                   HttpResponse response,
                                   java.lang.Exception e)
Called if method invoke was unsuccessful

Parameters:
request -
response -
e -

handleWriteResponseException

public void handleWriteResponseException(HttpRequest request,
                                         HttpResponse response,
                                         java.lang.Exception e)
Called if method invoke was successful, but writing the Response after was not.

Parameters:
request -
response -
e -

handleException

public void handleException(HttpRequest request,
                            HttpResponse response,
                            java.lang.Exception e)

handleFailure

protected void handleFailure(HttpRequest request,
                             HttpResponse response,
                             Failure failure)

executeExceptionMapper

public boolean executeExceptionMapper(HttpResponse response,
                                      java.lang.Throwable exception)
Execute an ExceptionMapper if one exists for the given exception

Parameters:
response -
exception -
Returns:
true if an ExceptionMapper was found and executed

handleApplicationException

protected void handleApplicationException(HttpResponse response,
                                          ApplicationException e)

handleWriterException

protected void handleWriterException(HttpRequest request,
                                     HttpResponse response,
                                     WriterException e)

handleReaderException

protected void handleReaderException(HttpRequest request,
                                     HttpResponse response,
                                     ReaderException e)

writeFailure

protected void writeFailure(HttpResponse response,
                            Response jaxrsResponse)

handleWebApplicationException

protected void handleWebApplicationException(HttpResponse response,
                                             WebApplicationException wae)

pushContextObjects

public void pushContextObjects(HttpRequest request,
                               HttpResponse response)

internalInvocation

public Response internalInvocation(HttpRequest request,
                                   HttpResponse response,
                                   java.lang.Object entity)
Specified by:
internalInvocation in interface Dispatcher

clearContextData

public void clearContextData()

invoke

public void invoke(HttpRequest request,
                   HttpResponse response,
                   ResourceInvoker invoker)

getResponse

protected Response getResponse(HttpRequest request,
                               HttpResponse response,
                               ResourceInvoker invoker)

asynchronousDelivery

public void asynchronousDelivery(HttpRequest request,
                                 HttpResponse response,
                                 Response jaxrsResponse)

writeJaxrsResponse

protected void writeJaxrsResponse(HttpResponse response,
                                  Response jaxrsResponse)
                           throws WriterException
Throws:
WriterException

addHttpPreprocessor

public void addHttpPreprocessor(HttpRequestPreprocessor httpPreprocessor)
Specified by:
addHttpPreprocessor in interface Dispatcher


Copyright © 2009. All Rights Reserved.