@UriEndpoint(scheme="ahc", title="AHC", syntax="ahc:httpUri", producerOnly=true, label="http") public class AhcEndpoint extends DefaultEndpoint implements HeaderFilterStrategyAware
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending| Constructor and Description |
|---|
AhcEndpoint(String endpointUri,
AhcComponent component,
URI httpUri) |
| Modifier and Type | Method and Description |
|---|---|
protected com.ning.http.client.AsyncHttpClient |
createClient(com.ning.http.client.AsyncHttpClientConfig config) |
Consumer |
createConsumer(Processor processor)
Creates a new Event
Driven Consumer which consumes messages from the endpoint using the
given processor
|
Producer |
createProducer()
Creates a new producer which is used send messages into the endpoint
|
protected void |
doStart()
Implementations override this method to support customized start/stop.
|
protected void |
doStop()
Implementations override this method to support customized start/stop.
|
AhcBinding |
getBinding() |
int |
getBufferSize() |
com.ning.http.client.AsyncHttpClient |
getClient() |
com.ning.http.client.AsyncHttpClientConfig |
getClientConfig() |
AhcComponent |
getComponent()
Returns the component that created this endpoint.
|
HeaderFilterStrategy |
getHeaderFilterStrategy()
Gets the header filter strategy used
|
URI |
getHttpUri() |
SSLContextParameters |
getSslContextParameters() |
boolean |
isBridgeEndpoint() |
boolean |
isLenientProperties()
Should all properties be known or does the endpoint allow unknown options?
lenient = false means that the endpoint should validate that all
given options is known and configured properly.
|
boolean |
isSingleton()
Whether this class supports being singleton or not.
|
boolean |
isThrowExceptionOnFailure() |
boolean |
isTransferException() |
void |
setBinding(AhcBinding binding)
To use a custom
AhcBinding which allows to control how to bind between AHC and Camel. |
void |
setBridgeEndpoint(boolean bridgeEndpoint)
If the option is true, then the Exchange.HTTP_URI header is ignored, and use the endpoint's URI for request.
|
void |
setBufferSize(int bufferSize)
The initial in-memory buffer size used when transferring data between Camel and AHC Client.
|
void |
setClient(com.ning.http.client.AsyncHttpClient client)
To use a custom
AsyncHttpClient |
void |
setClientConfig(com.ning.http.client.AsyncHttpClientConfig clientConfig)
To configure the AsyncHttpClient to use a custom com.ning.http.client.AsyncHttpClientConfig instance.
|
void |
setHeaderFilterStrategy(HeaderFilterStrategy headerFilterStrategy)
To use a custom HeaderFilterStrategy to filter header to and from Camel message.
|
void |
setHttpUri(URI httpUri)
The URI to use such as http://hostname:port/path
|
void |
setSslContextParameters(SSLContextParameters sslContextParameters)
Reference to a org.apache.camel.util.jsse.SSLContextParameters in the Registry.
|
void |
setThrowExceptionOnFailure(boolean throwExceptionOnFailure)
Option to disable throwing the AhcOperationFailedException in case of failed responses from the remote server.
|
void |
setTransferException(boolean transferException)
If enabled and an Exchange failed processing on the consumer side, and if the caused Exception was send back serialized
in the response as a application/x-java-serialized-object content type (for example using Jetty or Servlet Camel components).
|
configureConsumer, configurePollingConsumer, configureProperties, createEndpointConfiguration, createEndpointUri, createExchange, createExchange, createExchange, createPollingConsumer, equals, getCamelContext, getConsumerProperties, getEndpointConfiguration, getEndpointKey, getEndpointUri, getExchangePattern, getId, getPollingConsumerQueueSize, hashCode, isPollingConsumerBlockWhenFull, isSynchronous, setCamelContext, setConsumerProperties, setEndpointConfiguration, setEndpointUri, setEndpointUriIfNotSpecified, setExchangePattern, setPollingConsumerBlockWhenFull, setPollingConsumerQueueSize, setProperties, setSynchronous, toStringdoResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, resume, shutdown, start, stop, suspendpublic AhcEndpoint(String endpointUri, AhcComponent component, URI httpUri)
public AhcComponent getComponent()
DefaultEndpointgetComponent in class DefaultEndpointpublic Producer createProducer() throws Exception
EndpointcreateProducer in interface EndpointException - can be thrownpublic Consumer createConsumer(Processor processor) throws Exception
EndpointcreateConsumer in interface Endpointprocessor - the given processorException - can be thrownpublic boolean isLenientProperties()
EndpointisLenientProperties in interface EndpointisLenientProperties in class DefaultEndpointpublic boolean isSingleton()
IsSingletonisSingleton in interface IsSingletonpublic com.ning.http.client.AsyncHttpClient getClient()
public void setClient(com.ning.http.client.AsyncHttpClient client)
AsyncHttpClientpublic com.ning.http.client.AsyncHttpClientConfig getClientConfig()
public void setClientConfig(com.ning.http.client.AsyncHttpClientConfig clientConfig)
public URI getHttpUri()
public void setHttpUri(URI httpUri)
public AhcBinding getBinding()
public void setBinding(AhcBinding binding)
AhcBinding which allows to control how to bind between AHC and Camel.public HeaderFilterStrategy getHeaderFilterStrategy()
HeaderFilterStrategyAwaregetHeaderFilterStrategy in interface HeaderFilterStrategyAwarepublic void setHeaderFilterStrategy(HeaderFilterStrategy headerFilterStrategy)
setHeaderFilterStrategy in interface HeaderFilterStrategyAwareheaderFilterStrategy - the strategypublic boolean isBridgeEndpoint()
public void setBridgeEndpoint(boolean bridgeEndpoint)
public boolean isThrowExceptionOnFailure()
public void setThrowExceptionOnFailure(boolean throwExceptionOnFailure)
public boolean isTransferException()
public void setTransferException(boolean transferException)
public SSLContextParameters getSslContextParameters()
public void setSslContextParameters(SSLContextParameters sslContextParameters)
public int getBufferSize()
public void setBufferSize(int bufferSize)
protected void doStart()
throws Exception
ServiceSupportServiceSupport.doStop() for more details.doStart in class DefaultEndpointExceptionServiceSupport.doStop()protected com.ning.http.client.AsyncHttpClient createClient(com.ning.http.client.AsyncHttpClientConfig config)
protected void doStop()
throws Exception
ServiceSupportServiceSupport.doStop() method when
the service is being stopped. This method will also be invoked
if the service is still in uninitialized state (eg has not
been started). The method is always called to allow the service
to do custom logic when the service is being stopped, such as when
CamelContext is shutting down.doStop in class DefaultEndpointExceptionServiceSupport.doStart()Copyright © 2007–2015 The Apache Software Foundation. All rights reserved.