getRouteCollection().setCamelContext(camelContext);
camelContext.addRouteDefinitions(getRouteCollection().getRoutes());
}
protected void populateRests() throws Exception {
ModelCamelContext camelContext = getContext();
if (camelContext == null) {
throw new IllegalArgumentException("CamelContext has not been injected!");
}
getRestCollection().setCamelContext(camelContext);
// setup rest configuration before adding the rests
if (getRestConfiguration() != null) {
RestConfiguration config = getRestConfiguration().asRestConfiguration(getContext());
camelContext.setRestConfiguration(config);
}
camelContext.addRestDefinitions(getRestCollection().getRests());
}