class Fabric8EventBasedConfigMapChangeDetector extends ConfigurationChangeDetector {

	private static final LogAccessor LOG = new LogAccessor(
			LogFactory.getLog(Fabric8EventBasedConfigMapChangeDetector.class));

	private final Fabric8ConfigMapPropertySourceLocator fabric8ConfigMapPropertySourceLocator;

	private final KubernetesClient kubernetesClient;

	private final List<SharedIndexInformer<ConfigMap>> informers = new ArrayList<>();

	private final Set<String> namespaces;

	private final boolean enableReloadFiltering;

	public Fabric8EventBasedConfigMapChangeDetector(AbstractEnvironment environment, ConfigReloadProperties properties,
			KubernetesClient kubernetesClient, ConfigurationUpdateStrategy strategy,
			Fabric8ConfigMapPropertySourceLocator fabric8ConfigMapPropertySourceLocator,
			KubernetesNamespaceProvider namespaceProvider) {
		super(environment, properties, strategy);
		this.kubernetesClient = kubernetesClient;
		this.fabric8ConfigMapPropertySourceLocator = fabric8ConfigMapPropertySourceLocator;
		this.enableReloadFiltering = properties.enableReloadFiltering();
		namespaces = namespaces(kubernetesClient, namespaceProvider, properties, "configmap");
	}

	@PostConstruct
	private void inform() {<FILL_FUNCTION_BODY>}

	@PreDestroy
	private void shutdown() {
		informers.forEach(SharedIndexInformer::close);
		// Ensure the kubernetes client is cleaned up from spare threads when shutting
		// down
		kubernetesClient.close();
	}

	protected void onEvent(ConfigMap configMap) {
		boolean reload = ConfigReloadUtil.reload("config-map", configMap.toString(),
				fabric8ConfigMapPropertySourceLocator, environment, Fabric8ConfigMapPropertySource.class);
		if (reload) {
			reloadProperties();
		}
	}

	private final class ConfigMapInformerAwareEventHandler implements ResourceEventHandler<ConfigMap> {

		private final SharedIndexInformer<ConfigMap> informer;

		private ConfigMapInformerAwareEventHandler(SharedIndexInformer<ConfigMap> informer) {
			this.informer = informer;
		}

		@Override
		public void onAdd(ConfigMap configMap) {
			LOG.debug("ConfigMap " + configMap.getMetadata().getName() + " was added in namespace "
					+ configMap.getMetadata().getNamespace());
			onEvent(configMap);
		}

		@Override
		public void onUpdate(ConfigMap oldConfigMap, ConfigMap newConfigMap) {
			LOG.debug("ConfigMap " + newConfigMap.getMetadata().getName() + " was updated in namespace "
					+ newConfigMap.getMetadata().getNamespace());
			if (Objects.equals(oldConfigMap.getData(), newConfigMap.getData())) {
				LOG.debug(() -> "data in configmap has not changed, will not reload");
			}
			else {
				onEvent(newConfigMap);
			}
		}

		@Override
		public void onDelete(ConfigMap configMap, boolean deletedFinalStateUnknown) {
			LOG.debug("ConfigMap " + configMap.getMetadata().getName() + " was deleted in namespace "
					+ configMap.getMetadata().getName());
			onEvent(configMap);
		}

		@Override
		public void onNothing() {
			List<ConfigMap> store = informer.getStore().list();
			LOG.info("onNothing called with a store of size : " + store.size());
			LOG.info("this might be an indication of a HTTP_GONE code");
		}

	}

}

		LOG.info("Kubernetes event-based configMap change detector activated");

		namespaces.forEach(namespace -> {
			SharedIndexInformer<ConfigMap> informer;
			if (enableReloadFiltering) {
				informer = kubernetesClient.configMaps().inNamespace(namespace)
						.withLabels(Map.of(ConfigReloadProperties.RELOAD_LABEL_FILTER, "true")).inform();
				LOG.debug("added configmap informer for namespace : " + namespace + " with enabled filter");
			}
			else {
				informer = kubernetesClient.configMaps().inNamespace(namespace).inform();
				LOG.debug("added configmap informer for namespace : " + namespace);
			}

			informer.addEventHandler(new ConfigMapInformerAwareEventHandler(informer));
			informers.add(informer);
		});
	
<methods>public void <init>(org.springframework.core.env.ConfigurableEnvironment, ConfigReloadProperties, ConfigurationUpdateStrategy) ,public void reloadProperties() <variables>private static final org.springframework.core.log.LogAccessor LOG,protected org.springframework.core.env.ConfigurableEnvironment environment,protected ConfigReloadProperties properties,protected ConfigurationUpdateStrategy strategy