The simplest of cases is that of a Module that has only one configuration.
For convenience, you can use the same class that you previously annotated
with @Extension for that, for example:
@Extension(name="singleConfig")
@Operations(Operations.class)
@Sources(MessageSources.class)
@ConnectionProviders({BasicAuthConnection.class, OAuthConnection.class})
public class SingleConfigModule {
@Parameter
private String someParameter;
@Parameter
private Integer numericParameter;
public String getSomeParameter() {
return someParameter;
}
public String getNumericParameter() {
return numericParameter;
}
}
The example above shows the full skeleton of a module with a single configuration.
You can see how the same class that declares the extension with all its operations,
sources, connections, and so on, is also enriched with @Parameter annotated fields,
which will translate into the configuration’s parameters.
When another component, such as an operation or source, requires access to the
configuration, it will do so through instances of the SingleConfigModule class.