Class WorkspaceExternalPluginHandler

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class WorkspaceExternalPluginHandler
    extends java.lang.Object
    implements java.lang.AutoCloseable
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) static java.lang.reflect.Method close  
      (package private) java.util.Map<org.osgi.resource.Capability,​Processor.CL> loaders  
      (package private) static org.slf4j.Logger logger  
      (package private) Workspace workspace  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <T,​R>
      Result<R>
      call​(java.lang.String pluginName, java.lang.Class<T> c, FunctionWithException<T,​Result<R>> f)  
      Result<java.lang.Integer> call​(java.lang.String mainClass, org.osgi.framework.VersionRange range, Processor context, java.util.Map<java.lang.String,​java.lang.String> attrs, java.util.List<java.lang.String> args, java.io.InputStream stdin, java.io.OutputStream stdout, java.io.OutputStream stderr)  
      void close()  
      <T> Result<java.util.List<T>> getImplementations​(java.lang.Class<T> interf, Attrs attrs)
      Returns list of external plugin proxies that implement the given interface.
      private Result<Processor.CL> getLoader​(org.osgi.resource.Capability cap)  
      private static java.lang.reflect.Method getMethod​(java.lang.Class<?> class1, java.lang.String name, java.lang.Class<?>... args)  
      private ProgressPlugin.Task getTask​(Command c)  
      private Result<java.lang.Object> load​(org.osgi.resource.Capability cap, Attrs attrs)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • logger

        static final org.slf4j.Logger logger
      • close

        static final java.lang.reflect.Method close
      • loaders

        final java.util.Map<org.osgi.resource.Capability,​Processor.CL> loaders
    • Constructor Detail

      • WorkspaceExternalPluginHandler

        WorkspaceExternalPluginHandler​(Workspace workspace)
    • Method Detail

      • call

        public Result<java.lang.Integer> call​(java.lang.String mainClass,
                                              org.osgi.framework.VersionRange range,
                                              Processor context,
                                              java.util.Map<java.lang.String,​java.lang.String> attrs,
                                              java.util.List<java.lang.String> args,
                                              java.io.InputStream stdin,
                                              java.io.OutputStream stdout,
                                              java.io.OutputStream stderr)
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
      • getImplementations

        public <T> Result<java.util.List<T>> getImplementations​(java.lang.Class<T> interf,
                                                                Attrs attrs)
        Returns list of external plugin proxies that implement the given interface. The proxies will load the actual plugin on demand when used. That is, the plugins will be quite cheap unless used.
        Parameters:
        interf - the interface listed in `-plugin`.
        attrs - the attributes from the that interface, the name specifies the name of the plugin, wildcards allowed
        Returns:
        a list of plugins loaded from the external plugin set
      • load

        private Result<java.lang.Object> load​(org.osgi.resource.Capability cap,
                                              Attrs attrs)
      • getLoader

        private Result<Processor.CL> getLoader​(org.osgi.resource.Capability cap)
      • getMethod

        private static java.lang.reflect.Method getMethod​(java.lang.Class<?> class1,
                                                          java.lang.String name,
                                                          java.lang.Class<?>... args)