The controller configuration that contains the routing rules is loaded from the
controller.xml file retrieved in the GateIn configuration directory. Its location is determined by the
WebAppController loads and initializes the mapping engine.
<!-- conf/portal/controller-configuration.xml of portal.war -->
GateIn's extension project can define their own routing table, thanks to the extension mechanism.
controller.xml file can be changed and reloaded at runtime. This helps the test of different configurations easily (configuration loading operations) and provides more insight into the routing engine (the findRoutes operation). See Rebuiding controller below for more details.
The WebAppController is annotated with
@Managed annotations and is bound under the
view=portal,service=controller JMX name and under the "portalcontroller" REST name.
It provides the following attributes and operations:
Attribute configurationPath: The "read-only" configuration path of the
Operation loadConfiguration: Loads a new configuration file from a specified XML path.
Operation reloadConfiguration: Reloads the configuration file.
Operation findRoutes: Routes the request argument through the controller and returns a list of all parameter map resolutions. The argument is a request URI, such as
/g/:platform:administrators/administration/registry. It returns a string representation (
List<Map>) of the matched routes.