Project: talendesb
Issue TESB-3824: Make sure RouteBuilder class is exposed when route is exported as OSGi bundle
The wrapper code is a critical piece of code which links us from the Studio environment, to the vanilla eclipse environment, to the runtime environment and it _badly_ needs refactoring. The runtime environment is unnecessarily limited to just OSGI through the OSGI bundle dependency. This and other dependencies should be separated from the core routebuilder code. The route builder is so embedded inside (IMO) unnecessarily nested classes that the generated route cannot be accessed cleanly or used for anything other than launching in an overly restricted way (whether as OSGI or Talend job makes little difference). Fortunately, I _think_ it can be effectively accessed for integration testing. If not, the CI process is disrupted not just by tooling but by the fundamental design of the generated code. I think we can currently still extract just the route from external code that calls Route(false) so that the camelContext is not started. Right now the routeBuilder created by initRoute is already attached to the CamelContext. In a unit test environment with CamelTest I think we can set the test context to the generated camelContext, and use the Route function to supply the configure method. I will verify this. But this should not have to be verified. A peace of code this critical should be crystal clear. Even with the code generator's impact, the code should be much better. Much of the code can be moved into a non-generated framework class which is simply switched using a strategy pattern by the Studio via generated code. PS: why is the method Route capitalized?
Story points: 3