Project: talendesb
Issue TESB-4539: Modify cBean To Register Beans with Container
cBean only creates anonymous beans based on a Class rather than Objects. These anonymous beans cannot be configured using constructors. As a result the user is forced to configure them with code rather than GUI. In addition, there is no singleton object, so references to the Bean different routes end up created different Bean instances which are unaware of each other. Even in the cConfig section because there is no means of getting a handle to them. As a result the user is left writing Java code without a real object based component framework. It is important that our code generator generates code which uses a solid component framework rather than building from the ground up. While the user or us could reinvent the wheel, it is important that our components build and extend existing frameworks correctly. The Camel Context Registry interface is can _lookup_ beans, but the bean id is required. The Camel Registry does not serve to register beans. So the best solution would be to inject an abstraction of the container that allows registration of beans. These beans should be fairly general so their properties can be configured by the user without writing code. An important ability is for Beans to refer to other Beans via their properties. Like the cConfig bean they are not directly connected to Routes. Instead, they are connected to Routes via the cBean with a ref property. Like cConfig, and unlike the EIP oriented elements, the beans are referenced by the flow rather than participating directly in the wiring. So it may make sense to have another Resource or Bean tab perspective (like the code or design tabs) that shows the wiring of these static resources. This keeps separation of concerns between resource structure and message flow.
Story points: 3