Class AbstractLoader
java.lang.Object
de.uni_hildesheim.sse.easy.loader.AbstractLoader
Provides common functionality for an EASy loader.
- Author:
- Holger Eichelberger
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static booleanReturns whether the given bundle is already known to the class loader.private static booleanReturns whether the given (JAR) file is already known to the class loader.private static booleanalreadyKnownToClassLoader(String sampleClass) Returns whether the given (sample) class is already known to the class loader.protected voidBootstraps EASy using the default bootstrap method.private voidcollectBootstrapData(BundleInfo info, List<URL> urls, List<BundleInfo> instantiate, Object tag) Collect the bootstrap data forinfo.protected voidcollectBootstrapData(BundleInfo info, List<URL> urls, List<BundleInfo> instantiate, Set<BundleInfo> done, Object tag) Collect the bootstrap data.private static booleanconsiderForBootstrap(BundleInfo info, Object tag) Returns whether the given bundle shall be considered for the bootstrap process.protected voidGeneric bootstrapping from eclipse.protected FilegetBase()Returns the base folder.protected static List<BundleInfo> Returns possible UI bundles.private voidhandleBundleClasspath(BundleInfo info, List<URL> urls) Handles the classpath of the given bundle.protected static voidInitializes theBundleRegistry.protected booleanirrelevantInJar(String name) Returns whether the name of a certain JAR entry is irrelevant for a standalone execution.protected voidnotifyMapping(URL url, BundleInfo info) Is called bycollectBootstrapData(BundleInfo, List, List, Object)to notify about mapping a URL to the given bundleinfo.protected voidprintDependencies(BundleInfo info, String indent) Recursively prints the dependencies ofinfo.protected voidsimpleBootstrap(File easyPlugins, File eclipsePlugins) Does bootstrapping having bundles in local folders.
-
Field Details
-
TAG_EASY
- See Also:
-
EASY_EXCLUSION_PATTERN
- See Also:
-
EASY_INCLUSION_PATTERN
- See Also:
-
base
-
-
Constructor Details
-
AbstractLoader
Creates a new abstract loader.- Parameters:
base- the base folder where the plugins are located in
-
-
Method Details
-
initializeRegistry
protected static void initializeRegistry()Initializes theBundleRegistry. -
bootstrap
Bootstraps EASy using the default bootstrap method.- Parameters:
baseDir- the BaseDir for the bootstrap.easyPlugins- File of the easy plugins. If null, the base/plugins/ folder will be used.eclipsePlugins- File of the eclipse Plugins. If null, the base/plugins/eclipse folder will be used.
-
simpleBootstrap
Does bootstrapping having bundles in local folders.- Parameters:
easyPlugins- File of the easy plugins. If null, the base/plugins/ folder will be used.eclipsePlugins- File of the eclipse Plugins. If null, the base/plugins/eclipse folder will be used.
-
genericBootstrap
protected void genericBootstrap()Generic bootstrapping from eclipse. -
printDependencies
Recursively prints the dependencies ofinfo.- Parameters:
info- the object to print the dependencies forindent- the current indentation
-
getUiBundles
Returns possible UI bundles.- Returns:
- the possible ui bundles (may be empty)
-
collectBootstrapData
protected void collectBootstrapData(BundleInfo info, List<URL> urls, List<BundleInfo> instantiate, Set<BundleInfo> done, Object tag) Collect the bootstrap data.- Parameters:
info- the bundle information object to considerurls- the jar files to load (modified as a side effect)instantiate- the bundles to instantiate, either via activator or DS (modified as a side effect)done- the already considered bundles (modified as a side effect)tag- an optional bundle tag for filtering relevant bundles (may be null)
-
collectBootstrapData
private void collectBootstrapData(BundleInfo info, List<URL> urls, List<BundleInfo> instantiate, Object tag) Collect the bootstrap data forinfo. This method is called bycollectBootstrapData(BundleInfo, List, List, Set, Object).- Parameters:
info- the bundle information object to considerurls- the jar files to load (modified as a side effect)instantiate- the bundles to instantiate, either via activator or DS (modified as a side effect)tag- an optional bundle tag for filtering relevant bundles (may be null)
-
notifyMapping
Is called bycollectBootstrapData(BundleInfo, List, List, Object)to notify about mapping a URL to the given bundleinfo.- Parameters:
url- the URL of the bundle JARinfo- the related bundle information object
-
alreadyKnownToClassLoader
Returns whether the given bundle is already known to the class loader. This method relies onBundleInfo.getSampleClass().- Parameters:
info- the info to be tested- Returns:
trueif the bundle is already known,falseelse
-
alreadyKnownToClassLoader
Returns whether the given (sample) class is already known to the class loader.- Parameters:
sampleClass- the sample class to be tested- Returns:
trueif the bundle is already known,falseelse
-
alreadyKnownToClassLoader
Returns whether the given (JAR) file is already known to the class loader.- Parameters:
file- the JAR file to be tested- Returns:
trueif the bundle is already known,falseelse
-
handleBundleClasspath
Handles the classpath of the given bundle.- Parameters:
info- the bundle information objecturls- the URLs (to be modified as a side effect)- Throws:
MalformedURLException- in case that the URL cannot be created
-
considerForBootstrap
Returns whether the given bundle shall be considered for the bootstrap process.- Parameters:
info- the bundle information objecttag- the optional tag (may be null)- Returns:
trueifinfoshall be considered,falseelse
-
irrelevantInJar
Returns whether the name of a certain JAR entry is irrelevant for a standalone execution.- Parameters:
name- the name- Returns:
trueif the name (and potential overlapping names) is irrelevant,falseif relevant
-
getBase
Returns the base folder.- Returns:
- the base folder
-