I have made a small experiments and it seems that having
a default body doesn't prevent an interface method from
being called from either a JMX or a Platform proxy.
So in the light of this I'll suggest to add a default body
that throw UnsupportedOperationException to the new methods
added to the ThreadMXBean interface, and add an @implSpec
to specify that if not implemented, the method will throw
This should guarantee better backward compatibility in case
someone has implemented the ThreadMXBean interface.
Mandy, would you agree?
On 08/08/2017 09:27, Ujwal Vangapally wrote:
below is the link to new webrev incorporating review comments.
MBeanServerConnection.invoke throws ReflectionException when invoked
with a method that doesn't exist in remote MBean server.
UndeclaredThrowableException will be throwed when a client gets proxy of
remote MBean server and calls a method that doesn't exist on remote
do we need to develop Automated tests for verifying above cases ?
On 8/4/2017 5:42 AM, Mandy Chung wrote:
On Aug 3, 2017, at 2:10 PM, Daniel Fuchs <daniel.fu...@oracle.com>
Thanks. That’s what I think but need assurance. We should add tests to
On 03/08/17 21:04, Mandy Chung wrote:
Adding a public method to an interface is an incompatible source
change unless there is a default body. On the other hand I am not
sure how MXBean proxies will work when proxying an interface
containing a default body. It would be interesting to check this.
ThreadMXBean is a platform MXBean and so JDK implementation is the
one implementing it. The real question here is that when
MBeanServerConnection.invoke is called on this new method that does
not exist in the remote MBeanServer (running on JDK 9 for example),
does it get javax.management.ReflectionException? Or something else?
I believe that will be a ReflectionException:
Similarly, when the client gets a proxy of ThreadMXBean from a
remote MBeanServer running on JDK 9 VM, and it calls this method,
what exception does it get? We may need to update the spec to
indicate this error cases if it’s not clear. The notes in
ManagementFactory.newPlatformMXBeanProxy covers some cases due to
the difference in the client/server are running on.
AFAIK that should be handled by the proxy code - I'd expect that you
will get an UndeclaredThrowableException wrapping the