blob: 03b45bfc602a0a5f3333d80f186ee2147999383e (
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 Vespa.ai. 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);
}
}
}
|