|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.embl.ebi.escience.scufl.Processor
org.embl.ebi.escience.scuflworkers.dependency.DependencyProcessor
public abstract class DependencyProcessor
A processor that needs dependency management. Typical subclasses are
org.embl.ebi.escience.scuflworkers.apiconsumer.BeanshellProcessor and
org.embl.ebi.escience.scuflworkers.beanshell.APIConsumerProcessor.
This abstract Processor defines dependencies on local JAR files or Raven
artefacts.
| Nested Class Summary | |
|---|---|
static class |
DependencyProcessor.ClassLoaderSharing
Different ways to share class loader. |
| Field Summary | |
|---|---|
java.util.LinkedHashSet<BasicArtifact> |
artifactDependencies
Artifact dependencies. |
java.util.LinkedHashSet<java.lang.String> |
localDependencies
Local dependencies, ie. |
java.util.LinkedHashSet<java.net.URL> |
repositories
Repositories to use when searching for artifacts. |
| Fields inherited from interface org.embl.ebi.escience.scufl.IProcessor |
|---|
ENACTOR |
| Constructor Summary | |
|---|---|
DependencyProcessor(ScuflModel model,
java.lang.String name)
|
|
| Method Summary | |
|---|---|
java.lang.ClassLoader |
findClassLoader()
Find and possibly build the classloader. |
DependencyProcessor.ClassLoaderSharing |
getClassLoaderSharing()
Return the current classloader sharing policy as used by findClassLoader(). |
void |
setClassLoaderSharing(DependencyProcessor.ClassLoaderSharing sharing)
Set the classloader sharing to the given policy. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public final java.util.LinkedHashSet<java.lang.String> localDependencies
libDir, and the paths should be relative.
public final java.util.LinkedHashSet<BasicArtifact> artifactDependencies
public final java.util.LinkedHashSet<java.net.URL> repositories
| Constructor Detail |
|---|
public DependencyProcessor(ScuflModel model,
java.lang.String name)
throws ProcessorCreationException,
DuplicateProcessorNameException
ProcessorCreationException
DuplicateProcessorNameException| Method Detail |
|---|
public java.lang.ClassLoader findClassLoader()
setClassLoaderSharing(org.embl.ebi.escience.scuflworkers.dependency.DependencyProcessor.ClassLoaderSharing),
and local dependencies as listed in localDependencies.
If the classloader sharing is DependencyProcessor.ClassLoaderSharing.fresh, a new
classloader solely depending on the current localDependencies is
returned. This policy would in effect reload classes for each iteration,
so they would always be "fresh".
If the classloader sharing is DependencyProcessor.ClassLoaderSharing.iteration, the
classloader will be built as for DependencyProcessor.ClassLoaderSharing.fresh, but
only once per DependencyProcessor instance. In reality this would
for Taverna mean once per processor per workflow run, as processors are
built from scratch on execution. This policy would avoid reloading
classes for each iteration, but each processor instance would still have
different classloaders.
If the classloader sharing is DependencyProcessor.ClassLoaderSharing.workflow, a
common classloader will be used for the whole workflow for all processors
with the same policy. The dependencies will be constructed as the union
of all localDependencies sets at the point of the first call to
findClassLoader().
All of these classloaders will have as a parent the loader of this
instance (ie. the loader of the deepest subclass of
DependencyProcessor).
However, if the classloader sharing is DependencyProcessor.ClassLoaderSharing.system, the
system classloader will be used. Note that dependencies are ignored and
must be specified by -classpath when starting the Java.
This is useful in combination with JNI based libraries, which would also
require -Djava.library.path and possibly the operating
system's PATH / LD_LIBRARY_PATH / DYLD_LIBRARY_PATH environment variable.
ClassLoader according to the
classloader sharing policypublic void setClassLoaderSharing(DependencyProcessor.ClassLoaderSharing sharing)
findClassLoader() determines, builds and/or reuses classloaders.
By default, the classloader sharing is set to
DependencyProcessor.ClassLoaderSharing.iteration.
sharing - DependencyProcessor.ClassLoaderSharing,
findClassLoader()public DependencyProcessor.ClassLoaderSharing getClassLoaderSharing()
findClassLoader().
DependencyProcessor.ClassLoaderSharing policy.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||