in rsa/src/main/java/org/apache/aries/rsa/core/RemoteServiceAdminCore.java [116:146]
public List<ExportRegistration> exportService(ServiceReference serviceReference, Map additionalProperties)
throws IllegalArgumentException, UnsupportedOperationException {
Map<String, Object> serviceProperties = getProperties(serviceReference);
if (additionalProperties != null) {
overlayProperties(serviceProperties, additionalProperties);
}
Map<String, Object> key = makeKey(serviceProperties);
List<String> interfaceNames = getInterfaceNames(serviceProperties);
if (isImportedService(serviceReference) || !isExportConfigSupported(serviceProperties)) {
return Collections.emptyList();
}
List<ExportRegistration> exportRegs = getExistingAndLock(key, interfaceNames);
if (exportRegs != null) {
return exportRegs;
}
try {
ExportRegistration exportReg = exportService(interfaceNames, serviceReference, serviceProperties);
exportRegs = new ArrayList<>();
if (exportReg != null) {
exportRegs.add(exportReg);
}
store(key, exportRegs);
return exportRegs;
} finally {
unlock(key);
}
}