org.apache.activemq.transport.http
Class HttpClientTransport

java.lang.Object
  extended by org.apache.activemq.util.ServiceSupport
      extended by org.apache.activemq.transport.TransportSupport
          extended by org.apache.activemq.transport.TransportThreadSupport
              extended by org.apache.activemq.transport.http.HttpTransportSupport
                  extended by org.apache.activemq.transport.http.HttpClientTransport
All Implemented Interfaces:
Runnable, Service, Transport
Direct Known Subclasses:
HttpsClientTransport

public class HttpClientTransport
extends HttpTransportSupport

A HTTP Transport which uses the Apache HTTP Client library


Field Summary
static int MAX_CLIENT_TIMEOUT
           
 
Constructor Summary
HttpClientTransport(TextWireFormat wireFormat, URI remoteUrl)
           
 
Method Summary
 FutureResponse asyncRequest(Object command)
           
protected  void configureMethod(org.apache.http.message.AbstractHttpMessage method)
           
protected  HttpClient createHttpClient()
           
protected  void doStart()
           
protected  void doStop(ServiceStopper stopper)
           
 int getMinSendAsCompressedSize()
           
 int getReceiveCounter()
          Returns a counter which gets incremented as data is read from the transport.
 HttpClient getReceiveHttpClient()
           
 HttpClient getSendHttpClient()
           
 int getSoTimeout()
           
 boolean isTrace()
           
 boolean isUseCompression()
           
 void oneway(Object command)
          A one way asynchronous send
 Object request(Object command)
          A synchronous request response
 void run()
           
 void setMinSendAsCompressedSize(int minSendAsCompressedSize)
          Sets the minimum size that must be exceeded on a send before compression is used if the useCompression option is specified.
 void setReceiveHttpClient(HttpClient receiveHttpClient)
           
 void setSendHttpClient(HttpClient sendHttpClient)
           
 void setSoTimeout(int soTimeout)
           
 void setTrace(boolean trace)
           
 void setUseCompression(boolean useCompression)
           
 
Methods inherited from class org.apache.activemq.transport.http.HttpTransportSupport
getProxyHost, getProxyPassword, getProxyPort, getProxyUser, getRemoteAddress, getRemoteUrl, getTextWireFormat, setProxyHost, setProxyPassword, setProxyPort, setProxyUser, setTextWireFormat, toString
 
Methods inherited from class org.apache.activemq.transport.TransportThreadSupport
getStackSize, isDaemon, setDaemon, setStackSize
 
Methods inherited from class org.apache.activemq.transport.TransportSupport
asyncRequest, checkStarted, doConsume, getTransportListener, isConnected, isDisposed, isFaultTolerant, isReconnectSupported, isUpdateURIsSupported, narrow, onException, reconnect, request, setTransportListener, updateURIs
 
Methods inherited from class org.apache.activemq.util.ServiceSupport
addServiceListener, dispose, isStarted, isStopped, isStopping, postStop, preStart, removeServiceListener, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.activemq.Service
start, stop
 

Field Detail

MAX_CLIENT_TIMEOUT

public static final int MAX_CLIENT_TIMEOUT
See Also:
Constant Field Values
Constructor Detail

HttpClientTransport

public HttpClientTransport(TextWireFormat wireFormat,
                           URI remoteUrl)
Method Detail

asyncRequest

public FutureResponse asyncRequest(Object command)
                            throws IOException
Throws:
IOException

oneway

public void oneway(Object command)
            throws IOException
Description copied from interface: Transport
A one way asynchronous send

Throws:
IOException

request

public Object request(Object command)
               throws IOException
Description copied from interface: Transport
A synchronous request response

Specified by:
request in interface Transport
Overrides:
request in class TransportSupport
Returns:
the response
Throws:
IOException

run

public void run()

getSendHttpClient

public HttpClient getSendHttpClient()

setSendHttpClient

public void setSendHttpClient(HttpClient sendHttpClient)

getReceiveHttpClient

public HttpClient getReceiveHttpClient()

setReceiveHttpClient

public void setReceiveHttpClient(HttpClient receiveHttpClient)

doStart

protected void doStart()
                throws Exception
Overrides:
doStart in class TransportThreadSupport
Throws:
Exception

doStop

protected void doStop(ServiceStopper stopper)
               throws Exception
Specified by:
doStop in class ServiceSupport
Throws:
Exception

createHttpClient

protected HttpClient createHttpClient()

configureMethod

protected void configureMethod(org.apache.http.message.AbstractHttpMessage method)

isTrace

public boolean isTrace()

setTrace

public void setTrace(boolean trace)

getReceiveCounter

public int getReceiveCounter()
Description copied from interface: Transport
Returns a counter which gets incremented as data is read from the transport. It should only be used to determine if there is progress being made in reading the next command from the transport. The value may wrap into the negative numbers.

Returns:
a counter which gets incremented as data is read from the transport.

getSoTimeout

public int getSoTimeout()

setSoTimeout

public void setSoTimeout(int soTimeout)

setUseCompression

public void setUseCompression(boolean useCompression)

isUseCompression

public boolean isUseCompression()

getMinSendAsCompressedSize

public int getMinSendAsCompressedSize()

setMinSendAsCompressedSize

public void setMinSendAsCompressedSize(int minSendAsCompressedSize)
Sets the minimum size that must be exceeded on a send before compression is used if the useCompression option is specified. For very small payloads compression can be inefficient compared to the transmission size savings. Default value is 0.

Parameters:
minSendAsCompressedSize -


Copyright © 2005-2013 The Apache Software Foundation. All Rights Reserved.