Activator.java
1.47 KB
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
32
33
34
35
36
37
38
39
40
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* org.osgi.framework.BundleActivator
* org.osgi.framework.BundleContext
* org.osgi.framework.ServiceRegistration
* org.osgi.framework.hooks.resolver.ResolverHookFactory
* org.osgi.service.cm.ManagedService
*/
package com.adobe.granite.apicontroller;
import com.adobe.granite.apicontroller.FilterResolverHookFactory;
import java.util.Dictionary;
import java.util.Hashtable;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;
import org.osgi.framework.hooks.resolver.ResolverHookFactory;
import org.osgi.service.cm.ManagedService;
public class Activator
implements BundleActivator {
private ServiceRegistration<?> reg;
private FilterResolverHookFactory hookFactory;
public void start(BundleContext context) throws Exception {
this.hookFactory = new FilterResolverHookFactory();
Hashtable<String, String> props = new Hashtable<String, String>();
props.put("service.pid", FilterResolverHookFactory.class.getName());
this.reg = context.registerService(new String[]{ManagedService.class.getName(), ResolverHookFactory.class.getName()}, (Object)this.hookFactory, props);
this.hookFactory.setServiceRegistration(this.reg);
}
public void stop(BundleContext context) throws Exception {
this.hookFactory.setServiceRegistration(null);
this.reg.unregister();
}
}