本文整理了Java中org.osgi.framework.hooks.service.FindHook
类的一些代码示例,展示了FindHook
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FindHook
类的具体详情如下:
包路径:org.osgi.framework.hooks.service.FindHook
类名称:FindHook
FindHook介绍
[英]OSGi Framework Service Find Hook Service.
Bundles registering this service will be called during framework service find (get service references) operations.
[中]OSGi框架服务查找钩子服务。
在框架服务查找(获取服务引用)操作期间,将调用注册此服务的捆绑包。
代码示例
代码示例来源:origin: org.eclipse.tycho/org.eclipse.osgi
public void call(Object hook, ServiceRegistration> hookRegistration) throws Exception {
if (hook instanceof FindHook) {
((FindHook) hook).find(context, clazz, filterstring, allservices, result);
}
}
代码示例来源:origin: com.github.veithen.cosmos/cosmos-equinox
public void call(Object hook, ServiceRegistration> hookRegistration) throws Exception {
if (hook instanceof FindHook) {
((FindHook) hook).find(context, clazz, filterstring, allservices, result);
}
}
代码示例来源:origin: org.eclipse/osgi
public void call(Object hook, ServiceRegistration> hookRegistration) throws Exception {
if (hook instanceof FindHook) {
((FindHook) hook).find(context, clazz, filterstring, allservices, result);
}
}
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.osgi
public void call(Object hook, ServiceRegistration> hookRegistration) throws Exception {
if (hook instanceof FindHook) {
((FindHook) hook).find(context, clazz, filterstring, allservices, result);
}
}
代码示例来源:origin: org.eclipse/org.eclipse.osgi
public void call(Object hook, ServiceRegistration> hookRegistration) throws Exception {
if (hook instanceof FindHook) {
((FindHook) hook).find(context, clazz, filterstring, allservices, result);
}
}
代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.osgi
public void call(Object hook, ServiceRegistration> hookRegistration) throws Exception {
if (hook instanceof FindHook) {
((FindHook) hook).find(context, clazz, filterstring, allservices, result);
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.osgi
public void call(Object hook, ServiceRegistration> hookRegistration) throws Exception {
if (hook instanceof FindHook) {
((FindHook) hook).find(context, clazz, filterstring, allservices, result);
}
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.osgi
public void call(Object hook, ServiceRegistration> hookRegistration) throws Exception {
if (hook instanceof FindHook) {
((FindHook) hook).find(context, clazz, filterstring, allservices, result);
}
}
代码示例来源:origin: apache/felix
public void invokeServiceFindHook(
org.osgi.framework.hooks.service.FindHook fh,
BundleContext context, String name, String filter,
boolean allServices, Collection> references)
throws Exception
{
if (System.getSecurityManager() != null)
{
Actions actiOns= (Actions) m_actions.get();
actions.set(
Actions.INVOKE_SERVICE_FIND_HOOK, fh, context, name, filter,
(allServices) ? Boolean.TRUE : Boolean.FALSE, references);
try
{
AccessController.doPrivileged(actions, m_acc);
}
catch (PrivilegedActionException e)
{
throw e.getException();
}
}
else
{
fh.find(context, name, filter, allServices, references);
}
}
代码示例来源:origin: org.apache.servicemix.kernel/org.apache.servicemix.kernel.main
for (int i = 0; i ((FindHook) findHooks.get(i)).find(
bundle.getBundleContext(),
className,
代码示例来源:origin: apache/felix
return null;
case INVOKE_SERVICE_FIND_HOOK:
((org.osgi.framework.hooks.service.FindHook) arg1).find(
(BundleContext) arg2, (String) arg3, (String) arg4,
((Boolean) arg5).booleanValue(),
代码示例来源:origin: apache/felix
fh.find(this,
className,
expr,
代码示例来源:origin: org.apache.felix/org.apache.felix.connect
fh.find(this,
className,
expr,
代码示例来源:origin: org.knopflerfish/framework
/**
*
*/
void filterServiceReferences(BundleContextImpl bc,
String service,
String filter,
boolean allServices,
Collection> refs)
{
@SuppressWarnings({ "unchecked", "rawtypes" })
final List> srl
= (List) fwCtx.services.get(FindHook.class.getName());
if (srl != null) {
final RemoveOnlyCollection> filtered
= new RemoveOnlyCollection>(refs);
for (final ServiceRegistrationImpl fhr : srl) {
final ServiceReferenceImpl sr = fhr.reference;
final FindHook fh = sr.getService(fwCtx.systemBundle);
if (fh != null) {
try {
fh.find(bc, service, filter, allServices, filtered);
} catch (final Exception e) {
fwCtx.frameworkError(bc,
new BundleException("Failed to call find hook #" +
sr.getProperty(Constants.SERVICE_ID), e));
}
}
}
}
}