aboutsummaryrefslogtreecommitdiffstats
path: root/jdisc_core/src/main/java/com/yahoo/jdisc/application/BundleInstallationException.java
blob: ab75b499e201b2b28ea3500104bef5b8271ac22f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.jdisc.application;

import org.osgi.framework.Bundle;
import org.osgi.framework.BundleException;

import java.util.Collection;
import java.util.List;

/**
 * <p>This exception is thrown by {@link OsgiFramework#installBundle(String)} if installation failed. Because </p>
 *
 * <p>Please see commentary on {@link OsgiFramework#installBundle(String)} and {@link
 * OsgiFramework#startBundles(java.util.List, boolean)} for a description of exception-safety issues to consider when
 * installing bundles that use the {@link OsgiHeader#PREINSTALL_BUNDLE} manifest instruction.</p>
 *
 * @author Simon Thoresen Hult
 */
public final class BundleInstallationException extends BundleException {

    private final List<Bundle> installedBundles;

    public BundleInstallationException(Collection<Bundle> installedBundles, Throwable cause) {
        super(cause.getMessage(), cause);
        this.installedBundles = List.copyOf(installedBundles);
    }

    public List<Bundle> installedBundles() {
        return installedBundles;
    }
}