2012-07-15 14:12:03 +02:00
|
|
|
package docs.camel;
|
|
|
|
|
//#RouteResponse
|
|
|
|
|
import akka.actor.ActorRef;
|
|
|
|
|
import akka.camel.javaapi.UntypedProducerActor;
|
|
|
|
|
|
|
|
|
|
public class Forwarder extends UntypedProducerActor {
|
|
|
|
|
private String uri;
|
|
|
|
|
private ActorRef target;
|
|
|
|
|
|
|
|
|
|
public Forwarder(String uri, ActorRef target) {
|
|
|
|
|
this.uri = uri;
|
|
|
|
|
this.target = target;
|
|
|
|
|
}
|
2012-07-23 01:36:12 +02:00
|
|
|
|
2012-07-15 14:12:03 +02:00
|
|
|
public String getEndpointUri() {
|
|
|
|
|
return uri;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onRouteResponse(Object message) {
|
2012-07-23 01:36:12 +02:00
|
|
|
target.forward(message, getContext());
|
2012-07-15 14:12:03 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//#RouteResponse
|