aboutsummaryrefslogtreecommitdiffstats
path: root/jdisc_core_test/test_bundles/cert-s-act/src/main/java/com/yahoo/jdisc/bundle/s/MyBundleActivator.java
blob: a57221690181870feee47249bb2ab5f3aff9987e (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
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.jdisc.bundle.s;

import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;

/**
 * @author Simon Thoresen Hult
 */
public class MyBundleActivator implements BundleActivator {

    @Override
    public void start(BundleContext ctx) throws Exception {
        ServiceReference<?> ref = ctx.getServiceReference(RuntimeException.class);
        if (ref != null) {
            throw (RuntimeException)ctx.getService(ref);
        }
    }

    @Override
    public void stop(BundleContext ctx) throws Exception {
        ServiceReference<?> ref = ctx.getServiceReference(RuntimeException.class);
        if (ref != null) {
            throw (RuntimeException)ctx.getService(ref);
        }
    }
}