Package org.nuxeo.osgi.application
Class ClassPath
- java.lang.Object
-
- org.nuxeo.osgi.application.ClassPath
-
- All Implemented Interfaces:
ClassPathScanner.Callback
public class ClassPath extends Object implements ClassPathScanner.Callback
- Author:
- Bogdan Stefanescu
-
-
Field Summary
Fields Modifier and Type Field Description protected List<BundleFile>
bundles
protected List<BundleFile>
jars
protected SharedClassLoader
loader
protected List<BundleFile>
nestedJars
protected File
nestedJARsDir
-
Constructor Summary
Constructors Constructor Description ClassPath(SharedClassLoader loader, File nestedJARsDir)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<BundleFile>
getBundles()
List<BundleFile>
getJars()
List<BundleFile>
getNestedJars()
File
handleBundle(BundleFile bf)
A Bundle was found on the class path.File
handleJar(BundleFile bf)
A JAR was found on the class path.void
handleNestedJar(BundleFile bf)
A nested JAR was found on the class path.void
restore(File file)
void
scan(List<File> files, boolean scanForNestedJARs, String[] blacklist)
void
store(File file)
-
-
-
Field Detail
-
bundles
protected final List<BundleFile> bundles
-
jars
protected final List<BundleFile> jars
-
nestedJars
protected final List<BundleFile> nestedJars
-
loader
protected final SharedClassLoader loader
-
nestedJARsDir
protected final File nestedJARsDir
-
-
Constructor Detail
-
ClassPath
public ClassPath(SharedClassLoader loader, File nestedJARsDir)
-
-
Method Detail
-
getBundles
public List<BundleFile> getBundles()
-
getJars
public List<BundleFile> getJars()
-
getNestedJars
public List<BundleFile> getNestedJars()
-
handleBundle
public File handleBundle(BundleFile bf)
Description copied from interface:ClassPathScanner.Callback
A Bundle was found on the class path. Usually a callback should handle this by adding the Bundle to a class loader and installing it in an OSGi frameworkThe callback should return a directory to be used to extract nested JARs from this JAR.
The callback may return null to skip nested JAR extraction.
- Specified by:
handleBundle
in interfaceClassPathScanner.Callback
- Parameters:
bf
- the JAR found- Returns:
- the folder to be used to extract JARs or null to skip extraction
-
handleJar
public File handleJar(BundleFile bf)
Description copied from interface:ClassPathScanner.Callback
A JAR was found on the class path. Usually a callback should handle this by adding the JAR to a class loader.The callback should return a directory to be used to extract nested JARs from this JAR.
The callback may return null to skip nested JAR extraction.
- Specified by:
handleJar
in interfaceClassPathScanner.Callback
- Parameters:
bf
- the JAR found- Returns:
- the folder to be used to extract JARs or null to skip extraction
-
handleNestedJar
public void handleNestedJar(BundleFile bf)
Description copied from interface:ClassPathScanner.Callback
A nested JAR was found on the class path. Usually a callback should handle this by adding the JAR to a class loaderThe callback should return a directory to be used to extract nested JARs from this JAR.
The callback may return null to skip nested JAR extraction
- Specified by:
handleNestedJar
in interfaceClassPathScanner.Callback
- Parameters:
bf
- the JAR found
-
store
public void store(File file) throws IOException
- Throws:
IOException
-
restore
public void restore(File file) throws IOException
- Throws:
IOException
-
-