Class HttpClientTransport
- java.lang.Object
-
- org.apache.activemq.util.ServiceSupport
-
- org.apache.activemq.transport.TransportSupport
-
- org.apache.activemq.transport.TransportThreadSupport
-
- org.apache.activemq.transport.http.HttpTransportSupport
-
- org.apache.activemq.transport.http.HttpClientTransport
-
- All Implemented Interfaces:
Runnable,org.apache.activemq.Service,org.apache.activemq.transport.Transport
- Direct Known Subclasses:
HttpsClientTransport
public class HttpClientTransport extends HttpTransportSupport
A HTTPTransportwhich uses the Apache HTTP Client library
-
-
Field Summary
Fields Modifier and Type Field Description protected booleancanSendCompressedstatic intMAX_CLIENT_TIMEOUT
-
Constructor Summary
Constructors Constructor Description HttpClientTransport(TextWireFormat wireFormat, URI remoteUrl)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.activemq.transport.FutureResponseasyncRequest(Object command)protected voidconfigureMethod(org.apache.http.message.AbstractHttpMessage method)protected org.apache.http.conn.HttpClientConnectionManagercreateClientConnectionManager()protected org.apache.http.client.HttpClientcreateHttpClient()protected voiddoStart()protected voiddoStop(ServiceStopper stopper)intgetMinSendAsCompressedSize()X509Certificate[]getPeerCertificates()intgetReceiveCounter()org.apache.http.client.HttpClientgetReceiveHttpClient()org.apache.http.client.HttpClientgetSendHttpClient()intgetSoTimeout()protected StringgetSystemPropertyPrefix()org.apache.activemq.wireformat.WireFormatgetWireFormat()booleanisTrace()booleanisUseCompression()voidoneway(Object command)Objectrequest(Object command)voidrun()voidsetMinSendAsCompressedSize(int minSendAsCompressedSize)Sets the minimum size that must be exceeded on a send before compression is used if the useCompression option is specified.voidsetPeerCertificates(X509Certificate[] certificates)voidsetReceiveHttpClient(org.apache.http.client.HttpClient receiveHttpClient)voidsetSendHttpClient(org.apache.http.client.HttpClient sendHttpClient)voidsetSoTimeout(int soTimeout)voidsetTrace(boolean trace)voidsetUseCompression(boolean useCompression)-
Methods inherited from class org.apache.activemq.transport.http.HttpTransportSupport
getNonProxyHosts, getProxyHost, getProxyPassword, getProxyPort, getProxyUser, getRemoteAddress, getRemoteUrl, getTextWireFormat, setNonProxyHosts, 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
-
-
-
-
Field Detail
-
MAX_CLIENT_TIMEOUT
public static final int MAX_CLIENT_TIMEOUT
- See Also:
- Constant Field Values
-
canSendCompressed
protected boolean canSendCompressed
-
-
Constructor Detail
-
HttpClientTransport
public HttpClientTransport(TextWireFormat wireFormat, URI remoteUrl)
-
-
Method Detail
-
asyncRequest
public org.apache.activemq.transport.FutureResponse asyncRequest(Object command) throws IOException
- Throws:
IOException
-
oneway
public void oneway(Object command) throws IOException
- Throws:
IOException
-
request
public Object request(Object command) throws IOException
- Specified by:
requestin interfaceorg.apache.activemq.transport.Transport- Overrides:
requestin classorg.apache.activemq.transport.TransportSupport- Throws:
IOException
-
run
public void run()
-
getSendHttpClient
public org.apache.http.client.HttpClient getSendHttpClient()
-
setSendHttpClient
public void setSendHttpClient(org.apache.http.client.HttpClient sendHttpClient)
-
getReceiveHttpClient
public org.apache.http.client.HttpClient getReceiveHttpClient()
-
setReceiveHttpClient
public void setReceiveHttpClient(org.apache.http.client.HttpClient receiveHttpClient)
-
doStart
protected void doStart() throws Exception- Overrides:
doStartin classorg.apache.activemq.transport.TransportThreadSupport- Throws:
Exception
-
doStop
protected void doStop(ServiceStopper stopper) throws Exception
- Specified by:
doStopin classServiceSupport- Throws:
Exception
-
createHttpClient
protected org.apache.http.client.HttpClient createHttpClient()
-
createClientConnectionManager
protected org.apache.http.conn.HttpClientConnectionManager createClientConnectionManager()
-
configureMethod
protected void configureMethod(org.apache.http.message.AbstractHttpMessage method)
-
isTrace
public boolean isTrace()
-
setTrace
public void setTrace(boolean trace)
-
getReceiveCounter
public int getReceiveCounter()
-
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-
-
getPeerCertificates
public X509Certificate[] getPeerCertificates()
-
setPeerCertificates
public void setPeerCertificates(X509Certificate[] certificates)
-
getWireFormat
public org.apache.activemq.wireformat.WireFormat getWireFormat()
-
getSystemPropertyPrefix
protected String getSystemPropertyPrefix()
- Specified by:
getSystemPropertyPrefixin classHttpTransportSupport
-
-