Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2008, 2010 VMware Inc. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at Contributors: VMware Inc. - initial contribution /
 package org.eclipse.virgo.kernel.model.internal.configurationadmin;
 import java.util.Map;
 import  org.eclipse.equinox.region.Region;
Implementation of org.eclipse.virgo.kernel.model.Artifact that delegates to a Configuration Admin Configuration

Concurrent Semantics

 final class ConfigurationArtifact extends AbstractArtifact {
     private final Logger logger = LoggerFactory.getLogger(this.getClass());
     static final String TYPE = "configuration";
     private final ConfigurationAdmin configurationAdmin;
     private final String pid;
     public ConfigurationArtifact(@NonNull BundleContext bundleContext, @NonNull ConfigurationAdmin configurationAdmin, @NonNull String pid, @NonNull Region region) {
         this. = configurationAdmin;
         this. = pid;

     public ArtifactState getState() {
         return .;
     public Map<StringStringgetProperties() {
         Map<StringStringproperties = new HashMap<StringString>(super.getProperties());
         try {
             Configuration configuration = this..getConfiguration(this.null);
             String factoryPid = configuration.getFactoryPid();
             if(factoryPid != null){
             	properties.put("Factory Pid"factoryPid);
             String bundleLocation = configuration.getBundleLocation();
             if(bundleLocation != null){
             	properties.put("Bound to Bundle"bundleLocation);
         } catch (IOException _) {
             // Default to superclass behaviour
         } catch (IllegalStateException e){
         	properties.put("ERROR""Configuration has been deleted");
         return properties;

     public boolean refresh() {
         return false;
         // Do nothing for a Configuration

     public void start() {
        // Do nothing for a Configuration

    public void stop() {
        // Do nothing for a Configuration

    public void uninstall() {
        try {
        } catch (IOException e) {
            .error("Unable to delete configuration for '{}'"this.);
            throw new RuntimeException(String.format("Unable to delete configuration for '%s'"this.), e);
New to GrepCode? Check out our FAQ X