Map<String, ArtifactObject> allProcessors = getAllProcessors();
// Determine all resource processors we need
for (String processor : artifacts.values()) {
if (!bundles.containsValue(processor)) {
ArtifactObject bundle = allProcessors.get(processor);
if (bundle == null) {
m_log.log(LogService.LOG_ERROR, "Unable to create deployment version: there is no resource processing bundle available that publishes " + processor);
throw new IOException("Unable to create deployment version: there is no resource processing bundle available that publishes " + processor);
}
bundles.put(bundle, processor);
}
}
List<DeploymentArtifact> result = new ArrayList<DeploymentArtifact>();
for (ArtifactObject bundle : bundles.keySet()) {
Map<String, String> directives = new HashMap<String, String>();
if (m_bundleHelper.isResourceProcessor(bundle)) {
// it's a resource processor, mark it as such.
directives.put(DeploymentArtifact.DIRECTIVE_ISCUSTOMIZER, "true");
}
directives.put(BundleHelper.KEY_SYMBOLICNAME, m_bundleHelper.getSymbolicName(bundle));
String bundleVersion = m_bundleHelper.getVersion(bundle);
if (bundleVersion != null) {
directives.put(BundleHelper.KEY_VERSION, bundleVersion);
}
directives.put(DeploymentArtifact.DIRECTIVE_KEY_BASEURL, bundle.getURL());
String repositoryPath = getRepositoryPath(bundle, path);
if (repositoryPath != null) {
directives.put(DeploymentArtifact.REPOSITORY_PATH, repositoryPath);
}
result.add(m_deploymentRepository.createDeploymentArtifact(bundle.getURL(), bundle.getSize(), directives));
}
for (ArtifactObject artifact : artifacts.keySet()) {
Map<String, String> directives = new HashMap<String, String>();
directives.put(DeploymentArtifact.DIRECTIVE_KEY_PROCESSORID, artifact.getProcessorPID());