use of org.apache.aries.application.modelling.impl.ImportedServiceImpl in project aries by apache.
the class DeployedBundlesTest method createModelledServiceBundle.
public static ModelledResource createModelledServiceBundle(String bundleName, String bundleVersion, Collection<String> importService, Collection<String> exportService) throws InvalidAttributeException {
Attributes att = new Attributes();
att.put(new Attributes.Name(Constants.BUNDLE_SYMBOLICNAME), bundleName);
att.put(new Attributes.Name(Constants.BUNDLE_VERSION), bundleVersion);
att.put(new Attributes.Name(Constants.BUNDLE_MANIFESTVERSION), "2");
List<ImportedService> importedServices = new ArrayList<ImportedService>();
for (String s : importService) {
importedServices.add(new ImportedServiceImpl(false, s, null, null, null, false));
}
List<ExportedService> exportedServices = new ArrayList<ExportedService>();
for (String s : exportService) {
exportedServices.add(new ExportedServiceImpl(null, 0, Collections.singleton(s), Collections.<String, Object>emptyMap()));
}
return new ModelledResourceImpl(null, att, importedServices, exportedServices);
}
Aggregations