Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2011 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 http://www.eclipse.org/legal/epl-v10.html Contributors: VMware Inc. - initial contribution /
package org.eclipse.virgo.nano.serviceability.dump.internal;
import  org.eclipse.equinox.region.RegionDigraph;
RegionDigraphDumpContributor dumps the RegionDigraph to a file.

Concurrent Semantics
Thread safe.

public final class RegionDigraphDumpContributor implements DumpContributor {
    private final BundleContext bundleContext;
    public RegionDigraphDumpContributor(@NonNull BundleContext bundleContext) {
        this. = bundleContext;
    }

    
    @Override
    public void contribute(Dump dumpthrows DumpContributionFailedException {
        File outputFile = dump.createFile("region.digraph");
        ServiceReference<RegionDigraph> serviceReference = this..getServiceReference(RegionDigraph.class);
        RegionDigraph regionDigraph = this..getService(serviceReference);
        try {
            OutputStream output = new FileOutputStream(outputFile);
            try {
                regionDigraph.getRegionDigraphPersistence().save(regionDigraphoutput);
            } finally {
                output.close();
            }
        } catch (Exception e) {
            throw new DumpContributionFailedException("Failed to dump region digraph"e);
        } finally {
            this..ungetService(serviceReference);
        }
    }

    
    @Override
    public String getName() {
        return "region digraph";
    }
New to GrepCode? Check out our FAQ X