class RuleExecutor {

    public static void main(String[] args) {

        // File f = new File("rule.jar-jar-with-dependencies.jar");
        // URLClassLoader cl = new URLClassLoader(new URL[]{f.toURI().toURL(),
        // null});
        //
        // Class<?> clazz =
        // cl.loadClass("com.tmobile.cloud.awsrules.ec2.CheckForNamingConvention");
        // Method main = clazz.getMethod("main", String[].class);
        // main.invoke(null, new Object[]{args});
        // if(1==1) return;
        
        
        String executionId = UUID.randomUUID().toString(); // this is the unique
        // id for this pass
        // of execution
        
        //check if triggered by event of square one project.
        logger.debug("received input-->" + args[0]);
        if(PacEventHandler.isInvocationSourceAnEvent(args[0]))
        {
            logger.info("input source detected as event, will process event now.");
            new PacEventHandler().handleEvent(executionId,args[0]);
        }else
        {
                try {   logger.info("input source detected as rule, will process rule now.");
                        new RuleExecutor().run(args, executionId);
                } catch (Exception e) {
                    logger.error("error while in run method for executionId ->" + executionId, e);
                }
        }
    }

}