Apache ACE Agent integration with Apache Felix embedded in Tomcat?

313 views Asked by At

I have follow up question on Apache ACE together with Apache Felix embedded in Tomcat?

  1. After version 1.0 onward (0.8.1 onward) i am unable to see latest Maven repository available for retrieval of org.apache.ace.agent? I am newbie on Apache ACE. Hence was wondering whether i am missing anything?
  2. I am also having similar question. Hence wanted to check whether this was successful? If yes, then how it was achieved?
1

There are 1 answers

0
Abhay On

Let me answer my question after some tries so that others can use the same:

  1. Regarding point no 1 I am not sure about. Need to check with Apache ACE owners
  2. Regarding point no 2:

As commented by Marcel, i had extracted agent jar "jar xf target.jar jar/org.apache.ace.agent.jar" and installed the same in local maven repo with command

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

Provided this dependency in original web application maven code as detailed below:

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

Added additional configured parameters where we were instantiating Felix as detailed below:

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.