*
* @throws Exception
*/
@Bean
public JobDriverComponent jobDriver() throws Exception {
JobDriverComponent jdc = new JobDriverComponent(common.camelContext(), common.brokerUrl,common.jdQueuePrefix,common.localeLanguage,common.localeCountry);
// Instantiate delegate listener to receive incoming messages.
JobDriverEventListener delegateListener = this.jobDriverDelegateListener(jdc);
// Inject a dispatcher into the listener in case it needs to send
// a message to another component
delegateListener.setDuccEventDispatcher(jobDriverTransport.duccEventDispatcher(common.orchestratorStateUpdateEndpoint, jdc.getContext()));
// Inject Camel Router that will delegate messages to JobDriver delegate listener
jdc.getContext().addRoutes(this.routeBuilderForIncomingRequests(common.orchestratorAbbreviatedStateUpdateEndpoint, delegateListener));
jdc.getContext().addRoutes(this.routeBuilderForJdStatePost(jdc, common.jdStateUpdateEndpoint, Integer.parseInt(common.jdStatePublishRate)));
return jdc;
}