org.apache.directory.api.util
Class OsgiUtils

java.lang.Object
  extended by org.apache.directory.api.util.OsgiUtils

public class OsgiUtils
extends Object

Utilities for OSGi environments and embedding OSGi containers.

Author:
Apache Directory Project

Constructor Summary
OsgiUtils()
           
 
Method Summary
static Set<String> getAllBundleExports(FileFilter filter, Set<String> pkgs)
          All the packages that are exported from all bundles found on the system classpath.
static String getBundleExports(File bundle)
          Gets the attribute value for the Export-Bundle OSGi Manifest Attribute.
static Set<File> getClasspathCandidates(FileFilter filter)
           
static Set<String> splitIntoPackages(String exports, Set<String> pkgs)
          Splits an Package-Export OSGi Manifest Attribute value into packages while stripping away the key/value properties.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OsgiUtils

public OsgiUtils()
Method Detail

getAllBundleExports

public static Set<String> getAllBundleExports(FileFilter filter,
                                              Set<String> pkgs)
All the packages that are exported from all bundles found on the system classpath. The provided filter if not null is used to prune classpath elements. Any uses terms found are stripped from the bundles.

Returns:
All the exported packages of all bundles on the classpath.

splitIntoPackages

public static Set<String> splitIntoPackages(String exports,
                                            Set<String> pkgs)
Splits an Package-Export OSGi Manifest Attribute value into packages while stripping away the key/value properties.

Parameters:
exports - The Package-Export OSGi Manifest Attribute value.
Returns:
The set of exported packages without properties.

getClasspathCandidates

public static Set<File> getClasspathCandidates(FileFilter filter)

getBundleExports

public static String getBundleExports(File bundle)
Gets the attribute value for the Export-Bundle OSGi Manifest Attribute.

Parameters:
bundle - The absolute path to a file bundle.
Returns:
The value as it appears in the Manifest, as a comma delimited list of packages with possible "uses" phrases appended to each package or null if the attribute does not exist.


Copyright © 2003-2013 The Apache Software Foundation. All Rights Reserved.