class ModuleSaver {

    public KieModule save(final Path repositoryRoot,
                          final POM pom) {
        try {
            ioService.startBatch(Paths.convert(repositoryRoot).getFileSystem(),
                                 commentedOptionFactory.makeCommentedOption("New module [" + pom.getName() + "]"));

            KieModule kieModule = createNewModuleCreator(repositoryRoot, pom).create();

            newModuleEvent.fire(new NewModuleEvent(kieModule,
                                                   safeSessionInfo.getId(),
                                                   safeSessionInfo.getIdentity().getIdentifier()));
            return kieModule;
        } catch (Exception e) {
            throw ExceptionUtilities.handleException(e);
        } finally {
            ioService.endBatch();
        }
    }

    public  ModuleSaver();
    @Inject public  ModuleSaver(final @Named("ioStrategy") IOService ioService,
                       final POMService pomService,
                       final KModuleService kModuleService,
                       final Event<NewModuleEvent> newModuleEvent,
                       final Event<NewPackageEvent> newPackageEvent,
                       final KieResourceResolver resourceResolver,
                       final ProjectImportsService projectImportsService,
                       final ModuleRepositoriesService moduleRepositoriesService,
                       final PackageNameWhiteListService packageNameWhiteListService,
                       final CommentedOptionFactory commentedOptionFactory,
                       final SessionInfo sessionInfo);

}