For Groovy and Java 1.6:
Taken from
http://snipplr.com/view/20787/
The name should be something like "12345@host.example.com" (This is not guaranteed, and can vary by Java implementation)
Alternatively, if you are using Groovy on a linux/unix platform, here is how the PID can be retreived from a shell execution: