I have some Scala code with custom Java annotations... for Monitoring purposes (JMX and ModelMBeanOperationInfo) I would like to convert a MethodSymbol into a Java Method. FYI, this is my code to retrieve the Scala symbols for my annotated methods:
val jmxannotation = ru.typeOf[EnableForMonitoring]
val m = runtimeMirror(getClass.getClassLoader)
val mSymbol = m.classSymbol(jmxe.getClass)
val mType = mSymbol.selfType
mType.declarations.foreach(symbol => {
symbol.annotations.find(a => a.tpe == jmxannotation) match {
case Some(_) => {
info(s"(A) For $symbol on $jmxe, annotated for monitoring")
val ms = symbol.asMethod
// TODO: HOW TO CONVERT ms to a Java Method
}
case None =>
}
})
Thanks.