public synchronized void start(StartContext context) throws StartException {
ServiceController<?> controller = context.getController();
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);
injectedEnvironment.getValue().installResources(resource);
} catch (Throwable th) {
throw MESSAGES.startFailedToRegisterModule(th, module);
}