Skip to content

Instantly share code, notes, and snippets.

@jurberg
Created October 30, 2012 02:38
Show Gist options
  • Save jurberg/3977988 to your computer and use it in GitHub Desktop.
Save jurberg/3977988 to your computer and use it in GitHub Desktop.
Exposing a few methods using the Grails JMX plugin
class MyService {
static expose = ['jmx']
static jmxmethods = ['getTimeout', 'setTimeout']
static jmxexpose = ['excludeMethods':
MyService.metaClass.methods*.name.findAll{
!jmxmethods.contains(it)
}.join(',')]
int timeout
void nonJmxMethod() {
// stuff we shouldn't see from JMX
}
void anotherNonJmxMethod() {
// stuff we shouldn't see from JMX
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment