【问题标题】:Apache ACE Agent integration with Apache Felix embedded in Tomcat?Apache ACE 代理与嵌入在 Tomcat 中的 Apache Felix 集成?
【发布时间】:2014-12-10 06:33:18
【问题描述】:

我有后续问题 Apache ACE together with Apache Felix embedded in Tomcat?

  1. 在 1.0 版(0.8.1 版)之后,我无法看到可用于检索 org.apache.ace.agent 的最新 Maven 存储库?我是 Apache ACE 的新手。因此想知道我是否遗漏了什么?
  2. 我也有类似的问题。因此想检查这是否成功?如果是,那么它是如何实现的?

【问题讨论】:

    标签: apache-ace


    【解决方案1】:

    让我在尝试一些之后回答我的问题,以便其他人可以使用相同的:

    1. 关于第 1 点我不确定。需要咨询 Apache ACE 所有者
    2. 关于第 2 点:

    正如 Marcel 所说,我已经提取了代理 jar "jar xf target.jar jar/org.apache.ace.agent.jar" 并使用命令将其安装在本地 maven repo 中

    mvn install:install-file -Dfile=./org.apache.ace.agent.jar -DgroupId=org.apache.ace -DartifactId=org.apache.ace.agent -Dversion=2.0.1 -Dpackaging=jar
    

    在原始 Web 应用程序 maven 代码中提供了这种依赖关系,详情如下:

    <dependency>
        <groupId>org.apache.ace</groupId>
        <artifactId>org.apache.ace.agent</artifactId>
        <version>2.0.1</version>
    </dependency>
    

    在我们实例化 Felix 的地方添加了额外的配置参数,详情如下:

    String localId = UUID.randomUUID().toString();
    Map config = new HashMap();
    //Here i am adding Apache ACE agent configuration. For now two are ok
    config.put(AgentConstants.CONFIG_DISCOVERY_SERVERURLS, "http://localhost:8080");
    config.put(AgentConstants.CONFIG_IDENTIFICATION_AGENTID, localId);
    
    List<BundleActivator> activators = new ArrayList<>();
    //Here i am attaching Apache ACE activator as system activator
    activators.add((BundleActivator) new Activator());
    config.put(FelixConstants.SYSTEMBUNDLE_ACTIVATORS_PROP, activators);
    
    Felix felix = new Felix(config);
    .... regular felix.start etc goes here.
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-09
      • 2014-10-16
      • 2012-07-26
      • 2022-01-19
      • 2015-08-28
      • 2018-05-14
      相关资源
      最近更新 更多