Search in sources :

Example 1 with SynchronousDelegateProducer

use of org.apache.camel.impl.SynchronousDelegateProducer in project camel by apache.

the class JettyHttpEndpoint method createProducer.

@Override
public Producer createProducer() throws Exception {
    JettyHttpProducer answer = new JettyHttpProducer(this);
    if (httpClient != null) {
        // use shared client, and ensure its started so we can use it
        httpClient.start();
        answer.setSharedClient(httpClient);
        answer.setBinding(getJettyBinding(httpClient));
    } else {
        HttpClient httpClient = createJettyHttpClient();
        answer.setClient(httpClient);
        answer.setBinding(getJettyBinding(httpClient));
    }
    if (isSynchronous()) {
        return new SynchronousDelegateProducer(answer);
    } else {
        return answer;
    }
}
Also used : HttpClient(org.eclipse.jetty.client.HttpClient) SynchronousDelegateProducer(org.apache.camel.impl.SynchronousDelegateProducer)

Aggregations

SynchronousDelegateProducer (org.apache.camel.impl.SynchronousDelegateProducer)1 HttpClient (org.eclipse.jetty.client.HttpClient)1