Skip to content

Kernel param aliases

Pierre T. edited this page Oct 14, 2015 · 5 revisions

Story: you are creating a stack of Nuun plugins and you want a coherent experience for your stack users. So you have normalized all the kernel param keys. For instance, all the keys should start by jd.stack. The problem is that you want to use a plugin which doesn’t follow your param conventions.

Solution: Create a plugin specifying an alias using your conventions for this param. Like this, all your plugin will be able to acess a normalized param. The alias will also be used to start the kernel.

For adding aliases override the following method in your plugin:

@Override
public Map<String, String> kernelParametersAliases() {
    Map<String, String> aliases = new HashMap<String, String>();
    aliases.put(KEY, ALIAS);
    return aliases;
}

Then all the plugins will be able to access the value of KEY using ALIAS.

Content

Clone this wiki locally