ace-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bram de Kruijff <bdekrui...@gmail.com>
Subject Re: Starting the refactored Management Agent in ACE 1.0.0
Date Wed, 14 Aug 2013 10:16:30 GMT
Hello Erik,

On Wed, Aug 14, 2013 at 11:16 AM, erik van der velden
<Erik.vanderVelden@tomtom.com> wrote:
> Hi all,
>
> I'm quite new to ACE and OSGi, so I hope I do not embarrass myself too
> much with stupid questions :-)

No problem! I have been told there are no stupid questions. Welcome to
the list :)

> I've downloaded ACE 1.0.0 and am trying to start the management agent
> using the org.apache.ace.agent.launcher package.
> Mainly because I thought this was an improved version of the old
> management agent which had code scattered all over the place.
>

I am afraid I have some bad news and some good news for you...

The bad news is that that the org.apache.ace.agent is still under
heavy construction. We are working on it right now and it will still
change significantly in trunk over the next week(s). To be honest it
probably should not have been included as part of the 1.0.0 release.

The good news is that we intend to keep the things you like. Easy
configuration, a standalone lean-and-mean bundle, clean codebase in
one place and more. Please have a look at [1] and let us know if this
meets your requirements. Any input is much appreciated.

> I had some problems that I fixed and some questions. I hope you can help
> me out.
>
> 1) there seems to be a bug in the reading of the framework properties;
>
>           Map<String, Object> frameworkProperties = new HashMap<String,
> Object>();
>           for (Entry<String, String> entry : m_configuration.entrySet())
> {
>               if (entry.getKey().startsWith("framework.")) {
>                   String frameworkKey =
> entry.getKey().replaceFirst("framework.", "");
>                   String frameworkValue =
> m_configuration.get(entry.getValue());
>                   frameworkProperties.put(frameworkKey, frameworkValue);
>               }
>           }
>
> should be
>
>           Map<String, Object> frameworkProperties = new HashMap<String,
> Object>();
>           for (Entry<String, String> entry : m_configuration.entrySet())
> {
>               if (entry.getKey().startsWith("framework.")) {
>                   String frameworkKey =
> entry.getKey().replaceFirst("framework.", "");
>                   String frameworkValue = entry.getValue(); // use entry
> value directly
>                   frameworkProperties.put(frameworkKey, frameworkValue);
>               }
>           }
>

Check

>
> 2) The agent that is started does not properly report all the audit
> events.
> I managed to trace this back to the fact that no EventAdmin was present.
> Which means that the deployment events were lost.
> I updated the bnd.bnd file of the agent to include the felix eventadmin
> (and related stuff, like the concurrent library).
> With this packaged, it now reports the events and in the ACE web client
> I can now also see the installed version.

This is still an (open) issue. We do not want EA in the agent (lean
and mean), but if there is one we should use it.

>
>
> 3) I do not like the default packaging of the MA, but I do like the
> configurability and the fact that configuration does not go via system
> properties.
> What I do not like is that the MA is started as part of the framework.
> I thought that for later upgradability it should be just a bundle,
> right?
> I tried to change the launcher to installing MA as  a bundle; e.g.,
>
> Bundle agent = context.installBundle("file:org.apache.ace.agent.jar");
> agent.start();
>

The new agent itself will be a standard bundle and the (default)
launcher will treat is as such.

> However, then I do not seem to be able to invoke the
> ManagementAgentFactory from the main due to class loading problems.
> I can lookup the service from the main, but not invoke it;
>>  java.lang.ClassCastException:
> org.apache.ace.agent.impl.ManagementAgentFactoryImpl cannot be cast to
> org.apache.ace.agent.ManagementAgentFactory
> Probably due to two different versions of the ManagementAgentFactory
> class.
>
> This is where my knowledge of OSGi lacks.
> I need to get the configuration from the command-line to the MA bundle
> somehow, but I do not know I can get the framework to import (?) from
> the MA bundle so they share the same definition of the
> ManagentAgentFactory class.
> I tried exporting it from the framework by adding the agent package to
> packages.extra configuration and importing it from the MA again. This
> did not work. The classcase is gone, instead the service can not be
> found anymore. But to be honest, I do not know exactly what I'm
> doing :-)
>
> Any help would be appreciated. Or you can convince me that it is right
> to start the MA as part of the framework : -)
>

Will need to sort this out.

> 4) The next step was going to be to deploy the eventadmin and dependancy
> manager etc as separate bundles instead of combining all in a big MA
> bundle and have a lean and mean MA bundle.

This is our intention as well.

>
> Is that a good way to go?
>
>
> Thanks for any advice you can give me.
>
> Kind regards,   Erik van der Velden

Hope this helps a little and sorry for wasting your time on a
half-finished feature..

Best Regards,
Bram

[0] https://issues.apache.org/jira/browse/ACE-347
[1] https://cwiki.apache.org/confluence/display/ACE/Analysis+and+Design+for+new+ManagementAgent

Mime
View raw message