Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Licensed to the Austrian Association for Software Tool Integration (AASTI) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The AASTI licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 package org.openengsb.core.persistence.internal;
Service factory managed by Configuration and Fileinstall OSGi services in play.
     private BundleContext bundleContext;
     private OsgiUtilsService serviceUtils;
         new HashMap<StringServiceRegistration>();
     public String getName() {
         return "Configuration Persistence Service Factory";
     @SuppressWarnings({ "rawtypes" })
     public synchronized void updated(String pidDictionary propertiesthrows ConfigurationException {
     @SuppressWarnings({ "rawtypes""unchecked" })
     private void setupConfigPersistenceService(String pidDictionary propertiesthrows ConfigurationException {
         ConfigPersistenceBackendService backendService = retrieveBackendService(properties);
         DefaultConfigPersistenceService configPersistenceService = new DefaultConfigPersistenceService(backendService);
         Dictionary exportProperties = new Hashtable();
         ServiceRegistration registration =
             .registerService(ConfigPersistenceService.class.getName(), configPersistenceService,
         throws ConfigurationException {
         try {
             Filter serviceProxyFilter = .makeFilter(ConfigPersistenceBackendService.class,
             return .getOsgiServiceProxy(serviceProxyFilterConfigPersistenceBackendService.class);
         } catch (OsgiServiceNotAvailableException e) {
             throw new ConfigurationException(., String.format(
                 "backend service %s could not be found; please recheck documentation",
                 properties.get(.)), e);
     private void preconditionPropertyExists(String keyDictionary propertiesthrows ConfigurationException {
         if (properties.get(key) == null) {
             throw new ConfigurationException(key,
                 String.format("Property %s is required to configure a ConfigPersistenceService correctly"key));
     public synchronized void deleted(String pid) {
         if (!.containsKey(pid)) {
    public void setBundleContext(BundleContext bundleContext) {
        this. = bundleContext;
        DefaultOsgiUtilsService defaultOsgiUtilsService = new DefaultOsgiUtilsService();
         = defaultOsgiUtilsService;
New to GrepCode? Check out our FAQ X