org.ops4j.pax.scanner.internal
Class ProvisionServiceImpl

java.lang.Object
  extended by org.ops4j.pax.scanner.internal.ProvisionServiceImpl
All Implemented Interfaces:
ProvisionService

public class ProvisionServiceImpl
extends java.lang.Object
implements ProvisionService

Implementation of Provision Service.

Since:
August 17, 2007
Author:
Alin Dreghiciu
See Also:
ProvisionService

Constructor Summary
ProvisionServiceImpl(org.osgi.framework.BundleContext bundleContext)
          Creates a new provision service implementation.
 
Method Summary
 void addScanner(Scanner scanner, java.lang.String scheme)
          Adds a new scanner.
 void removeScanner(Scanner scanner)
          Removes a scanner.
 java.util.List<ScannedBundle> scan(java.lang.String spec)
          Parses the spec and based on the provision scheme from the spec delegates to the right provisioning scheme.
The spec has the syntax:
scheme:scheme_specific_path
where:
* scheme is the scheme to be used
* scheme_specific_path is a scheme specific string
 void setStartLevelService(org.osgi.service.startlevel.StartLevel startLevelService)
          Sets the start level service.
 InstallableBundles wrap(java.util.List<ScannedBundle> scannedBundles)
          Wraps a list of scanned bundles as installables.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProvisionServiceImpl

public ProvisionServiceImpl(org.osgi.framework.BundleContext bundleContext)
Creates a new provision service implementation.

Parameters:
bundleContext - a bundle context
Method Detail

scan

public java.util.List<ScannedBundle> scan(java.lang.String spec)
                                   throws MalformedSpecificationException,
                                          ScannerException
Description copied from interface: ProvisionService
Parses the spec and based on the provision scheme from the spec delegates to the right provisioning scheme.
The spec has the syntax:
scheme:scheme_specific_path
where:
* scheme is the scheme to be used
* scheme_specific_path is a scheme specific string

Specified by:
scan in interface ProvisionService
Parameters:
spec - the provisioning spec
Returns:
a list of bundle refrences
Throws:
MalformedSpecificationException - if the scheme is not available or the string could not be parsed
ScannerException - if a scanning process related exception occured
See Also:
ProvisionService.scan(String)

wrap

public InstallableBundles wrap(java.util.List<ScannedBundle> scannedBundles)
Wraps a list of scanned bundles as installables. The methods could be overrided by subclasses.

Specified by:
wrap in interface ProvisionService
Parameters:
scannedBundles - scanned bundles to be wrapped
Returns:
a set of installables

addScanner

public void addScanner(Scanner scanner,
                       java.lang.String scheme)
Adds a new scanner.

Parameters:
scheme - the scheme the scanner handles
scanner - the scanner

removeScanner

public void removeScanner(Scanner scanner)
Removes a scanner.

Parameters:
scanner - the scanner

setStartLevelService

public void setStartLevelService(org.osgi.service.startlevel.StartLevel startLevelService)
Sets the start level service.

Parameters:
startLevelService - a start level service


Copyright © 2006-2011 OPS4J - Open Participation Software for Java. All Rights Reserved.