@Override
    public RegisteredService delete(final RegisteredService service) {
        return lock.tryLock(() -> {
            if (service != null) {
                val clientInfo = ClientInfoHolder.getClientInfo();
                publishEvent(new CasRegisteredServicePreDeleteEvent(this, service, clientInfo));
                configurationContext.getServiceRegistry().delete(service);
                configurationContext.getServicesCache().invalidate(service.getId());
                deleteInternal(service);
                publishEvent(new CasRegisteredServiceDeletedEvent(this, service, clientInfo));
            }
            return service;
        });
    }
This is {@link AbstractServicesManager}.

@author Misagh Moayyed
@since 5.2.0
core/cas-server-core-services-registry/src/main/java/org/apereo/cas/services/mgmt/AbstractServicesManager.java