protected void removeServiceExports()

in rsa/src/main/java/org/apache/aries/rsa/core/RemoteServiceAdminCore.java [508:527]


    protected void removeServiceExports(ServiceReference<?> sref) {
        List<ExportRegistration> regs = new ArrayList<>(1);
        synchronized (exportedServices) {
            for (Collection<ExportRegistration> value : exportedServices.values()) {
                for (ExportRegistration er : value) {
                    if (er.getException() != null ||
                            er.getExportReference() == null ||
                            er.getExportReference().getExportedService().equals(sref)) {
                        regs.add(er);
                    }
                }
            }
            // do this outside of iteration to avoid concurrent modification
            for (ExportRegistration er : regs) {
                LOG.debug("closing export for service {}", sref);
                er.close();
            }
        }

    }