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  org.eclipse.equinox.region.Region;
Implementation of ConfigurationListener that notices CM_UPDATED and CM_DELETED events to add and remove respectively org.eclipse.virgo.kernel.model.Artifacts from the org.eclipse.virgo.kernel.model.RuntimeArtifactRepository

Concurrent Semantics

final class ModelConfigurationListener implements ConfigurationListener {
    private final Logger logger = LoggerFactory.getLogger(this.getClass());
    private final BundleContext bundleContext;
    private final ConfigurationAdmin configurationAdmin;
    private final Region independentRegion;
    public ModelConfigurationListener(@NonNull RuntimeArtifactRepository artifactRepository, @NonNull BundleContext bundleContext, @NonNull ConfigurationAdmin configurationAdmin, @NonNull Region independentRegion) {
        this. = artifactRepository;
        this. = bundleContext;
        this. = configurationAdmin;
        this. = independentRegion;

    public void configurationEvent(ConfigurationEvent event) {
        if (ConfigurationEvent.CM_UPDATED == event.getType()) {
        } else if (ConfigurationEvent.CM_DELETED == event.getType()) {
    private void processUpdate(ConfigurationEvent event) {
        .info("Processing update event for '{}'"event.getPid());
    private void processDelete(ConfigurationEvent event) {
        .info("Processing delete event for '{}'"event.getPid());
        if (artifact instanceof ConfigurationArtifact) {
            this..remove(.event.getPid(), .);
    private ConfigurationArtifact createArtifact(ConfigurationEvent event) {
        return new ConfigurationArtifact(this.this.event.getPid(), );
New to GrepCode? Check out our FAQ X