org.apache.camel
Class CamelClient<E extends Exchange>

java.lang.Object
  extended by org.apache.camel.impl.ServiceSupport
      extended by org.apache.camel.CamelClient<E>
All Implemented Interfaces:
Service

public class CamelClient<E extends Exchange>
extends ServiceSupport

A Client object for working with Camel and invoking Endpoint instances with Exchange instances

Version:
$Revision: 535136 $

Constructor Summary
CamelClient(CamelContext context)
           
 
Method Summary
protected  void doStart()
           
protected  void doStop()
           
protected  Object extractResultBody(E result)
           
 CamelContext getContext()
           
 Producer<E> getProducer(Endpoint<E> endpoint)
           
protected  Endpoint resolveMandatoryEndpoint(String endpointUri)
           
 E send(Endpoint<E> endpoint, E exchange)
          Sends the exchange to the given endpoint
 E send(Endpoint<E> endpoint, Processor processor)
          Sends an exchange to an endpoint using a supplied @{link Processor} to populate the exchange
 E send(String endpointUri, E exchange)
          Sends the exchange to the given endpoint
 E send(String endpointUri, Processor processor)
          Sends an exchange to an endpoint using a supplied @{link Processor} to populate the exchange
 Object sendBody(String endpointUri, Object body)
          Send the body to an endpoint
 Object sendBody(String endpointUri, Object body, String header, Object headerValue)
          Sends the body to an endpoint with a specified header and header value
 
Methods inherited from class org.apache.camel.impl.ServiceSupport
isStarted, isStopped, isStopping, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CamelClient

public CamelClient(CamelContext context)
Method Detail

send

public E send(String endpointUri,
              E exchange)
Sends the exchange to the given endpoint

Parameters:
endpointUri - the endpoint URI to send the exchange to
exchange - the exchange to send

send

public E send(String endpointUri,
              Processor processor)
Sends an exchange to an endpoint using a supplied @{link Processor} to populate the exchange

Parameters:
endpointUri - the endpoint URI to send the exchange to
processor - the transformer used to populate the new exchange

send

public E send(Endpoint<E> endpoint,
              E exchange)
Sends the exchange to the given endpoint

Parameters:
endpoint - the endpoint to send the exchange to
exchange - the exchange to send

send

public E send(Endpoint<E> endpoint,
              Processor processor)
Sends an exchange to an endpoint using a supplied @{link Processor} to populate the exchange

Parameters:
endpoint - the endpoint to send the exchange to
processor - the transformer used to populate the new exchange

sendBody

public Object sendBody(String endpointUri,
                       Object body)
Send the body to an endpoint

Parameters:
endpointUri -
body - = the payload
Returns:
the result

sendBody

public Object sendBody(String endpointUri,
                       Object body,
                       String header,
                       Object headerValue)
Sends the body to an endpoint with a specified header and header value

Parameters:
endpointUri - the endpoint URI to send to
body - the payload send
header - the header name
headerValue - the header value
Returns:
the result

getProducer

public Producer<E> getProducer(Endpoint<E> endpoint)

getContext

public CamelContext getContext()

resolveMandatoryEndpoint

protected Endpoint resolveMandatoryEndpoint(String endpointUri)

doStart

protected void doStart()
                throws Exception
Specified by:
doStart in class ServiceSupport
Throws:
Exception

doStop

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

extractResultBody

protected Object extractResultBody(E result)


Copyright © 2007 Apache Software Foundation. All Rights Reserved.