如何在 wso2 cep 4.1.0 中自定义事件适配器

How to custom event adaptor in wso2 cep 4.1.0

我制作插件到 jarfile。然后我复制到 dropin 文件夹中的 jarfile。 (参考https://docs.wso2.com/display/CEP410/Building+Custom+Event+Receivers

我执行wso2 cep。命令已 './wso2server.sh -DosgiConsole'. and 'osgi > ss event-adaptor-name' 检查 ACITVE!

但是 WSO2 管理网页不存在。 'Input Event Adapter Type' 我的活动不存在。

我检查到'osgi > bundle event-adaptor-id' 结果是

No registered services.

如何在WSO2 CEP中注册服务?

我用的是eclipse,没有用maven。我用插件工程

WSO2 CEP 4.1.0 文档中的

Exposing Custom Event Receiver as an OSGI Service 部分给出了一个示例,说明如何将自定义适配器注册为 OSGI 服务。

参考上面指出的同一文档,以下是自定义适配器在 OutputEventAdapterFactory 服务下注册自身的要点。

context.getBundleContext().registerService(OutputEventAdapterFactory.class.getName(),
                    emailEventAdaptorFactory, null);

如果注册成功,您将看到“osgi > bundle event-adaptor-id”结果类似于:

osgi> bundle org.wso2.carbon.event.output.adapter.email
org.wso2.carbon.event.output.adapter.email_5.0.10 [215]
  Id=215, Status=ACTIVE      Data Root=/home/userx/wso2cep-4.1.0/repository/components/default/configuration/org.eclipse.osgi/bundles/215/data
  "Registered Services"
    {org.wso2.carbon.event.output.adapter.core.OutputEventAdapterFactory}={service.id=117}

(请注意,为了清楚起见,我没有在上面发布完整的输出)