akka.camel.javaapi
Class UntypedProducerActor

java.lang.Object
  extended by akka.actor.UntypedActor
      extended by akka.camel.javaapi.UntypedProducerActor
All Implemented Interfaces:
Actor, ProducerSupport

public abstract class UntypedProducerActor
extends UntypedActor
implements ProducerSupport

Subclass this abstract class to create an untyped producer actor. This class is meant to be used from Java.


Nested Class Summary
 
Nested classes/interfaces inherited from interface akka.actor.Actor
Actor.emptyBehavior$
 
Constructor Summary
UntypedProducerActor()
           
 
Method Summary
 Camel camel()
          For internal use only.
 org.apache.camel.impl.DefaultCamelContext camelContext()
          Returns the CamelContext.
 java.lang.String endpointUri()
          Returns the Camel endpoint URI to produce messages to.
 Activation getActivation()
          ''Java API'': Returns the Activation interface that can be used to wait on activation or de-activation of Camel endpoints.
 org.apache.camel.impl.DefaultCamelContext getCamelContext()
          Returns the CamelContext.
abstract  java.lang.String getEndpointUri()
          Returns the Camel endpoint URI to produce messages to.
 org.apache.camel.ProducerTemplate getProducerTemplate()
          Returns the ProducerTemplate.
 boolean isOneway()
          If set to false (default), this producer expects a response message from the Camel endpoint.
 boolean oneway()
          If set to false (default), this producer expects a response message from the Camel endpoint.
 void onReceive(java.lang.Object message)
          Default implementation of UntypedActor.onReceive
 void onRouteResponse(java.lang.Object message)
          Called after a response was received from the endpoint specified by endpointUri.
 java.lang.Object onTransformOutgoingMessage(java.lang.Object message)
          Called before the message is sent to the endpoint specified by getEndpointUri.
 java.lang.Object onTransformResponse(java.lang.Object message)
          Called before the response message is sent to original sender.
 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 class akka.actor.UntypedActor
getContext, getSelf, getSender, postRestart, postStop, preRestart, preStart, receive, supervisorStrategy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface akka.camel.ProducerSupport
headersToCopy, headersToCopyDefault, preStart, produce, register
 
Methods inherited from interface akka.actor.Actor
context, noSender, postRestart, postStop, preRestart, receive, self, sender, supervisorStrategy, unhandled
 

Constructor Detail

UntypedProducerActor

public UntypedProducerActor()
Method Detail

onTransformOutgoingMessage

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


onTransformResponse

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


onRouteResponse

public void onRouteResponse(java.lang.Object message)
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 subclasses (e.g. to forward responses to another actor).


transformOutgoingMessage

public final java.lang.Object transformOutgoingMessage(java.lang.Object msg)
Description copied from interface: ProducerSupport
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.

Specified by:
transformOutgoingMessage in interface ProducerSupport

transformResponse

public final java.lang.Object transformResponse(java.lang.Object msg)
Description copied from interface: ProducerSupport
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.

Specified by:
transformResponse in interface ProducerSupport

routeResponse

public final void routeResponse(java.lang.Object msg)
Description copied from interface: ProducerSupport
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).

Specified by:
routeResponse in interface ProducerSupport

endpointUri

public final java.lang.String endpointUri()
Description copied from interface: ProducerSupport
Returns the Camel endpoint URI to produce messages to.

Specified by:
endpointUri in interface ProducerSupport

oneway

public final boolean oneway()
Description copied from interface: ProducerSupport
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).

Specified by:
oneway in interface ProducerSupport

onReceive

public final void onReceive(java.lang.Object message)
Default implementation of UntypedActor.onReceive

Specified by:
onReceive in class UntypedActor

getEndpointUri

public abstract java.lang.String getEndpointUri()
Returns the Camel endpoint URI to produce messages to.


isOneway

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


getCamelContext

public org.apache.camel.impl.DefaultCamelContext getCamelContext()
Returns the CamelContext.


getProducerTemplate

public org.apache.camel.ProducerTemplate getProducerTemplate()
Returns the ProducerTemplate.


getActivation

public Activation getActivation()
''Java API'': Returns the Activation interface that can be used to wait on activation or de-activation of Camel endpoints.

Returns:
the Activation interface

camel

public Camel camel()
For internal use only. Returns a Camel trait which provides access to the CamelExtension.


camelContext

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