akka.camel
Interface ProducerSupport

All Superinterfaces:
Actor
All Known Subinterfaces:
Oneway, Producer
All Known Implementing Classes:
UntypedProducerActor

public interface ProducerSupport
extends Actor

Support trait for producing messages to Camel endpoints.


Nested Class Summary
private static class ProducerSupport.ProducerChild
           
 
Nested classes/interfaces inherited from interface akka.actor.Actor
Actor.emptyBehavior$
 
Method Summary
 Camel camel()
          INTERNAL API Returns a Camel trait which provides access to the CamelExtension.
 org.apache.camel.impl.DefaultCamelContext camelContext()
          Returns the CamelContext.
 java.lang.String endpointUri()
          Returns the Camel endpoint URI to produce messages to.
 scala.collection.immutable.Set<java.lang.String> headersToCopy()
          Returns the names of message headers to copy from a request message to a response message.
 scala.collection.immutable.Set<java.lang.String> headersToCopyDefault()
          CamelMessage headers to copy by default from request message to response-message.
 boolean oneway()
          If set to false (default), this producer expects a response message from the Camel endpoint.
 void preStart()
          User overridable callback.
 scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> produce()
          Produces msg to the endpoint specified by endpointUri.
 void register()
           
 void routeResponse(java.lang.Object msg)
          Called after a response was received from the endpoint specified by endpointUri.
 java.lang.Object transformOutgoingMessage(java.lang.Object msg)
          Called before the message is sent to the endpoint specified by endpointUri.
 java.lang.Object transformResponse(java.lang.Object msg)
          Called before the response message is sent to the original sender.
 
Methods inherited from interface akka.actor.Actor
context, noSender, postRestart, postStop, preRestart, receive, self, sender, supervisorStrategy, unhandled
 

Method Detail

preStart

void preStart()
Description copied from interface: Actor
User overridable callback.

Is called when an Actor is started. Actors are automatically started asynchronously when created. Empty default implementation.

Specified by:
preStart in interface Actor

register

void register()

headersToCopyDefault

scala.collection.immutable.Set<java.lang.String> headersToCopyDefault()
CamelMessage headers to copy by default from request message to response-message.


oneway

boolean oneway()
If set to false (default), this producer expects a response message from the Camel endpoint. If set to true, this producer initiates an in-only message exchange with the Camel endpoint (fire and forget).


endpointUri

java.lang.String endpointUri()
Returns the Camel endpoint URI to produce messages to.


headersToCopy

scala.collection.immutable.Set<java.lang.String> headersToCopy()
Returns the names of message headers to copy from a request message to a response message. By default only the CamelMessage.MessageExchangeId is copied. Applications may override this to define an application-specific set of message headers to copy.


produce

scala.PartialFunction<java.lang.Object,scala.runtime.BoxedUnit> produce()
Produces msg to the endpoint specified by endpointUri. Before the message is actually sent it is pre-processed by calling receiveBeforeProduce. If oneway is true, an in-only message exchange is initiated, otherwise an in-out message exchange.

See Also:
Producer#produce(Any, ExchangePattern)

transformOutgoingMessage

java.lang.Object transformOutgoingMessage(java.lang.Object msg)
Called before the message is sent to the endpoint specified by endpointUri. The original message is passed as argument. By default, this method simply returns the argument but may be overridden by subtraits or subclasses.


transformResponse

java.lang.Object transformResponse(java.lang.Object msg)
Called before the response message is sent to the original sender. The original message is passed as argument. By default, this method simply returns the argument but may be overridden by subtraits or subclasses.


routeResponse

void routeResponse(java.lang.Object msg)
Called after a response was received from the endpoint specified by endpointUri. The response is passed as argument. By default, this method sends the response back to the original sender if oneway is false. If oneway is true, nothing is done. This method may be overridden by subtraits or subclasses (e.g. to forward responses to another actor).


camel

Camel camel()
INTERNAL API Returns a Camel trait which provides access to the CamelExtension.


camelContext

org.apache.camel.impl.DefaultCamelContext camelContext()
Returns the CamelContext. The camelContext is defined implicit for simplifying the use of CamelMessage from the Scala API.