class DeploymentDescriptorServiceCDI implements DeploymentDescriptorService {

    @Override
    public ProcessConfigModule getProcessConfig(String path) throws IOException {
        ProcessConfigModule processConfig = new ProcessConfigModule();
        KModuleContentHandler kModuleContentHandler = new KModuleContentHandler();
        try (InputStream in = IOUtils.toInputStream(guvnorM2Repository.getKieDeploymentDescriptorText(path), StandardCharsets.UTF_8)) {
            RuntimeStrategy runtimeStrategy = DeploymentDescriptorIO.fromXml(in).getRuntimeStrategy();

            switch (runtimeStrategy) {
                case SINGLETON:
                    processConfig.setRuntimeStrategy(SINGLETON);
                    break;
                case PER_CASE:
                    processConfig.setRuntimeStrategy(PER_CASE);
                    break;
                case PER_PROCESS_INSTANCE:
                    processConfig.setRuntimeStrategy(PER_PROCESS_INSTANCE);
                    break;
                case PER_REQUEST:
                    processConfig.setRuntimeStrategy(PER_REQUEST);
                    break;
            }
        }

        Map<String, KBaseModel> kBaseModelHashMap = kModuleContentHandler.toModel(guvnorM2Repository.getKModuleText(path)).getKBases();

        KBaseModel defaultKBaseModel = null;
        Optional<KBaseModel> optionalKBaseModel = kBaseModelHashMap.values().stream().filter(KBaseModel::isDefault).findFirst();
        if (optionalKBaseModel.isPresent()) {
            defaultKBaseModel = optionalKBaseModel.get();
        }

        if (defaultKBaseModel != null) {
            processConfig.setKBase(defaultKBaseModel.getName());
            Optional<KSessionModel> optionalKSessionModel = defaultKBaseModel.getKSessions().stream().filter(KSessionModel::isDefault).findFirst();
            KSessionModel defaultKSessionModel = null;
            if (optionalKSessionModel.isPresent()) {
                defaultKSessionModel = optionalKSessionModel.get();
                processConfig.setKSession(defaultKSessionModel.getName());
            }
        }
        return processConfig;
    }

    @Inject public  DeploymentDescriptorServiceCDI(GuvnorM2Repository guvnorM2Repository);

}