Community
Participate
Working Groups
The current design of the framework requires developers who provide a assembly component implementation to write a "binding service", which reads in the "factory" value from the assembly XML, and instantiate the component object, register the object, and doing other things. The assembly XML is an input to the framework. We should not require developers to read in values from the XML to process in the extension code. It's the job of the framework. If we need to provide the flexibility for instantiating the component object, we can provide a public API for the component implementation to control how the class is instantiated through a factory class. In fact, the assembly XML is already set up to do this. For example: <sink cosmos:factory="org.eclipse.cosmos.dc.sample.components.sink.StatisticalPersistor"> The cosmos:factory attribute defines the factory class that returns an instance of the component implementation. We need to require all factory classes to implement a "getInstance" method that returns a reference to the component object. The getInstance method will be invoked by the framework and not extension code. The factory can return a singleton class or a new instance of the component and it allows the use of custom classloaders. With this approach, you can replace the object instantiation code in the binding service with a call to this factory class, and push the rest of the code to the framework layer (i.e. InboundContext and OutboundContext).
reopen later if necessary