package dk.statsbiblioteket.newspaper.md5checker;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import dk.statsbiblioteket.medieplatform.autonomous.RunnableComponent;
import dk.statsbiblioteket.medieplatform.autonomous.AutonomousComponentUtils;

import java.util.Map;
import java.util.Properties;

/** This is a sample component to serve as a guide to developers */
public class MD5Checker {


    private static Logger log = LoggerFactory.getLogger(MD5Checker.class);

    /**
     * The class must have a main method, so it can be started as a command line tool
     *
     * @param args the arguments.
     *
     * @throws Exception
     * @see AutonomousComponentUtils#parseArgs(String[])
     */
    public static void main(String[] args)
            throws
            Exception {
        log.info("Starting with args {}", args);

        //Parse the args to a properties construct
        Properties properties = AutonomousComponentUtils.parseArgs(args);

        //make a new runnable component from the properties
        RunnableComponent component = new MD5CheckerComponent(properties);

        Map<String, Boolean> result = AutonomousComponentUtils.startAutonomousComponent(properties, component);

        AutonomousComponentUtils.printResults(result);
    }
}
@@ -102,16 +102,80 @@
 ctory;%0A%0A
+import dk.statsbiblioteket.medieplatform.autonomous.CallResult;%0A
 import d
@@ -810,47 +810,361 @@
 ring
-%5B%5D
+...
  args)
-%0A            throws%0A           
+ throws Exception %7B%0A        System.exit(doMain(args));%0A    %7D%0A%0A    /**%0A     * The class must have a main method, so it can be started as a command line tool%0A     *%0A     * @param args the arguments.%0A     *%0A     * @throws Exception%0A     * @see AutonomousComponentUtils#parseArgs(String%5B%5D)%0A     */%0A    public static int doMain(String%5B%5D args) throws
  Exc
@@ -1496,28 +1496,18 @@
     
-Map%3CString, Boolean%3E
+CallResult
  res
@@ -1599,52 +1599,75 @@
     
-AutonomousComponentUtils
+System.out
 .print
-R
+ln(r
 esult
-s(result
+);%0A        return result.containsFailures(
 );%0A 

Update to match new framework interface, and return status code on failure