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;
Simple org.openengsb.core.api.persistence.ConfigPersistenceBackendService implementation directly using the core org.openengsb.core.api.persistence.PersistenceService. Only disadvantage at the current implementation is that objects have to be stored in simple form.
    private BundleContext bundleContext;
    public void init() {
    public List<ConfigItem<E>> load(Map<StringStringmetadatathrows PersistenceException,
        List<ConfigItem<E>> configItems = new ArrayList<ConfigItem<E>>();
        List<ConfigItem<E>> result = .query(new ConfigItem<E>(metadatanull));
        for (ConfigItem<E> configItem : result) {
        return configItems;
    public void persist(ConfigItem<E> configthrows PersistenceExceptionInvalidConfigurationException {
        List<ConfigItem<E>> alreadyPresent = .query(new ConfigItem<E>(config.getMetaData(), null));
        if (alreadyPresent.isEmpty()) {
        } else {
            .update(alreadyPresent.get(0), config);
    public void remove(Map<StringStringmetadatathrows PersistenceException {
        List<ConfigItem<E>> result =
            .query(new ConfigItem<E>(metadatanull));
    public boolean supports(Class<? extends ConfigItem<?>> configItemType) {
        // as an object persistence this backend supports everything
        return true;
    public void setPersistenceManager(PersistenceManager persistenceManager) {
        this. = persistenceManager;
    public void setBundleContext(BundleContext bundleContext) {
        this. = bundleContext;
New to GrepCode? Check out our FAQ X