public class JettyHttpProducer extends DefaultProducer implements AsyncProcessor
log
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending
Constructor and Description |
---|
JettyHttpProducer(Endpoint endpoint)
Creates this producer.
|
JettyHttpProducer(Endpoint endpoint,
org.eclipse.jetty.client.HttpClient client)
Creates this producer
|
Modifier and Type | Method and Description |
---|---|
protected JettyContentExchange |
createHttpExchange(Exchange exchange,
AsyncCallback callback) |
protected static void |
doSendExchange(org.eclipse.jetty.client.HttpClient client,
JettyContentExchange httpExchange) |
protected void |
doStart()
Implementations override this method to support customized start/stop.
|
protected void |
doStop()
Implementations override this method to support customized start/stop.
|
JettyHttpBinding |
getBinding() |
org.eclipse.jetty.client.HttpClient |
getClient() |
JettyHttpEndpoint |
getEndpoint()
Gets the endpoint this producer sends to.
|
org.eclipse.jetty.client.HttpClient |
getSharedClient() |
void |
process(Exchange exchange)
Processes the message exchange
|
boolean |
process(Exchange exchange,
AsyncCallback callback)
Processes the message exchange.
|
void |
setBinding(JettyHttpBinding binding) |
void |
setClient(org.eclipse.jetty.client.HttpClient client) |
void |
setSharedClient(org.eclipse.jetty.client.HttpClient sharedClient) |
createExchange, createExchange, createExchange, isSingleton, toString
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspended, isSuspending, resume, shutdown, start, stop, suspend
public JettyHttpProducer(Endpoint endpoint)
setClient(org.eclipse.jetty.client.HttpClient)
or setSharedClient(org.eclipse.jetty.client.HttpClient)
.endpoint
- the endpointpublic JettyHttpProducer(Endpoint endpoint, org.eclipse.jetty.client.HttpClient client)
endpoint
- the endpointclient
- the non-shared client to usepublic JettyHttpEndpoint getEndpoint()
Producer
getEndpoint
in interface Producer
getEndpoint
in class DefaultProducer
public void process(Exchange exchange) throws Exception
Processor
public boolean process(Exchange exchange, AsyncCallback callback)
AsyncProcessor
Processor.process(org.apache.camel.Exchange)
, but the caller supports having the exchange asynchronously processed.
If there was a failure processing then the caused Exception
would be set on the Exchange
.process
in interface AsyncProcessor
exchange
- the message exchangecallback
- the AsyncCallback
will be invoked when the processing of the exchange is completed.
If the exchange is completed synchronously, then the callback is also invoked synchronously.
The callback should therefore be careful of starting recursive loop.AsyncProcessorHelper.process(AsyncProcessor, Exchange, AsyncCallback)
protected JettyContentExchange createHttpExchange(Exchange exchange, AsyncCallback callback) throws Exception
Exception
protected static void doSendExchange(org.eclipse.jetty.client.HttpClient client, JettyContentExchange httpExchange) throws IOException
IOException
public JettyHttpBinding getBinding()
public void setBinding(JettyHttpBinding binding)
public org.eclipse.jetty.client.HttpClient getClient()
public void setClient(org.eclipse.jetty.client.HttpClient client)
public org.eclipse.jetty.client.HttpClient getSharedClient()
public void setSharedClient(org.eclipse.jetty.client.HttpClient sharedClient)
protected void doStart() throws Exception
ServiceSupport
ServiceSupport.doStop()
for more details.doStart
in class DefaultProducer
Exception
ServiceSupport.doStop()
protected void doStop() throws Exception
ServiceSupport
ServiceSupport.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 DefaultProducer
Exception
ServiceSupport.doStart()
Apache CAMEL