<commit_before>////////////////////////////////////////////////////////////////////////////////
package alma.acssamp.jtest;
////////////////////////////////////////////////////////////////////////////////

import alma.acs.component.client.ComponentClient;
import alma.acs.container.ContainerServices;



public class acssampJTest extends ComponentClient
{
    private acssampConsumer consumer;

    public acssampJTest(String managerLoc, String clientName)
	throws Exception
	{
	    super(null, managerLoc, clientName);

	    String ncChannel = "NC_LAMP1_brightness_1000000_10000000";

	    ContainerServices csrv = getContainerServices();
	    
	    consumer = new acssampConsumer(ncChannel, csrv);
	    try
		{
		//After consumerReady() is invoked, push_structured_event(...) is invoked
		//by the notification channel.  That is, we have no control over when
		//that method is called.
		consumer.consumerReady();
		System.out.println("Waiting for events...");
		}
	    catch(Exception e)
		{
		System.err.println(e);
		consumer.ncDisconnect();
		}
	}

    public static void main(String[] args)
	{
	    String managerLoc = System.getProperty("ACS.manager");
	    if (managerLoc == null)
		{
		System.out.println("Java property 'ACS.manager' " + 
				   " must be set to the corbaloc of the ACS manager!");
		System.exit(-1);
		}
	    
	    String clientName = "acssampJTest1";
	    
	    double d;
	    try
		{

		
		acssampJTest test = new acssampJTest(managerLoc, clientName);

		Thread.sleep(50000);
		    
		}
	    catch (Exception e)
		{
		e.printStackTrace(System.err);
		}
      
	}
}
<commit_msg>auto-formatted; added javadoc; fixed disconnect;<commit_after>////////////////////////////////////////////////////////////////////////////////
package alma.acssamp.jtest;

////////////////////////////////////////////////////////////////////////////////

import alma.acs.component.client.ComponentClient;
import alma.acs.container.ContainerServices;

/**
 * Runner for {@link acssampConsumer}.
 * Creates and activates the consumer, waits 50 seconds, then disconnects and returns.
 */
public class acssampJTest extends ComponentClient {
	private acssampConsumer consumer;

	public acssampJTest(String managerLoc, String clientName) throws Exception {
		super(null, managerLoc, clientName);
		ContainerServices csrv = getContainerServices();

		String ncChannel = "NC_LAMP1_brightness_1000000_10000000";

		consumer = new acssampConsumer(ncChannel, csrv);
		try {
			//After consumerReady() is invoked, push_structured_event(...) is invoked
			//by the notification channel.  That is, we have no control over when
			//that method is called.
			consumer.consumerReady();
			System.out.println("Waiting for events, for 50 seconds ");
			Thread.sleep(50000);
		} 
		catch (Exception e) {
			System.err.println(e);
		}
		finally {
			consumer.ncDisconnect();			
		}
	}

	public static void main(String[] args) {
		String managerLoc = System.getProperty("ACS.manager");
		if (managerLoc == null) {
			System.out.println("Java property 'ACS.manager' must be set to the corbaloc of the ACS manager!");
			System.exit(-1);
		}

		try {
			new acssampJTest(managerLoc, "acssampJTest1");
		} catch (Exception e) {
			e.printStackTrace(System.err);
		}
	}
}

{'fraction_non_alphanumeric': 0.19458960959114663, 'fraction_numerical': 0.01537042729787888, 'mean_word_length': 2.407329842931937, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '6441615', 'n_tokens_mistral': 1060, 'n_tokens_neox': 908, 'n_words': 234}