3 Replies Latest reply on Apr 15, 2013 1:50 PM by rareddy

    Slightly OT:  Using Guice to instantiate Execution Factories

    markaddleman

      The rest of our application uses Guice as an injection framework and I'd like to extend that to execution factories.  A couple of questions:

      1. 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.
      2. Can anyone point me to an article discussing how to integrate JBoss 7's bean framework with Guice?  I've found a few articles relating to Jboss 5 but nothing for 7.
        • 1. Re: Slightly OT:  Using Guice to instantiate Execution Factories
          rareddy

          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.

           

          1. 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

            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

              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..