code: def __sort_registry(self, svc_ref):
          with self.__svc_lock:
              if svc_ref not in self.__svc_registry:
                  raise BundleException("Unknown service: {0}".format(svc_ref))
              for spec in svc_ref.get_property(OBJECTCLASS):
                  spec_refs = self.__svc_specs[spec]
                  idx = bisect.bisect_left(spec_refs, svc_ref)
                  del spec_refs[idx]
              svc_ref.update_sort_key()
              for spec in svc_ref.get_property(OBJECTCLASS):
                  spec_refs = self.__svc_specs[spec]
                  bisect.insort_left(spec_refs, svc_ref)