On Jul 13, 2009, at 753AM, Tom Hobbs wrote:


Someone on the Jini-Users (or similar, I can't quite remember) a while
ago was talking about using Groovy classes to describe service
configuration.  Something like this sounds pretty neat, but anything
that needs to be recompiled for changes can take affect is likely to be
unworkable for obvious reasons.

I brought up the Groovy config support. Rio has switched over from the Jini configuration file approach to now use Groovy classes. No compilation is required, the Groovy classes are parsed when loaded by the GroovyConfiguration utility. A simple example of a Groovy configuration for Reggie follows:

@Component('com.sun.jini.reggie')
class ReggieConfig {

    String[] getInitialMemberGroups() {
def groups = [System.getProperty(Constants.GROUPS_PROPERTY_NAME, 'rio')]
        return (String[])groups
    }

    String getUnicastDiscoveryHost() {
        return java.net.InetAddress.getLocalHost().getHostAddress()
    }

}




Reply via email to