Search in sources :

Example 1 with PersistenceManagerTracker

use of org.apache.felix.cm.impl.persistence.PersistenceManagerTracker in project felix by apache.

the class Activator method start.

@Override
public void start(final BundleContext bundleContext) throws BundleException {
    // setup log
    Log.logger.start(bundleContext);
    // register default file persistence manager
    final PersistenceManager defaultPM = this.registerFilePersistenceManager(bundleContext);
    if (defaultPM == null) {
        throw new BundleException("Unable to register default persistence manager.");
    }
    String configuredPM = bundleContext.getProperty(CM_CONFIG_PM);
    if (configuredPM != null && configuredPM.isEmpty()) {
        configuredPM = null;
    }
    try {
        this.tracker = new PersistenceManagerTracker(bundleContext, defaultPM, configuredPM);
    } catch (InvalidSyntaxException iae) {
        Log.logger.log(LogService.LOG_ERROR, "Cannot create the persistence manager tracker", iae);
        throw new BundleException(iae.getMessage(), iae);
    }
}
Also used : PersistenceManagerTracker(org.apache.felix.cm.impl.persistence.PersistenceManagerTracker) PersistenceManager(org.apache.felix.cm.PersistenceManager) FilePersistenceManager(org.apache.felix.cm.file.FilePersistenceManager) InvalidSyntaxException(org.osgi.framework.InvalidSyntaxException) BundleException(org.osgi.framework.BundleException)

Aggregations

PersistenceManager (org.apache.felix.cm.PersistenceManager)1 FilePersistenceManager (org.apache.felix.cm.file.FilePersistenceManager)1 PersistenceManagerTracker (org.apache.felix.cm.impl.persistence.PersistenceManagerTracker)1 BundleException (org.osgi.framework.BundleException)1 InvalidSyntaxException (org.osgi.framework.InvalidSyntaxException)1