repositories, configurationStores, artifactResolver);
ConfigurationUtil.getConfigurationManager(kernel), repositories);
    public DeploymentContext buildConfiguration(                boolean inPlaceDeployment,                 Artifact configId,                 Object plan,                 JarFile jarFile,                 Collection configurationStores,                 ArtifactResolver artifactResolver,                 ConfigurationStore targetConfigurationStore) throws IOException, DeploymentException {        if (plan == null) {            log.warn("Expected a Descriptor but received null");            return null;        }        if (plan instanceof Descriptor == false) {            log.warn("Expected a Descriptor but received a " + plan.getClass().getName());            return null;        }        File configurationDir;        try {            configurationDir = targetConfigurationStore.createNewConfigurationDir(configId);        } catch (ConfigurationAlreadyExistsException e) {            throw new DeploymentException(e);        }        Environment environment = new Environment();         environment.setConfigId(configId);        EnvironmentBuilder.mergeEnvironments(environment, defaultEnvironment);                DeploymentContext context = null;        try {            Descriptor descriptor = (Descriptor) plan;            context = new DeploymentContext(                            configurationDir,                             inPlaceDeployment ? DeploymentUtil.toFile(jarFile) : null,                            environment,                            ConfigurationModuleType.SERVICE,                             kernel.getNaming(),                            repositories,                            configurationStores,                            artifactResolver);            if (descriptor.getComponent() != null) {            	buildComponent(descriptor, context, jarFile);            } else if (descriptor.getServiceAssembly() != null) {            	buildServiceAssembly(descriptor, context, jarFile);            } else if (descriptor.getSharedLibrary() != null) {            	buildSharedLibrary(descriptor, context, jarFile);            } else {            	throw new IllegalStateException("Invalid jbi descriptor");            }        } catch (Exception e) {            if (context != null) {                context.close();            }            DeploymentUtil.recursiveDelete(configurationDir);            throw new DeploymentException("Unable to deploy", e);        }                return context;    }