<commit_before>/*
 * Copyright (c) 2015 <NAME>' - All rights reserved.
 * 
 * This program and the accompanying materials are made available under the 
 * terms of the MIT License which accompanies this distribution, and is 
 * available at http://creativecommons.org/licenses/MIT/
 *
 * Contributors:
 *   <NAME> 
 *      - Initial concept and initial implementation
 */
package coyote.loader;

import coyote.loader.log.Log;


/**
 * 
 */
public class DefaultLoader extends AbstractLoader implements Loader {

  /** Tag used in various class identifying locations. */
  public static final String CLASS = "Loader";

  public static final String DEFAULT_DESCRIPTION = "Default component loader";




  public DefaultLoader() {

  }




  /**
   * Start the components running.
   */
  public void start() {
    // only run once, this is not foolproof as the active flag is set only when 
    // the watchdog loop is entered
    if ( isActive() ) {
      return;
    }

    // Save the name of the thread that is running this class
    final String oldName = Thread.currentThread().getName();

    // Rename this thread to the name of this class
    Thread.currentThread().setName( CLASS );

    // very important to get park(millis) to operate
    current_thread = Thread.currentThread();

    // Parse through the configuration and start setting up the component(s)
    initComponents();

    Log.info( "Components initialized" );

    // By this time all loggers (including the catch-all logger) should be open
    final StringBuffer b = new StringBuffer( CLASS );
    b.append( " initialized - Runtime: " );
    b.append( System.getProperty( "java.version" ) );
    b.append( " (" );
    b.append( System.getProperty( "java.vendor" ) );
    b.append( ")" );
    b.append( " - Platform: " );
    b.append( System.getProperty( "os.arch" ) );
    b.append( " OS: " );
    b.append( System.getProperty( "os.name" ) );
    b.append( " (" );
    b.append( System.getProperty( "os.version" ) );
    b.append( ")" );
    Log.info( b );

    // enter a loop performing watchdog and maintenance functions
    watchdog();

    // The watchdog loop has exited, so we are done processing
    Log.info( "Loader terminating" );

    // Rename the thread back to what it was called before we were being run
    Thread.currentThread().setName( oldName );

  }

}<commit_msg>Use LogMsg for i18n in default loader<commit_after>/*
 * Copyright (c) 2015 <NAME>' - All rights reserved.
 * 
 * This program and the accompanying materials are made available under the 
 * terms of the MIT License which accompanies this distribution, and is 
 * available at http://creativecommons.org/licenses/MIT/
 *
 * Contributors:
 *   <NAME> 
 *      - Initial concept and initial implementation
 */
package coyote.loader;

import coyote.loader.log.Log;
import coyote.loader.log.LogMsg;


/**
 * 
 */
public class DefaultLoader extends AbstractLoader implements Loader {

  /** Tag used in various class identifying locations. */
  public static final String CLASS = "DefaultLoader";




  public DefaultLoader() {

  }




  /**
   * Start the components running.
   */
  public void start() {
    // only start once, this is not foolproof as the active flag is set only when 
    // the watchdog loop is entered
    if ( isActive() ) {
      return;
    }

    // Save the name of the thread that is running this class
    final String oldName = Thread.currentThread().getName();

    // Rename this thread to the name of this class
    Thread.currentThread().setName( CLASS );

    // very important to get park(millis) to operate
    current_thread = Thread.currentThread();

    // Parse through the configuration and initialize all the components
    initComponents();

    Log.info( LogMsg.createMsg( "Loader.components_initialized" ) );

    // By this time all loggers (including the catch-all logger) should be open
    final StringBuffer b = new StringBuffer( CLASS );
    b.append( " initialized - Runtime: " );
    b.append( System.getProperty( "java.version" ) );
    b.append( " (" );
    b.append( System.getProperty( "java.vendor" ) );
    b.append( ")" );
    b.append( " - Platform: " );
    b.append( System.getProperty( "os.arch" ) );
    b.append( " OS: " );
    b.append( System.getProperty( "os.name" ) );
    b.append( " (" );
    b.append( System.getProperty( "os.version" ) );
    b.append( ")" );
    Log.info( b );

    // enter a loop performing watchdog and maintenance functions
    watchdog();

    // The watchdog loop has exited, so we are done processing
    terminateComponents();

    Log.info( LogMsg.createMsg( "Loader.terminated" ) );

    // Rename the thread back to what it was called before we were being run
    Thread.currentThread().setName( oldName );

  }

}
{'fraction_non_alphanumeric': 0.11411222780569515, 'fraction_numerical': 0.0020938023450586263, 'mean_word_length': 2.8805848903330626, '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': '362690', 'n_tokens_mistral': 1377, 'n_tokens_neox': 1305, 'n_words': 474}