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

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

public class CamelClient<E extends Exchange>
extends ServiceSupport

A helper client for working with Camel

Version:
$Revision: 532790 $

Constructor Summary
CamelClient(CamelContext context)
           
 
Method Summary
protected  void doStart()
           
protected  void doStop()
           
 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<E> 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<E> processor)
          Sends an exchange to an endpoint using a supplied @{link Processor} to populate the exchange
 
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<E> 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<E> 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

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


Copyright © 2007 Apache Software Foundation. All Rights Reserved.