blob: 0d350ab98413427351d6cd762976389cbef59ca9 (
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 2017 Yahoo Holdings. 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 <a href="mailto:simon@yahoo-inc.com">Simon Thoresen</a>
*/
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);
}
}
}
|