org.mule.transport.http
Class HttpClientMessageDispatcher

java.lang.Object
  extended by org.mule.transport.AbstractTransportMessageHandler
      extended by org.mule.transport.AbstractMessageDispatcher
          extended by org.mule.transport.http.HttpClientMessageDispatcher
All Implemented Interfaces:
Disposable, Initialisable, Lifecycle, LifecycleStateEnabled, Startable, Stoppable, MessageProcessor, Connectable, MessageDispatcher
Direct Known Subclasses:
HttpsClientMessageDispatcher

public class HttpClientMessageDispatcher
extends AbstractMessageDispatcher

HttpClientMessageDispatcher dispatches Mule events over HTTP.


Field Summary
static int ERROR_STATUS_CODE_RANGE_START
          Range start for http error status codes.
protected  HttpConnector httpConnector
           
static int REDIRECT_STATUS_CODE_RANGE_START
           
 
Fields inherited from class org.mule.transport.AbstractMessageDispatcher
defaultOutboundTransformers, defaultResponseTransformers
 
Fields inherited from class org.mule.transport.AbstractTransportMessageHandler
connected, connector, endpoint, lifecycleManager, logger, muleMessageFactory, retryTemplate
 
Fields inherited from interface org.mule.api.transport.MessageDispatcher
RECEIVE_NO_WAIT, RECEIVE_WAIT_INDEFINITELY
 
Fields inherited from interface org.mule.api.lifecycle.Initialisable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Startable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Stoppable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Disposable
PHASE_NAME
 
Constructor Summary
HttpClientMessageDispatcher(OutboundEndpoint endpoint)
           
 
Method Summary
protected  HttpMethod createEntityMethod(MuleEvent event, Object body, EntityEnclosingMethod postMethod)
           
protected  void doConnect()
           
protected  void doDisconnect()
           
protected  void doDispatch(MuleEvent event)
           
protected  void doDispose()
           
protected  void doInitialise()
           
protected  MuleMessage doSend(MuleEvent event)
           
protected  HttpMethod execute(MuleEvent event, HttpMethod httpMethod)
           
protected  HostConfiguration getHostConfig(URI uri)
           
protected  HttpMethod getMethod(MuleEvent event)
           
protected  MuleMessage getResponseFromMethod(HttpMethod httpMethod, ExceptionPayload ep)
           
protected  MuleMessage handleRedirect(HttpMethod method, MuleEvent event)
           
protected  void processCookies(MuleEvent event)
           
protected  boolean returnException(MuleEvent event, HttpMethod httpMethod)
          An exception is thrown if http.status >= 400 and exceptions are not disabled through one of the following mechanisms in order of precedence: - setting to true the flow variable "http.disable.status.code.exception.check" - setting to true the outbound property "http.disable.status.code.exception.check" - setting to false the outbound endpoint attribute "exceptionOnMessageError"
protected  void setPropertyFromEndpoint(MuleEvent event, MuleMessage msg, String prop)
           
 
Methods inherited from class org.mule.transport.AbstractMessageDispatcher
applyOutboundTransformers, applyResponseTransformers, createLifecycleManager, getDispatcherName, getEndpoint, getWorkManager, process, returnResponse, returnResponse
 
Methods inherited from class org.mule.transport.AbstractTransportMessageHandler
activate, connect, connectHandler, createMuleMessage, createMuleMessage, createMuleMessage, createMuleMessageFactory, createNullMuleMessage, disconnect, dispose, disposeAndLogException, doStart, doStartHandler, doStop, getConnectEventId, getConnectionDescription, getConnector, getLifecycleState, initialise, initializeMessageFactory, initializeRetryPolicy, isConnected, isDoThreading, isStarted, isStarting, isStopped, isStopping, passivate, setEndpoint, start, stop, toString, validate, validateConnection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mule.api.transport.MessageDispatcher
activate, createMuleMessage, createMuleMessage, getConnector, passivate, validate
 
Methods inherited from interface org.mule.api.transport.Connectable
connect, disconnect, getConnectionDescription, isConnected, validateConnection
 
Methods inherited from interface org.mule.api.lifecycle.Initialisable
initialise
 
Methods inherited from interface org.mule.api.lifecycle.Startable
start
 
Methods inherited from interface org.mule.api.lifecycle.Stoppable
stop
 
Methods inherited from interface org.mule.api.lifecycle.Disposable
dispose
 
Methods inherited from interface org.mule.api.lifecycle.LifecycleStateEnabled
getLifecycleState
 

Field Detail

ERROR_STATUS_CODE_RANGE_START

public static final int ERROR_STATUS_CODE_RANGE_START
Range start for http error status codes.

See Also:
Constant Field Values

REDIRECT_STATUS_CODE_RANGE_START

public static final int REDIRECT_STATUS_CODE_RANGE_START
See Also:
Constant Field Values

httpConnector

protected final HttpConnector httpConnector
Constructor Detail

HttpClientMessageDispatcher

public HttpClientMessageDispatcher(OutboundEndpoint endpoint)
Method Detail

doInitialise

protected void doInitialise()
                     throws InitialisationException
Overrides:
doInitialise in class AbstractTransportMessageHandler
Throws:
InitialisationException

doConnect

protected void doConnect()
                  throws Exception
Overrides:
doConnect in class AbstractTransportMessageHandler
Throws:
Exception

doDisconnect

protected void doDisconnect()
                     throws Exception
Overrides:
doDisconnect in class AbstractTransportMessageHandler
Throws:
Exception

doDispatch

protected void doDispatch(MuleEvent event)
                   throws Exception
Specified by:
doDispatch in class AbstractMessageDispatcher
Throws:
Exception

execute

protected HttpMethod execute(MuleEvent event,
                             HttpMethod httpMethod)
                      throws Exception
Throws:
Exception

processCookies

protected void processCookies(MuleEvent event)

getMethod

protected HttpMethod getMethod(MuleEvent event)
                        throws TransformerException
Throws:
TransformerException

setPropertyFromEndpoint

protected void setPropertyFromEndpoint(MuleEvent event,
                                       MuleMessage msg,
                                       String prop)

createEntityMethod

protected HttpMethod createEntityMethod(MuleEvent event,
                                        Object body,
                                        EntityEnclosingMethod postMethod)
                                 throws TransformerException
Throws:
TransformerException

doSend

protected MuleMessage doSend(MuleEvent event)
                      throws Exception
Specified by:
doSend in class AbstractMessageDispatcher
Throws:
Exception

handleRedirect

protected MuleMessage handleRedirect(HttpMethod method,
                                     MuleEvent event)
                              throws HttpResponseException,
                                     MuleException,
                                     IOException
Throws:
HttpResponseException
MuleException
IOException

getResponseFromMethod

protected MuleMessage getResponseFromMethod(HttpMethod httpMethod,
                                            ExceptionPayload ep)
                                     throws IOException,
                                            MuleException
Throws:
IOException
MuleException

returnException

protected boolean returnException(MuleEvent event,
                                  HttpMethod httpMethod)
An exception is thrown if http.status >= 400 and exceptions are not disabled through one of the following mechanisms in order of precedence: - setting to true the flow variable "http.disable.status.code.exception.check" - setting to true the outbound property "http.disable.status.code.exception.check" - setting to false the outbound endpoint attribute "exceptionOnMessageError"

Returns:
if an exception should be thrown

getHostConfig

protected HostConfiguration getHostConfig(URI uri)
                                   throws Exception
Throws:
Exception

doDispose

protected void doDispose()
Overrides:
doDispose in class AbstractTransportMessageHandler


Copyright © 2003-2014 MuleSoft, Inc.. All Rights Reserved.