package com.onsemi.middleware.camel;

import org.apache.camel.Exchange;
import org.apache.camel.builder.RouteBuilder;

import com.onsemi.middleware.camel.context.NoMoreDataFromSource;


public abstract class MDWRouteBuilder extends RouteBuilder {

	/***
	 * This determines if interface using camel should be automatically stopped or if Camel context is
	 * auto-stopped via runtime after 2 minutes. Return false and handle stopping via @Autowired Camelcontext manually in code
	 * @return
	 */
	public boolean shouldAutoStop(){
		return false;
	}
	public static boolean isSourceFullyRead(Exchange e){
		if (e.getIn().getBody() != null && e.getIn().getBody() instanceof NoMoreDataFromSource){
			return true;
		}
		else {
			return false;
		}
	}


}
