ServiceController<Void> frameworkController = (ServiceController<Void>) getServiceContainer().getRequiredService(Services.FRAMEWORK_ACTIVATOR);
new FutureServiceValue<Void>(frameworkController).get();
// Get the {@link BundleManagerService}
ServiceController<BundleManagerService> bundleManagerService = (ServiceController<BundleManagerService>) getServiceContainer().getRequiredService(Services.BUNDLE_MANAGER);
BundleManagerService bundleManager = bundleManagerService.getValue();
ServiceController<ModuleLoader> moduleLoaderService = (ServiceController<ModuleLoader>) getServiceContainer().getRequiredService(ServiceName.parse("jboss.as.service-module-loader"));
ModuleLoader moduleLoader = moduleLoaderService.getValue();
Module module = moduleLoader.loadModule(identifier);
ServiceTarget serviceTarget = getServiceContainer().subTarget();
ServiceName serviceName = bundleManager.registerModule(serviceTarget, module, null);
return getBundleFromService(serviceName);
}