Java 类org.osgi.framework.hooks.service.EventListenerHook 实例源码

项目:aspecio    文件:AspecioActivator.java   
@Override
public void start(BundleContext context) {
    aspecio = new AspecioImpl(context);
    aspecio.activate();

    boolean filterServices = shouldFilterServices(context);

    if (filterServices) {
        context.registerService(new String[] { Aspecio.class.getName(), FindHook.class.getName(), EventListenerHook.class.getName() },
                aspecio, null);
    } else {
        context.registerService(Aspecio.class, aspecio, null);
    }
    Hashtable<String, Object> props = new Hashtable<>();
    props.put("osgi.command.scope", AspecioGogoCommand.ASPECIO_GOGO_COMMAND_SCOPE);
    props.put("osgi.command.function", AspecioGogoCommand.ASPECIO_GOGO_COMMANDS);

    AspecioGogoCommand gogoCommand = new AspecioGogoCommand(context, aspecio);
    context.registerService(Object.class, gogoCommand, props);
}
项目:openeos    文件:ServiceHideManager.java   
private void registerHideHook() {
    if (reg == null) {
        reg = context.registerService(new String[] { FindHook.class.getName(), EventListenerHook.class.getName() }, this, null);
    }
}