我可以从osgi控制台获得有关捆绑服务的哪些信息?

时间:2014-07-22 09:13:50

标签: java events service osgi cq5

我有osgi bundle(第三方):

此捆绑包有服务:

如果我点击此服务(http://localhost:4502/system/console/bundles - >选择包 - >点击该服务)我会看到以下信息:

[org.osgi.service.event.EventHandler, com.adobe.granite.xss.XSSFilter]
    component.id    98
    component.name  com.adobe.granite.xss.impl.XSSFilterImpl
    event.topics    org/apache/sling/api/resource/Resource/*
    org/apache/sling/api/resource/ResourceProvider/*
    Service PID com.adobe.granite.xss.impl.XSSFilterImpl
    Service Vendor  Adobe Systems Incorporated
    Using Bundles   com.adobe.granite.security.user (73)
    com.day.cq.cq-xssprotection (75)
    org.apache.felix.eventadmin (38)

我在这里看到了eventHandler,我想知道这个服务调用时的事件。

我想知道此代码执行此时(事件发生后)?

1 个答案:

答案 0 :(得分:2)

event.topics服务属性是OSGi EventHandler services的标准属性,在这里它告诉您这个属性正在侦听以下OSGi事件主题:

  • org/apache/sling/api/resource/Resource/*
  • org/apache/sling/api/resource/ResourceProvider/*

如果您想知道何时发生此类事件,您可以使用相同的主题注册您自己的EventHandler,并在发生这些事件时记录消息 - 除非您的系统已在DEBUG或其他日志中提供该信息。

要找出XSSFilterImpl执行的代码,你需要调试它,正如Balazs Zsoldos指出的那样。

相关问题