<commit_before>package com.sixdimensions.wcm.primer.internal;

import java.util.Dictionary;
import java.util.Hashtable;

import org.osgi.framework.BundleContext;
import org.osgi.service.event.Event;
import org.osgi.service.event.EventConstants;
import org.osgi.service.event.EventHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ResourceEventListenerComponent {
	private static final Logger log = LoggerFactory
			.getLogger(ResourceEventListenerComponent.class);

	protected void registerEventLisener(BundleContext bundleContext) {
		String[] topics = new String[] { "org/apache/sling/api/resource/Resource/*" };

		Dictionary<Object, Object[]> props = new Hashtable<Object, Object[]>();
		props.put(EventConstants.EVENT_TOPIC, topics);
		bundleContext.registerService(EventHandler.class.getName(),
				new EventHandler() {
					public void handleEvent(Event event) {
						String title = (String) event.getProperty("title");
						String path = (String) event.getProperty("path");
						log.info("Title: {} Path: {}", new Object[] { title,
								path });
					}
				}, props);
	}

}
<commit_msg>Fixing to unregister service when complete<commit_after>package com.sixdimensions.wcm.primer.internal;

import java.util.Dictionary;
import java.util.Hashtable;

import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;
import org.osgi.service.event.Event;
import org.osgi.service.event.EventConstants;
import org.osgi.service.event.EventHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ResourceEventListenerComponent {
	private static final Logger log = LoggerFactory
			.getLogger(ResourceEventListenerComponent.class);

	private ServiceRegistration registration;
	

	protected void registerEventLisener(BundleContext bundleContext) {
		String[] topics = new String[] { "org/apache/sling/api/resource/Resource/*" };

		EventHandler handler = new EventHandler() {
			public void handleEvent(Event event) {
				String title = (String) event.getProperty("title");
				String path = (String) event.getProperty("path");
				log.info("Title: {} Path: {}", new Object[] { title,
						path });
			}
		};
		Dictionary<Object, Object[]> props = new Hashtable<Object, Object[]>();
		props.put(EventConstants.EVENT_TOPIC, topics);
		registration = bundleContext.registerService(EventHandler.class.getName(),
				handler, props);
	}

}

{'fraction_non_alphanumeric': 0.12081092263136119, 'fraction_numerical': 0.0016549441456350847, 'mean_word_length': 5.075376884422111, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1093722', 'n_tokens_mistral': 763, 'n_tokens_neox': 695, 'n_words': 148}