OpenWGA 7.10 - OpenWGA Concepts and Features

Design and development » Extending OpenWGA » OpenWGA java modules

Module registrars

There is one last point missing for making OpenWGA able to pickup the module definition: The module registrar and its config file.

The registrar is a simple class implementing "de.innovationgate.wga.modules.ModuleRegistrar" which adds module definitions to the module registry. Regarding the example authentication module from the previous chapter it looks like this:

package de.innovationgate.examples;


import de.innovationgate.wga.modules.ModuleRegistrar;

import de.innovationgate.wga.modules.ModuleRegistry;


public class ExampleRegistrar implements ModuleRegistrar {


    @Override

    public void registerModules(ModuleRegistry registry) {

        registry.addModuleDefinition(new ExampleAuthModuleDefinition());

    }


}

Although this concrete registrar only registers one module definition registrars are able to register unlimited numbers of modules.

The last step, the registrar configuration file, is a special text file containing the qualified name of the Registrar class. it must be at an exact special position inside your java sources folder being:

de/innovationgate/wga/modules/registrar.cfg

Its contents for this registrar above would be:

de.innovationgate.examples.ExampleRegistrar

So putting it all together the example authentication module and its registration functionality may have the following Java files structure in the project:

screenshot at 2013-04-18 14:50:18.png

That's it. An OpenWGA plugin providing these Java classes would provide the example authentication module to be available for usage as authentication source.