Search in sources :

Example 1 with ImportedServiceImpl

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);
}
Also used : ImportedServiceImpl(org.apache.aries.application.modelling.impl.ImportedServiceImpl) ModelledResourceImpl(org.apache.aries.application.modelling.impl.ModelledResourceImpl) ExportedService(org.apache.aries.application.modelling.ExportedService) Attributes(java.util.jar.Attributes) ArrayList(java.util.ArrayList) ImportedService(org.apache.aries.application.modelling.ImportedService) ExportedServiceImpl(org.apache.aries.application.modelling.impl.ExportedServiceImpl)

Aggregations

ArrayList (java.util.ArrayList)1 Attributes (java.util.jar.Attributes)1 ExportedService (org.apache.aries.application.modelling.ExportedService)1 ImportedService (org.apache.aries.application.modelling.ImportedService)1 ExportedServiceImpl (org.apache.aries.application.modelling.impl.ExportedServiceImpl)1 ImportedServiceImpl (org.apache.aries.application.modelling.impl.ImportedServiceImpl)1 ModelledResourceImpl (org.apache.aries.application.modelling.impl.ModelledResourceImpl)1