Class AbstractGuiceAwareExecutableExtensionFactory

  • All Implemented Interfaces:
    org.eclipse.core.runtime.IExecutableExtension, org.eclipse.core.runtime.IExecutableExtensionFactory

    public abstract class AbstractGuiceAwareExecutableExtensionFactory
    extends Object
    implements org.eclipse.core.runtime.IExecutableExtensionFactory, org.eclipse.core.runtime.IExecutableExtension
    Abstract guice module aware executable extension factory which allows to provide injected instances in Extension Points.

    Example of usage in plugin.xml inside Extension description class attribute:

     class="com._1c.g5.v8.dt.ExamleExecutableExtensionFactory:com._1c.g5.v8.dt.ExamleExtensionParticipant"
     

    Also, factory allows to provide Guice named elements as parameters:

     <class class="com._1c.g5.v8.dt.ExamleExecutableExtensionFactory">
          <parameter name="className" value="com._1c.g5.v8.dt.IExamleInterface"/>
          <parameter name="named" value="ExampleNamed"/>
     </class>
     
    See Also:
    Injector, IExecutableExtensionFactory
    • Constructor Detail

      • AbstractGuiceAwareExecutableExtensionFactory

        public AbstractGuiceAwareExecutableExtensionFactory()
    • Method Detail

      • setInitializationData

        public void setInitializationData​(org.eclipse.core.runtime.IConfigurationElement config,
                                          String propertyName,
                                          Object data)
                                   throws org.eclipse.core.runtime.CoreException
        Specified by:
        setInitializationData in interface org.eclipse.core.runtime.IExecutableExtension
        Throws:
        org.eclipse.core.runtime.CoreException
      • create

        public Object create()
                      throws org.eclipse.core.runtime.CoreException
        Specified by:
        create in interface org.eclipse.core.runtime.IExecutableExtensionFactory
        Throws:
        org.eclipse.core.runtime.CoreException
      • getBundle

        protected abstract org.osgi.framework.Bundle getBundle()
        Returns the bundle to crete extension factory for. Typically, impementation returns parent plug-in instance bundle.
        Returns:
        the bundle to crete extension factory for, cannot be null
      • getInjector

        protected abstract com.google.inject.Injector getInjector()
        Returns the Guice Injector to use to initalize creating classes.
        Returns:
        the Guice Injector to use to initalize creating classes, cannot be null
        See Also:
        Injector