Package aQute.bnd.build
Class WorkspaceExternalPluginHandler
- java.lang.Object
-
- aQute.bnd.build.WorkspaceExternalPluginHandler
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class WorkspaceExternalPluginHandler extends java.lang.Object implements java.lang.AutoCloseable
-
-
Constructor Summary
Constructors Constructor Description WorkspaceExternalPluginHandler(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)
-
-
-
Field Detail
-
logger
static final org.slf4j.Logger logger
-
close
static final java.lang.reflect.Method close
-
workspace
final Workspace workspace
-
loaders
final java.util.Map<org.osgi.resource.Capability,Processor.CL> loaders
-
-
Constructor Detail
-
WorkspaceExternalPluginHandler
WorkspaceExternalPluginHandler(Workspace workspace)
-
-
Method Detail
-
call
public <T,R> Result<R> call(java.lang.String pluginName, java.lang.Class<T> c, FunctionWithException<T,Result<R>> f)
-
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)
-
getTask
private ProgressPlugin.Task getTask(Command c)
-
close
public void close()
- Specified by:
close
in interfacejava.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
-
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)
-
-