You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@groovy.apache.org by Gerald Wiltse <je...@gmail.com> on 2016/03/20 23:53:33 UTC

Casting GroovyMbean as custom class

Hello,

I'm gathering a number of GroovyMBeans from remote servers over JMX, and I
have them each modeled with a custom classes.  I was hoping to be able to
simply cast the MBean as the other object type but get this error:

 with class 'groovy.util.GroovyMBean' to class
'com.dev.core.JdeInstanceBean'"

Is my goal even possible?

I think groovy would make it easy to do manually copy all the applicable
attributes/values from the GroovyMbean to a new instance of my class, but I
wanted to avoid that if possible.



Gerald R. Wiltse
jerrywiltse@gmail.com