All custom components in Exalead CloudView (except Mashup) use a generic mechanism, called CVComponent, to handle the instantiation and configuration aspects.
In the Exalead CloudView configuration, you use your custom component by:
• Referencing its class.
• Providing the configuration for this usage of the component.
The CVComponent mechanism transmits the configuration to a new instance of your class.
In the Exalead CloudView configuration, the configuration of the custom component is given as a hierarchical listing of string key-values.
It is then transformed into a structured object, which must implement the CVComponentConfig interface.
For example, to create a custom analysis processor that connects to an auxiliary data source needing a login and password, define the component as follows:
@CVComponentConfigClass(configClass=MyProcessorConfig.class) public class MyProcessor extends CustomDocumentProcessor { public MyProcessor(MyProcessorConfig config) { super(config); this.config = config; }
@Override public void process(DocumentProcessingContext context,ProcessableDocument document) throws Exception { // Connect to the data source connect(config.login, config.password); // Work ... } }