Plugins can now publish objects to be found through PentahoSystem.get() from within their plugin.spring.xml. I would hope we can use this feature instead of the reflection code below.

<bean class="com.foo.MyExecutor">
  <pen:publish as-type="INTERFACES">
    <pen:attributes>
      <pen:attr name="name" value="myExecutorName"/>
    </pen:attributes>
  <pen:publish>
</bean>

// Query for specific implementation of interface
PentahoSystem.get(IMetadataQueryExec.class, session, Collections.singletonMap("name", myExecutorName));