ModuleClassLoader classLoader = depUnit.getAttachment(Attachments.MODULE).getClassLoader();
try {
Runtime runtime = RuntimeLocator.getRequiredRuntime();
Module module = runtime.installModule(classLoader, resource, headers, context);
depUnit.putAttachment(GraviaConstants.MODULE_KEY, module);
depUnit.putAttachment(GraviaConstants.RESOURCE_KEY, module.adapt(Resource.class));
} catch (ModuleException ex) {
throw new DeploymentUnitProcessingException(ex);
}
}