You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@ace.apache.org by Sibla Wilfried <Wi...@bosch-si.com> on 2013/11/21 11:39:07 UTC

Custom Agent Controller

Hi to all

I implemented a custom control similar to the integration test CustomAgentControllerTest from jan

Implementing a custom controller requires re-implementing certain functionality which is already implanted within the DefaultController respectively within the other classes of the agent.

For example it's surely recommended to send the "Deployment Complete" and "Deployment Started" events like the DefaultController does.
Even if I would copy the corresponding methods from the DefaultController to my CustomController, I'm not able to get the ACE EventHandler and to send the events by calling the postEvent method.

Getting access to the AgentContext and the registered and already available Handlers would also offer great set of feature/functionality.
For example the LoggingHandler or ConfigurationHandler etc.

Or is there access available, and I didn't found that??

A short feedback would be very welcome.

Greetings
Wilfried

AW: AW: Custom Agent Controller

Posted by Sibla Wilfried <Wi...@bosch-si.com>.
Hi Jan

Understood and I fully agree to your arguments

Thx for your help
Greeting
Wilfried


-----Ursprüngliche Nachricht-----
Von: Jan Willem Janssen [mailto:janwillem.janssen@luminis.eu] 
Gesendet: Donnerstag, 21. November 2013 13:37
An: users@ace.apache.org
Betreff: Re: AW: Custom Agent Controller

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 11/21/13 1:17 PM, Sibla Wilfried wrote:
> thx a lot for your fast reply.
> 
> My aim was to send the deployment events before and after installation 
> as done by the DefaultController. ...
> getEventsHandler().postEvent(AGENT_INSTALLATION_COMPLETE,
> eventProps);
> 
> I assumed that sending these events the same way would trigger 
> something, or is even logged or sent to the feedback channel 
> implicitely and I tried to avoid redundancy. As I could see now no one 
> is listening for that events. I assume that this optional.

Indeed, these events are completely optional and currently only used in the integration tests to obtain knowledge when the controller has started or finished an installation.

The events send by the DeploymentAdmin after installation of a deployment package is logged automatically by the agent. You do not need to do anything special for this in case of a custom controller.

That said, if you come across a functional use-case that cannot directly be supported by the current agent (or its API), it is always possible to expose this through the agent's API. We only are very cautious to do so, as we want to keep the agent as lean and simple as possible...

- --
Met vriendelijke groeten | Kind regards

Jan Willem Janssen | Software Architect
+31 631 765 814

/My world is revolving around PulseOn and Amdatu/

Luminis Technologies B.V.
J.C. Wilslaan 29
7313 HK   Apeldoorn
+31 88 586 46 30

http://www.luminis-technologies.com
http://www.luminis.eu

KvK (CoC) 09 16 28 93
BTW (VAT) NL8169.78.566.B.01
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJSjf6HAAoJEKF/mP2eHDc4PCYP/23TQBTgHTWnWVsEmM89CI57
duwDu/uG+xUKmrFaOHqt0SXoP6a1rnCTAc1tzlyYiRIkeBs2Gpt8vDM/zJ/w7qz4
0dtPaRgCiNOKmcKUFmMwUFJpD01MdF2z5SkNcjDRO3NJ5Dv02EZajb4CAAzc0AwK
Z+nzgf9vuw0IrS5OEpXzKhYgTVuOP8dY9urbzMHOQoBhCow3sFkPlrq6R/s5TyyC
ubHTOFWxzRrKYH76cJ8nXGQXVjuUBFAxnl0Jg8n99oL8/wu1+IsLhMgfwtttKtii
NtGfc6qQxkfzSnv7hOr+mRxg1gLVeKSd0adunjD7m7veZ6O41fiPm3Hsyv0oYfaT
7i4V1iul9ZxCiNLuAAp9Rfudo2FHa1YeqVTSeODOkyE7xImQrHiZRp3C/lVgWQoO
SGFKprip1IKHpCMbivBU57DyC6RnwLpO12EMeFmjqrOCTWj4C/7LICCXEc+Jyq4+
Ni7jWTgcf7XQi81ocXWgXR0Q9ZKTVcEQis3eknFf3SXAAbO6DIA16r5iAAoGJAqL
oBHMUNctwScHan8Ym2BqwEkpztU4xkERY+iAXN3sD38Pz1E3vf8UknpIEKsKEXKV
ftH3tynJNoqrE+/BHGQYzdydfyHhG83MyRqFI+eMkk9vugt9/17amYf87//mk0aH
QcGuuptln5qyLqdfkZjH
=EqRt
-----END PGP SIGNATURE-----

Re: AW: Custom Agent Controller

Posted by Jan Willem Janssen <ja...@luminis.eu>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 11/21/13 1:17 PM, Sibla Wilfried wrote:
> thx a lot for your fast reply.
> 
> My aim was to send the deployment events before and after 
> installation as done by the DefaultController. ... 
> getEventsHandler().postEvent(AGENT_INSTALLATION_COMPLETE, 
> eventProps);
> 
> I assumed that sending these events the same way would trigger 
> something, or is even logged or sent to the feedback channel 
> implicitely and I tried to avoid redundancy. As I could see now no 
> one is listening for that events. I assume that this optional.

Indeed, these events are completely optional and currently only used
in the integration tests to obtain knowledge when the controller has
started or finished an installation.

The events send by the DeploymentAdmin after installation of a
deployment package is logged automatically by the agent. You do not
need to do anything special for this in case of a custom controller.

That said, if you come across a functional use-case that cannot
directly be supported by the current agent (or its API), it is always
possible to expose this through the agent's API. We only are very
cautious to do so, as we want to keep the agent as lean and simple as
possible...

- -- 
Met vriendelijke groeten | Kind regards

Jan Willem Janssen | Software Architect
+31 631 765 814

/My world is revolving around PulseOn and Amdatu/

Luminis Technologies B.V.
J.C. Wilslaan 29
7313 HK   Apeldoorn
+31 88 586 46 30

http://www.luminis-technologies.com
http://www.luminis.eu

KvK (CoC) 09 16 28 93
BTW (VAT) NL8169.78.566.B.01
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJSjf6HAAoJEKF/mP2eHDc4PCYP/23TQBTgHTWnWVsEmM89CI57
duwDu/uG+xUKmrFaOHqt0SXoP6a1rnCTAc1tzlyYiRIkeBs2Gpt8vDM/zJ/w7qz4
0dtPaRgCiNOKmcKUFmMwUFJpD01MdF2z5SkNcjDRO3NJ5Dv02EZajb4CAAzc0AwK
Z+nzgf9vuw0IrS5OEpXzKhYgTVuOP8dY9urbzMHOQoBhCow3sFkPlrq6R/s5TyyC
ubHTOFWxzRrKYH76cJ8nXGQXVjuUBFAxnl0Jg8n99oL8/wu1+IsLhMgfwtttKtii
NtGfc6qQxkfzSnv7hOr+mRxg1gLVeKSd0adunjD7m7veZ6O41fiPm3Hsyv0oYfaT
7i4V1iul9ZxCiNLuAAp9Rfudo2FHa1YeqVTSeODOkyE7xImQrHiZRp3C/lVgWQoO
SGFKprip1IKHpCMbivBU57DyC6RnwLpO12EMeFmjqrOCTWj4C/7LICCXEc+Jyq4+
Ni7jWTgcf7XQi81ocXWgXR0Q9ZKTVcEQis3eknFf3SXAAbO6DIA16r5iAAoGJAqL
oBHMUNctwScHan8Ym2BqwEkpztU4xkERY+iAXN3sD38Pz1E3vf8UknpIEKsKEXKV
ftH3tynJNoqrE+/BHGQYzdydfyHhG83MyRqFI+eMkk9vugt9/17amYf87//mk0aH
QcGuuptln5qyLqdfkZjH
=EqRt
-----END PGP SIGNATURE-----

AW: Custom Agent Controller

Posted by Sibla Wilfried <Wi...@bosch-si.com>.
Hi Jan,

thx a lot for your fast reply.

My aim was to send the deployment events before and after installation as done by the DefaultController.
... getEventsHandler().postEvent(AGENT_INSTALLATION_COMPLETE, eventProps);

I assumed that sending these events the same way would trigger something, or is even logged or sent to the feedback channel implicitely and I tried to avoid redundancy.
As I could see now no one is listening for that events. I assume that this optional.

Thx and Greetings
Wilfried

-----Ursprüngliche Nachricht-----
Von: Jan Willem Janssen [mailto:janwillem.janssen@luminis.eu] 
Gesendet: Donnerstag, 21. November 2013 12:15
An: users@ace.apache.org
Betreff: Re: Custom Agent Controller

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Wilfried,

On 11/21/13 11:39 AM, Sibla Wilfried wrote:
> I implemented a custom control similar to the integration test 
> CustomAgentControllerTest from jan
> 
> Implementing a custom controller requires re-implementing certain 
> functionality which is already implanted within the DefaultController 
> respectively within the other classes of the agent.
> 
> For example it's surely recommended to send the "Deployment Complete" 
> and "Deployment Started" events like the DefaultController does. Even 
> if I would copy the corresponding methods from the DefaultController 
> to my CustomController, I'm not able to get the ACE EventHandler and 
> to send the events by calling the postEvent method.

As you're writing a custom controller, you already have full control as to when an installation is started and ending. Why do you need the
(internal) event handler of the agent for that?

> Getting access to the AgentContext and the registered and already 
> available Handlers would also offer great set of 
> feature/functionality. For example the LoggingHandler or 
> ConfigurationHandler etc.

The configuration handler is already exposed by the AgentControl, no need to get the AgentContext for that. But, what kind of use-cases are you thinking of that require those other handlers? Surely we could expose them all, but I'd like to do this because of missing features than simply expose them "because we can".

> Or is there access available, and I didn't found that??

AgentControl is the entry point that exposes all public APIs, so, if it isn't there, there's no direct access to it.

- --
Met vriendelijke groeten | Kind regards

Jan Willem Janssen | Software Architect
+31 631 765 814

/My world is revolving around PulseOn and Amdatu/

Luminis Technologies B.V.
J.C. Wilslaan 29
7313 HK   Apeldoorn
+31 88 586 46 30

http://www.luminis-technologies.com
http://www.luminis.eu

KvK (CoC) 09 16 28 93
BTW (VAT) NL8169.78.566.B.01
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJSjetGAAoJEKF/mP2eHDc4xh4QAIHaMnp89W772PxNdXyGQs0V
va0b0p8ULvDqMf6FPX+Gc0GKp3RIfoc1SXcgllhqhpLCAEAovdwhP69H//x2mFaK
iXvG6alMvz5yF5Erz42kzYJKXSXSQ51yRsCm01LmCCNjX2sJA6ovE2oBvZA5lMw4
p+Y3ytaWdlyYCpqt1Xc7B4La3ihrmHXgdQQkPis76T0oidhBz45sMvVLMS9ABXtN
NPSr1+bAxpbQ10/gHwjiNcL85dckN6ZJ4k/FBeokcO8oKgsGwc7dpKrAbOHNur5Q
qEuKJbJm7xhT6cuURMT8DV66YYu5MUF6FFW1v9Ae+2Re/FqLlTrrcb98EsesaAgw
FtTzcLtgmXzp4UhzreaP8eOqsvZALLSMLJym1r7TngREV4XISruZp6cg8PvIAYcH
lc9BdlAuZTwUoyq/w+bfrW50rHMFOYs26paXbQfyHdNwdGtl3n7ISM026BN188bU
DPIb0ENXiBef+CX+RJ3GpLtWQTTvJ28jIZqChJHiqzH0n0MzzVxjnZFlEfdCeCWU
ACZtzVB+XlVuR14BxdTVvJNxotQi3f+vuK8kfuGtJ8EL+CK7XlT/dm6cmrvHPdb7
Kv7ZaNb7gF0SFnef+I/+CpUfAAlDrOEtsv8dUqJPFEyNoliMivuv12YpLZ8oyQMU
lNHtb/xH7htFPv56L4J6
=ciBC
-----END PGP SIGNATURE-----

Re: Custom Agent Controller

Posted by Jan Willem Janssen <ja...@luminis.eu>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Wilfried,

On 11/21/13 11:39 AM, Sibla Wilfried wrote:
> I implemented a custom control similar to the integration test 
> CustomAgentControllerTest from jan
> 
> Implementing a custom controller requires re-implementing certain 
> functionality which is already implanted within the
> DefaultController respectively within the other classes of the
> agent.
> 
> For example it's surely recommended to send the "Deployment
> Complete" and "Deployment Started" events like the
> DefaultController does. Even if I would copy the corresponding
> methods from the DefaultController to my CustomController, I'm not
> able to get the ACE EventHandler and to send the events by calling
> the postEvent method.

As you're writing a custom controller, you already have full control
as to when an installation is started and ending. Why do you need the
(internal) event handler of the agent for that?

> Getting access to the AgentContext and the registered and already 
> available Handlers would also offer great set of 
> feature/functionality. For example the LoggingHandler or 
> ConfigurationHandler etc.

The configuration handler is already exposed by the AgentControl, no
need to get the AgentContext for that. But, what kind of use-cases are
you thinking of that require those other handlers? Surely we could
expose them all, but I'd like to do this because of missing features
than simply expose them "because we can".

> Or is there access available, and I didn't found that??

AgentControl is the entry point that exposes all public APIs, so, if
it isn't there, there's no direct access to it.

- -- 
Met vriendelijke groeten | Kind regards

Jan Willem Janssen | Software Architect
+31 631 765 814

/My world is revolving around PulseOn and Amdatu/

Luminis Technologies B.V.
J.C. Wilslaan 29
7313 HK   Apeldoorn
+31 88 586 46 30

http://www.luminis-technologies.com
http://www.luminis.eu

KvK (CoC) 09 16 28 93
BTW (VAT) NL8169.78.566.B.01
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJSjetGAAoJEKF/mP2eHDc4xh4QAIHaMnp89W772PxNdXyGQs0V
va0b0p8ULvDqMf6FPX+Gc0GKp3RIfoc1SXcgllhqhpLCAEAovdwhP69H//x2mFaK
iXvG6alMvz5yF5Erz42kzYJKXSXSQ51yRsCm01LmCCNjX2sJA6ovE2oBvZA5lMw4
p+Y3ytaWdlyYCpqt1Xc7B4La3ihrmHXgdQQkPis76T0oidhBz45sMvVLMS9ABXtN
NPSr1+bAxpbQ10/gHwjiNcL85dckN6ZJ4k/FBeokcO8oKgsGwc7dpKrAbOHNur5Q
qEuKJbJm7xhT6cuURMT8DV66YYu5MUF6FFW1v9Ae+2Re/FqLlTrrcb98EsesaAgw
FtTzcLtgmXzp4UhzreaP8eOqsvZALLSMLJym1r7TngREV4XISruZp6cg8PvIAYcH
lc9BdlAuZTwUoyq/w+bfrW50rHMFOYs26paXbQfyHdNwdGtl3n7ISM026BN188bU
DPIb0ENXiBef+CX+RJ3GpLtWQTTvJ28jIZqChJHiqzH0n0MzzVxjnZFlEfdCeCWU
ACZtzVB+XlVuR14BxdTVvJNxotQi3f+vuK8kfuGtJ8EL+CK7XlT/dm6cmrvHPdb7
Kv7ZaNb7gF0SFnef+I/+CpUfAAlDrOEtsv8dUqJPFEyNoliMivuv12YpLZ8oyQMU
lNHtb/xH7htFPv56L4J6
=ciBC
-----END PGP SIGNATURE-----