本文整理汇总了Java中org.osgi.framework.hooks.service.FindHook类的典型用法代码示例。如果您正苦于以下问题:Java FindHook类的具体用法?Java FindHook怎么用?Java FindHook使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FindHook类属于org.osgi.framework.hooks.service包,在下文中一共展示了FindHook类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: start
import org.osgi.framework.hooks.service.FindHook; //导入依赖的package包/类
@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);
}
开发者ID:primeval-io,项目名称:aspecio,代码行数:21,代码来源:AspecioActivator.java
示例2: bindRegistry
import org.osgi.framework.hooks.service.FindHook; //导入依赖的package包/类
private synchronized void bindRegistry(Registry registry,
String[] intents, String[] configs) {
RegistryWatcher watcher = new RegistryWatcher(ctx, registry);
watchers.put(registry, watcher);
ServiceRegistration[] regs = new ServiceRegistration[2];
ExportedServiceTracker export = new ExportedServiceTracker(ctx,
registry, intents, configs);
export.open();
trackers.put(registry, export);
ImportedServiceFindHook find = new ImportedServiceFindHook(watcher);
regs[0] = ctx.registerService(FindHook.class.getName(), find, null);
ImportedServiceListenerHook listener = new ImportedServiceListenerHook(
watcher);
regs[1] = ctx.registerService(ListenerHook.class.getName(), listener,
null);
serviceRegs.put(registry, regs);
}
开发者ID:mcculls,项目名称:osgi-in-action,代码行数:24,代码来源:Activator.java
示例3: testActivator
import org.osgi.framework.hooks.service.FindHook; //导入依赖的package包/类
public void testActivator() throws Exception {
ServiceRegistration sreg = mock(ServiceRegistration.class);
BundleContext bc = mock(BundleContext.class);
when(bc.registerService(anyString(), anyObject(), any(Dictionary.class))).thenReturn(sreg);
Activator a = new Activator();
a.start(bc);
verify(bc).registerService(eq(EventHook.class.getName()), isA(HidingEventHook.class), any(Dictionary.class));
verify(bc).registerService(eq(FindHook.class.getName()), isA(HidingFindHook.class), any(Dictionary.class));
verify(bc).addServiceListener(isA(ServiceJockeyListener.class));
verify(bc, never()).removeServiceListener((ServiceListener) anyObject());
verify(sreg, never()).unregister();
a.stop(bc);
verify(bc).removeServiceListener(isA(ServiceJockeyListener.class));
verify(sreg, times(2)).unregister();
}
开发者ID:bosschaert,项目名称:service-jockey,代码行数:19,代码来源:ActivatorTest.java
示例4: start
import org.osgi.framework.hooks.service.FindHook; //导入依赖的package包/类
public void start(BundleContext context) throws Exception {
ServiceHandlerCatalog shc = new ServiceHandlerCatalog();
EventHook eh = new HidingEventHook(context, shc);
ereg = context.registerService(EventHook.class.getName(), eh, new Hashtable<String, Object>());
FindHook fh = new HidingFindHook(context, shc);
freg = context.registerService(FindHook.class.getName(), fh, new Hashtable<String, Object>());
listener = new ServiceJockeyListener(context, shc);
context.addServiceListener(listener);
}
开发者ID:bosschaert,项目名称:service-jockey,代码行数:13,代码来源:Activator.java
示例5: start
import org.osgi.framework.hooks.service.FindHook; //导入依赖的package包/类
public void start() {
bctx.registerService(RemoteServiceAdminListener.class, this, null);
bctx.registerService(ListenerHook.class, listenerHook, null);
bctx.registerService(FindHook.class, findHook, null);
endpointListenerManager.start();
}
开发者ID:apache,项目名称:aries-rsa,代码行数:7,代码来源:TopologyManagerImport.java
示例6: registerHideHook
import org.osgi.framework.hooks.service.FindHook; //导入依赖的package包/类
private void registerHideHook() {
if (reg == null) {
reg = context.registerService(new String[] { FindHook.class.getName(), EventListenerHook.class.getName() }, this, null);
}
}
开发者ID:frincon,项目名称:openeos,代码行数:6,代码来源:ServiceHideManager.java
注:本文中的org.osgi.framework.hooks.service.FindHook类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论