-
1. Re: Slightly OT: Using Guice to instantiate Execution Factories
rareddy Apr 15, 2013 1:00 PM (in response to markaddleman)Mark,
Execution factory is instantiated by the Teiid framework, it uses service loader techniques (see TranslatorAdd.java) and simple reflection based utilities for vdb instance (see VDBService.java and TranslatorUtil.buildExecutionFactory). So, there is no support for DI.
- Does Teiid use JBoss's bean framework to construct execution factories? I've seen the getInstance() method in ExecutionFactory but it doesn't seem to be used.
This is convenience method to be used by users of custom translators. Many times there is interface and implementation classes are provided, this used for those invocations.
As per (2), unless Teiid + AS7 supports Guice, I do not think we can extend that for ExecutionFactory. If you are using the Teiid Embedded there you have flxibility in doing what you want in building the EmbeddedServer.
Ramesh..
-
2. Re: Slightly OT: Using Guice to instantiate Execution Factories
markaddleman Apr 15, 2013 1:18 PM (in response to rareddy)Thanks Ramesh. Would you entertain a patch that abstracts ExecutionFactory construction? I'm thinking an interface like
public ExecutionFactory<?,?> newExecutionFactory(String executionFactoryName) throws Exception;
The specific implementation would be specified in standalone.xml and the default would be the same reflection-based mechanism in-place today.
-
3. Re: Slightly OT: Using Guice to instantiate Execution Factories
rareddy Apr 15, 2013 1:50 PM (in response to markaddleman)In AS7 based deployment, there is concept called "TranslatorRepository" internally, that may be better to generalize and provide the extension point. Then we may have re-work little code on VDBService.
Ramesh..