LOGGER.tracef("Starting: %s in mode %s", controller.getName(), controller.getMode());
LOGGER.infoRegisterModule(module);
try {
XResourceBuilder builder = XResourceBuilderFactory.create();
if (metadata != null) {
builder.loadFrom(metadata);
} else {
builder.loadFrom(module);
}
resource = builder.getResource();
resource.addAttachment(Module.class, module);