-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Separate Agent MBean from Output #62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
If MBean registered by default, then what to do with an existing output mode "mbean" ? Possible options - fully drop it, or it will behave as "none". |
Also should be noted that as mentioned in #61 package "javax.management" not available on Android.
And I don't know how to suppress those messages without removal of classes. |
I don't think mbean output is widely used, so we can drop this and clearly document this in the change log. On the other hand if enable it by default this might cause issues in some scenarios. So maybe the default should be no JMX. Regarding missing APIs on Android the only solution is probably a different JaCoCo runtime packaging without JMX and Java agent support. As the error log is not a show stopper I wouldn't try to solve this right now. |
@Godin Hi Evgeny, can you please verify that this version also works on Android? I'm asking because the current implementation has direct javax.management references from the Agent class. If this causes problems I we need to pull JMX operations into a separate class (like MBeanController was before). |
@@ -183,6 +183,16 @@ public void setClassdumpdir(final File dir) { | |||
} | |||
|
|||
/** | |||
* Sets whether the agent should exposes functionality via JMX. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: "exposes" should be replaced by "expose".
@Godin Thanks for reviewing, I fixed the typos. Good to merge? |
@marchof I'll test on Android tomorrow morning and will come back to you about merge. |
@marchof It works fine on Android, since the code to create MBean (i.e. which uses non-existent package) not executed by default. So we can safely merge this! |
Separate Agent MBean from Output
The JaCoCo agent should register an MBean separately to the output mode. This allows to use the MBean in combination with an output mode (e.g. trigger dump to file via MBean). The MBean will then have the same API as the runtime API defined in #61:
The MBean is registered by default. This behavior can be modified with the new boolean agent option mbean (e.g. mbean=false).